From e0b87852d519cf31cee961e9c07f7af7ace9dd4c Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH 001/440] Empty default branch for forked repos Signed-off-by: Vitaliy Potyarkin --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..7463f9e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# WIP area: this repo is just a fork! + +Useful things may be published only in [other branches](../../../branches) From fe877a169f00424244201e3098bcbabc53500982 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 30 Jan 2020 14:41:24 +0300 Subject: [PATCH 002/440] initialize --- .github/markdown.tmpl | 83 +++++ .gitignore | 2 + LICENSE.md | 675 +++++++++++++++++++++++++++++++++++++ Makefile | 36 ++ README.md | 115 +++++++ accounting/service.proto | 35 ++ accounting/types.proto | 124 +++++++ accounting/withdraw.proto | 100 ++++++ bootstrap/service.proto | 29 ++ bootstrap/types.proto | 28 ++ container/service.proto | 100 ++++++ container/types.proto | 34 ++ decimal/decimal.proto | 17 + docs/.gitkeep | 0 object/service.proto | 186 ++++++++++ object/types.proto | 131 +++++++ proto-docs/accounting.md | 491 +++++++++++++++++++++++++++ proto-docs/bootstrap.md | 133 ++++++++ proto-docs/container.md | 261 ++++++++++++++ proto-docs/decimal.md | 61 ++++ proto-docs/object.md | 537 +++++++++++++++++++++++++++++ proto-docs/query.md | 86 +++++ proto-docs/refs.md | 61 ++++ proto-docs/service.md | 121 +++++++ proto-docs/session.md | 157 +++++++++ proto-docs/state.md | 188 +++++++++++ proto-docs/storagegroup.md | 88 +++++ query/types.proto | 32 ++ refs/types.proto | 18 + service/meta.proto | 19 ++ service/verify.proto | 30 ++ session/service.proto | 52 +++ session/types.proto | 34 ++ state/service.proto | 78 +++++ storagegroup/types.proto | 35 ++ 35 files changed, 4177 insertions(+) create mode 100644 .github/markdown.tmpl create mode 100644 .gitignore create mode 100644 LICENSE.md create mode 100644 Makefile create mode 100644 README.md create mode 100644 accounting/service.proto create mode 100644 accounting/types.proto create mode 100644 accounting/withdraw.proto create mode 100644 bootstrap/service.proto create mode 100644 bootstrap/types.proto create mode 100644 container/service.proto create mode 100644 container/types.proto create mode 100644 decimal/decimal.proto create mode 100644 docs/.gitkeep create mode 100644 object/service.proto create mode 100644 object/types.proto create mode 100644 proto-docs/accounting.md create mode 100644 proto-docs/bootstrap.md create mode 100644 proto-docs/container.md create mode 100644 proto-docs/decimal.md create mode 100644 proto-docs/object.md create mode 100644 proto-docs/query.md create mode 100644 proto-docs/refs.md create mode 100644 proto-docs/service.md create mode 100644 proto-docs/session.md create mode 100644 proto-docs/state.md create mode 100644 proto-docs/storagegroup.md create mode 100644 query/types.proto create mode 100644 refs/types.proto create mode 100644 service/meta.proto create mode 100644 service/verify.proto create mode 100644 session/service.proto create mode 100644 session/types.proto create mode 100644 state/service.proto create mode 100644 storagegroup/types.proto diff --git a/.github/markdown.tmpl b/.github/markdown.tmpl new file mode 100644 index 0000000..f945c13 --- /dev/null +++ b/.github/markdown.tmpl @@ -0,0 +1,83 @@ +# Protocol Documentation + + +## Table of Contents +{{range .Files}} +{{$file_name := .Name}}- [{{.Name}}](#{{.Name}}) +{{if .Services}} - Services + {{range .Services}}- [{{.Name}}](#{{.FullName}}) + {{end}}{{end}} +{{if .Messages}} - Messages + {{range .Messages}}- [{{.LongName}}](#{{.FullName}}) + {{end}}{{end}} +{{end}} +- [Scalar Value Types](#scalar-value-types) + +{{range .Files}} +{{$file_name := .Name}} + +

Top

+ +## {{.Name}} +{{.Description}} + +{{range .Services}} + + + +### Service "{{.FullName}}" +{{.Description}} + +``` +{{range .Methods -}} + rpc {{.Name}}({{if .RequestStreaming}}stream {{end}}{{.RequestLongType}}) returns ({{if .ResponseStreaming}}stream {{end}}{{.ResponseLongType}}); +{{end}} +``` + +{{range .Methods -}} +#### Method {{.Name}} + +{{.Description}} + +| Name | Input | Output | +| ---- | ----- | ------ | +| {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType}}) | [{{.ResponseLongType}}](#{{.ResponseFullType}}) | +{{end}}{{end}} + +{{range .Messages}} + + +### Message {{.LongName}} +{{.Description}} + +{{if .HasFields}} +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +{{range .Fields -}} + | {{.Name}} | [{{.LongType}}](#{{.FullType}}) | {{.Label}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} | +{{end}}{{end}} +{{end}} + +{{range .Enums}} + + +### {{.LongName}} +{{.Description}} + +| Name | Number | Description | +| ---- | ------ | ----------- | +{{range .Values -}} + | {{.Name}} | {{.Number}} | {{nobr .Description}} | +{{end}} + +{{end}} + +{{end}} + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +{{range .Scalars -}} + | {{.ProtoType}} | {{.Notes}} | {{.CppType}} | {{.JavaType}} | {{.PythonType}} | +{{end}} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1df644c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +vendor +**/*.pb.go diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..5c13ba2 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,675 @@ +### GNU GENERAL PUBLIC LICENSE + +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. + + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +### Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, use +the GNU General Public License for most of our software; it applies +also to any other work released this way by its authors. You can apply +it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + +### TERMS AND CONDITIONS + +#### 0. Definitions. + +"This License" refers to version 3 of the GNU General Public License. + +"Copyright" also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +"The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + +To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a "modified version" of +the earlier work or a work "based on" the earlier work. + +A "covered work" means either the unmodified Program or a work based +on the Program. + +To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays "Appropriate Legal Notices" to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +#### 1. Source Code. + +The "source code" for a work means the preferred form of the work for +making modifications to it. "Object code" means any non-source form of +a work. + +A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +#### 2. Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 makes +it unnecessary. + +#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +#### 4. Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +#### 5. Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +- a) The work must carry prominent notices stating that you modified +it, and giving a relevant date. +- b) The work must carry prominent notices stating that it is +released under this License and any conditions added under +section 7. This requirement modifies the requirement in section 4 +to "keep intact all notices". +- c) You must license the entire work, as a whole, under this +License to anyone who comes into possession of a copy. This +License will therefore apply, along with any applicable section 7 +additional terms, to the whole of the work, and all its parts, +regardless of how they are packaged. This License gives no +permission to license the work in any other way, but it does not +invalidate such permission if you have separately received it. +- d) If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your +work need not make them do so. + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +#### 6. Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +- a) Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium +customarily used for software interchange. +- b) Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a +written offer, valid for at least three years and valid for as +long as you offer spare parts or customer support for that product +model, to give anyone who possesses the object code either (1) a +copy of the Corresponding Source for all the software in the +product that is covered by this License, on a durable physical +medium customarily used for software interchange, for a price no +more than your reasonable cost of physically performing this +conveying of source, or (2) access to copy the Corresponding +Source from a network server at no charge. +- c) Convey individual copies of the object code with a copy of the +written offer to provide the Corresponding Source. This +alternative is allowed only occasionally and noncommercially, and +only if you received the object code with such an offer, in accord +with subsection 6b. +- d) Convey the object code by offering access from a designated +place (gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to +copy the object code is a network server, the Corresponding Source +may be on a different server (operated by you or a third party) +that supports equivalent copying facilities, provided you maintain +clear directions next to the object code saying where to find the +Corresponding Source. Regardless of what server hosts the +Corresponding Source, you remain obligated to ensure that it is +available for as long as needed to satisfy these requirements. +- e) Convey the object code using peer-to-peer transmission, +provided you inform other peers where the object code and +Corresponding Source of the work are being offered to the general +public at no charge under subsection 6d. + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +"normally used" refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +"Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +#### 7. Additional Terms. + +"Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +- a) Disclaiming warranty or limiting liability differently from the +terms of sections 15 and 16 of this License; or +- b) Requiring preservation of specified reasonable legal notices or +author attributions in that material or in the Appropriate Legal +Notices displayed by works containing it; or +- c) Prohibiting misrepresentation of the origin of that material, +or requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or +- d) Limiting the use for publicity purposes of names of licensors +or authors of the material; or +- e) Declining to grant rights under trademark law for use of some +trade names, trademarks, or service marks; or +- f) Requiring indemnification of licensors and authors of that +material by anyone who conveys the material (or modified versions +of it) with contractual assumptions of liability to the recipient, +for any liability that these contractual assumptions directly +impose on those licensors and authors. + +All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +#### 8. Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +#### 9. Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +#### 10. Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +#### 11. Patents. + +A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + +A contributor's "essential patent claims" are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is "discriminatory" if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +#### 12. No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree to +terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +#### 13. Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +#### 14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If the +Program does not specify a version number of the GNU General Public +License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +#### 15. Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +#### 16. Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +#### 17. Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS + +### How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest to +attach them to the start of each source file to most effectively state +the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + +Copyright (C) + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Also add information on how to contact you by electronic and paper +mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands \`show w' and \`show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + +You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + +The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2c672d0 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +NETMAP_VERSION=v1.6.1 +GOGOPROTO_VERSION=v1.3.1 + +NETMAP_URL=https://github.com/nspcc-dev/netmap/archive/$(NETMAP_VERSION).tar.gz +GOGOPROTO_URL=https://github.com/gogo/protobuf/archive/$(GOGOPROTO_VERSION).tar.gz + +.PHONY: deps docgen + +deps: + @echo "=> Prepare" + @rm -rf ./vendor/github.com/gogo/protobuf + @rm -rf ./vendor/github.com/nspcc-dev/netmap + @mkdir -p ./vendor/github.com/gogo/protobuf + @mkdir -p ./vendor/github.com/nspcc-dev/netmap + + @echo "=> Download" + @curl -sL -o ./vendor/gogo.tar.gz $(GOGOPROTO_URL) + @curl -sL -o ./vendor/netmap.tar.gz $(NETMAP_URL) + + @echo "=> Vendoring" + @tar -xzf ./vendor/gogo.tar.gz --strip-components 1 -C ./vendor/github.com/gogo/protobuf + @tar -xzf ./vendor/netmap.tar.gz --strip-components 1 -C ./vendor/github.com/nspcc-dev/netmap + + @echo "=> Cleanup" + @rm ./vendor/gogo.tar.gz + @rm ./vendor/netmap.tar.gz + +# Regenerate documentation for protot files: +docgen: deps + @for f in `find . -type f -name '*.proto' -not -path './vendor/*' -exec dirname {} \; | sort -u `; do \ + echo "${B}${G}⇒ Documentation for $$(basename $$f) ${R}"; \ + protoc \ + --doc_opt=.github/markdown.tmpl,$${f}.md \ + --proto_path=.:./vendor:/usr/local/include \ + --doc_out=proto-docs/ $${f}/*.proto; \ + done diff --git a/README.md b/README.md new file mode 100644 index 0000000..2cd9527 --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +# NeoFS-proto + +NeoFS-proto repository contains implementation of core NeoFS structures that +can be used for integration with NeoFS. + +## Description + +Repository contains 13 packages that implement NeoFS core structures. These +packages mostly contain protobuf files with service and structure definitions +or NeoFS core types with complemented functions. + +There is a auto-generated documentation for protobuf files in [docs](proto-docs). + +### Accounting + +Accounting package defines services and structures for accounting operations: +balance request and `cheque` operations for withdraw. `Cheque` is a structure +with inner ring signatures, which approve that user can withdraw requested +amount of assets. NeoFS smart contract takes binary formatted `cheque` as a +parameter in withdraw call. + +#### API +Accounting package defines: +- [Accounting service](proto-docs/accounting.md#accounting.Accounting) +- [Withdraw service](proto-docs/accounting.md#accounting.Withdraw) + + +### Bootstrap + +Bootstrap package defines bootstrap service which is used by storage nodes to +connect to the storage network. + +#### API +Bootstrap package defines: +- [Bootstrap service](proto-docs/bootstrap.md#bootstrap.Bootstrap) + + +### Chain + +Chain package contains util functions for operations with NEO Blockchain types: +wallet addresses, script-hashes. + +### Container + +Container package defines service and structures for operations with containers. +Objects in NeoFS are stored in containers. Container defines storage +policy for the objects. + +#### API +Bootstrap package defines: +- [Container service](proto-docs/container.md#container.Service) + +### Decimal + +Decimal defines custom decimal implementation which is used in accounting +operations. + +### Hash + +Hash package defines homomorphic hash type. + +### Internal + +Internal package defines constant error type and proto interface for custom +protobuf structures. + +### Object + +Object package defines service and structures for object operations. Object is +a core storage structure in NeoFS. Package contains detailed information +about object internal structure. + +#### API +Object package defines: +- [Object service](proto-docs/object.md#object.Service) + +### Query + +Query package defines structure for object search requests. + +### Refs + +Refs package defines core identity types: Object ID, Container ID, etc. + +### Service + +Service package defines util structure and functions for all NeoFS services +operations: TTL and request signature management, node roles, epoch retriever. + +### Session + +Session package defines service and structures for session obtain. Object +operations require an established session with pair of session keys signed by +owner of the object. + +#### API +Session package defines: +- [Session service](proto-docs/session.md#session.Session) + +### State + +State package defines service and structures for metrics gathering. + +#### API +State package defines: +- [Status service](proto-docs/state.md#state.Status) + +## Contributing + +At this moment, we do not accept contributions. + +## License + +This project is licensed under the GPLv3 License - +see the [LICENSE.md](LICENSE.md) file for details diff --git a/accounting/service.proto b/accounting/service.proto new file mode 100644 index 0000000..f2696c4 --- /dev/null +++ b/accounting/service.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package accounting; +option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; + +import "service/meta.proto"; +import "service/verify.proto"; +import "decimal/decimal.proto"; +import "accounting/types.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Accounting is a service that provides access for accounting balance +// information +service Accounting { + // Balance returns current balance status of the NeoFS user + rpc Balance(BalanceRequest) returns (BalanceResponse); +} + +message BalanceRequest { + // OwnerID is a wallet address + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message BalanceResponse { + // Balance contains current account balance state + decimal.Decimal Balance = 1; + // LockAccounts contains information about locked funds. Locked funds appear + // when user pays for storage or withdraw assets. + repeated Account LockAccounts = 2; +} diff --git a/accounting/types.proto b/accounting/types.proto new file mode 100644 index 0000000..ac512b9 --- /dev/null +++ b/accounting/types.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; +package accounting; +option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; + +import "decimal/decimal.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message Account { + // OwnerID is a wallet address + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // Address is identifier of accounting record + string Address = 2; + // ParentAddress is identifier of parent accounting record + string ParentAddress = 3; + // ActiveFunds is amount of active (non locked) funds for account + decimal.Decimal ActiveFunds = 4; + // Lifetime is time until account is valid (used for lock accounts) + Lifetime Lifetime = 5 [(gogoproto.nullable) = false]; + // LockTarget is the purpose of lock funds (it might be withdraw or payment for storage) + LockTarget LockTarget = 6; + // LockAccounts contains child accounts with locked funds + repeated Account LockAccounts = 7; +} + +// LockTarget must be one of two options +message LockTarget { + oneof Target { + // WithdrawTarget used when user requested withdraw + WithdrawTarget WithdrawTarget = 1; + // ContainerCreateTarget used when user requested creation of container + ContainerCreateTarget ContainerCreateTarget = 2; + } +} + +message Balances { + // Accounts contains multiple account snapshots + repeated Account Accounts = 1 [(gogoproto.nullable) = false]; +} + +message PayIO { + // BlockID contains id of the NEO block where withdraw or deposit + // call was invoked + uint64 BlockID = 1; + // Transactions contains all transactions that founded in block + // and used for PayIO + repeated Tx Transactions = 2 [(gogoproto.nullable) = false]; +} + +message Lifetime { + // Unit can be Unlimited, based on NeoFS epoch or Neo block + enum Unit { + Unlimited = 0; + NeoFSEpoch = 1; + NeoBlock = 2; + } + + // Unit describes how lifetime is measured in account + Unit unit = 1 [(gogoproto.customname) = "Unit"]; + // Value describes how long lifetime will be valid + int64 Value = 2; +} + +message Tx { + // Type can be withdrawal, payIO or inner + enum Type { + Unknown = 0; + Withdraw = 1; + PayIO = 2; + Inner = 3; + } + + // Type describes target of transaction + Type type = 1 [(gogoproto.customname) = "Type"]; + // From describes sender of funds + string From = 2; + // To describes receiver of funds + string To = 3; + // Amount describes amount of funds + decimal.Decimal Amount = 4; + // PublicKeys contains public key of sender + bytes PublicKeys = 5; +} + +message Settlement { + message Receiver { + // To is the address of funds recipient + string To = 1; + // Amount is the amount of funds that will be sent + decimal.Decimal Amount = 2; + } + + message Container { + // CID is container identifier + bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + // SGIDs is a set of storage groups that successfully passed the audit + repeated bytes SGIDs = 2 [(gogoproto.customtype) = "SGID", (gogoproto.nullable) = false]; + } + + message Tx { + // From is the address of the sender of funds + string From = 1; + // Container that successfully had passed the audit + Container Container = 2 [(gogoproto.nullable) = false]; + // Receivers is a set of addresses of funds recipients + repeated Receiver Receivers = 3 [(gogoproto.nullable) = false]; + } + + // Epoch contains an epoch when settlement was accepted + uint64 Epoch = 1; + // Transactions is a set of transactions + repeated Tx Transactions = 2; +} + +message ContainerCreateTarget { + // CID is container identifier + bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; +} + +message WithdrawTarget { + // Cheque is a string representation of cheque id + string Cheque = 1; +} diff --git a/accounting/withdraw.proto b/accounting/withdraw.proto new file mode 100644 index 0000000..a44e47a --- /dev/null +++ b/accounting/withdraw.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; +package accounting; +option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; + +import "service/meta.proto"; +import "service/verify.proto"; +import "decimal/decimal.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Withdraw is a service that provides withdraw assets operations from the NeoFS +service Withdraw { + // Get returns cheque if it was signed by inner ring nodes + rpc Get(GetRequest) returns (GetResponse); + // Put ask inner ring nodes to sign a cheque for withdraw invoke + rpc Put(PutRequest) returns (PutResponse); + // List shows all user's checks + rpc List(ListRequest) returns (ListResponse); + // Delete allows user to remove unused cheque + rpc Delete(DeleteRequest) returns (DeleteResponse); +} + +message Item { + // ID is a cheque identifier + bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; + // OwnerID is a wallet address + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // Amount of funds + decimal.Decimal Amount = 3; + // Height is the neo blockchain height until the cheque is valid + uint64 Height = 4; + // Payload contains cheque representation in bytes + bytes Payload = 5; +} + +message GetRequest { + // ID is cheque identifier + bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; + // OwnerID is a wallet address + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetResponse { + // Withdraw is cheque with meta information + Item Withdraw = 1; +} + +message PutRequest { + // OwnerID is a wallet address + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // Amount of funds + decimal.Decimal Amount = 2; + // Height is the neo blockchain height until the cheque is valid + uint64 Height = 3; + // MessageID is a nonce for uniq request (UUIDv4) + bytes MessageID = 4 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} +message PutResponse { + // ID is cheque identifier + bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; +} + +message ListRequest { + // OwnerID is a wallet address + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message ListResponse { + // Items is a set of cheques with meta information + repeated Item Items = 1; +} + +message DeleteRequest { + // ID is cheque identifier + bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; + // OwnerID is a wallet address + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // MessageID is a nonce for uniq request (UUIDv4) + bytes MessageID = 3 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// DeleteResponse is empty +message DeleteResponse {} diff --git a/bootstrap/service.proto b/bootstrap/service.proto new file mode 100644 index 0000000..f0bf755 --- /dev/null +++ b/bootstrap/service.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +package bootstrap; +option go_package = "github.com/nspcc-dev/neofs-proto/bootstrap"; + +import "service/meta.proto"; +import "service/verify.proto"; +import "bootstrap/types.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Bootstrap service allows neofs-node to connect to the network. Node should +// perform at least one bootstrap request in the epoch to stay in the network +// for the next epoch. +service Bootstrap { + // Process is method that allows to register node in the network and receive actual netmap + rpc Process(Request) returns (bootstrap.SpreadMap); +} + +message Request { + // Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) + int32 type = 1 [(gogoproto.customname) = "Type" , (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeType"]; + // Info contains information about node + bootstrap.NodeInfo info = 2 [(gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} diff --git a/bootstrap/types.proto b/bootstrap/types.proto new file mode 100644 index 0000000..5a566da --- /dev/null +++ b/bootstrap/types.proto @@ -0,0 +1,28 @@ +syntax = "proto3"; +package bootstrap; +option go_package = "github.com/nspcc-dev/neofs-proto/bootstrap"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true;; + +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_stringer_all) = false; + +message SpreadMap { + // Epoch is current epoch for netmap + uint64 Epoch = 1; + // NetMap is a set of NodeInfos + repeated NodeInfo NetMap = 2 [(gogoproto.nullable) = false]; +} + +message NodeInfo { + // Address is a node [multi-address](https://github.com/multiformats/multiaddr) + string Address = 1 [(gogoproto.jsontag) = "address"]; + // PubKey is a compressed public key representation in bytes + bytes PubKey = 2 [(gogoproto.jsontag) = "pubkey,omitempty"]; + // Options is set of node optional information, such as storage capacity, node location, price and etc + repeated string Options = 3 [(gogoproto.jsontag) = "options,omitempty"]; + // Status is bitmap status of the node + uint64 Status = 4 [(gogoproto.jsontag) = "status", (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeStatus"]; +} diff --git a/container/service.proto b/container/service.proto new file mode 100644 index 0000000..9bd02c9 --- /dev/null +++ b/container/service.proto @@ -0,0 +1,100 @@ +syntax = "proto3"; +package container; +option go_package = "github.com/nspcc-dev/neofs-proto/container"; + +import "service/meta.proto"; +import "service/verify.proto"; +import "container/types.proto"; +import "github.com/nspcc-dev/netmap/selector.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Container service provides API for manipulating with the container. +service Service { + // Put request proposes container to the inner ring nodes. They will + // accept new container if user has enough deposit. All containers + // are accepted by the consensus, therefore it is asynchronous process. + rpc Put(PutRequest) returns (PutResponse); + + // Delete container removes it from the inner ring container storage. It + // also asynchronous process done by consensus. + rpc Delete(DeleteRequest) returns (DeleteResponse); + + // Get container returns container instance + rpc Get(GetRequest) returns (GetResponse); + + // List returns all user's containers + rpc List(ListRequest) returns (ListResponse); +} + +message PutRequest { + // MessageID is a nonce for uniq container id calculation + bytes MessageID = 1 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; + + // Capacity defines amount of data that can be stored in the container (doesn't used for now). + uint64 Capacity = 2; + + // OwnerID is a wallet address + bytes OwnerID = 3 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + + // Rules define storage policy for the object inside the container. + netmap.PlacementRule rules = 4 [(gogoproto.nullable) = false]; + + // Container ACL. + AccessGroup Group = 5 [(gogoproto.nullable) = false]; + + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message PutResponse { + // CID (container id) is a SHA256 hash of the container structure + bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; +} + +message DeleteRequest { + // CID (container id) is a SHA256 hash of the container structure + bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// DeleteResponse is empty because delete operation is asynchronous and done +// via consensus in inner ring nodes +message DeleteResponse { } + + +message GetRequest { + // CID (container id) is a SHA256 hash of the container structure + bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetResponse { + // Container is a structure that contains placement rules and owner id + container.Container Container = 1; +} + +message ListRequest { + // OwnerID is a wallet address + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message ListResponse { + // CID (container id) is list of SHA256 hashes of the container structures + repeated bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; +} diff --git a/container/types.proto b/container/types.proto new file mode 100644 index 0000000..4600046 --- /dev/null +++ b/container/types.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package container; +option go_package = "github.com/nspcc-dev/neofs-proto/container"; + +import "github.com/nspcc-dev/netmap/selector.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// The Container service definition. +message Container { + // OwnerID is a wallet address. + bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // Salt is a nonce for unique container id calculation. + bytes Salt = 2 [(gogoproto.customtype) = "UUID", (gogoproto.nullable) = false]; + // Capacity defines amount of data that can be stored in the container (doesn't used for now). + uint64 Capacity = 3; + // Rules define storage policy for the object inside the container. + netmap.PlacementRule Rules = 4 [(gogoproto.nullable) = false]; + // Container ACL. + AccessControlList List = 5 [(gogoproto.nullable) = false]; +} + +message AccessGroup { + // Group access mode. + uint32 AccessMode = 1; + // Group members. + repeated bytes UserGroup = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; +} + +message AccessControlList { + // List of access groups. + repeated AccessGroup List = 1 [(gogoproto.nullable) = false]; +} diff --git a/decimal/decimal.proto b/decimal/decimal.proto new file mode 100644 index 0000000..42cf2df --- /dev/null +++ b/decimal/decimal.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +package decimal; +option go_package = "github.com/nspcc-dev/neofs-proto/decimal"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Decimal is a structure used for representation of assets amount +message Decimal { + option (gogoproto.goproto_stringer) = false; + + // Value is value number + int64 Value = 1; + // Precision is precision number + uint32 Precision = 2; +} diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/object/service.proto b/object/service.proto new file mode 100644 index 0000000..91c0cbd --- /dev/null +++ b/object/service.proto @@ -0,0 +1,186 @@ +syntax = "proto3"; +package object; +option go_package = "github.com/nspcc-dev/neofs-proto/object"; + +import "refs/types.proto"; +import "object/types.proto"; +import "session/types.proto"; +import "service/meta.proto"; +import "service/verify.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Object service provides API for manipulating with the object. +service Service { + + // Get the object from container. Response uses gRPC stream. First response + // message carry object of requested address. Chunk messages are parts of + // the object's payload if it is needed. All messages except first carry + // chunks. Requested object can be restored by concatenation of object + // message payload and all chunks keeping receiving order. + rpc Get(GetRequest) returns (stream GetResponse); + + // Put the object into container. Request uses gRPC stream. First message + // SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD + // BE set. Session token SHOULD BE obtained before put operation (see + // session package). Chunk messages considered by server as part of object + // payload. All messages except first SHOULD BE chunks. Chunk messages + // SHOULD BE sent in direct order of fragmentation. + rpc Put(stream PutRequest) returns (PutResponse); + + // Delete the object from a container + rpc Delete(DeleteRequest) returns (DeleteResponse); + + // Head returns the object without data payload. Object in the + // response has system header only. If full headers flag is set, extended + // headers are also present. + rpc Head(HeadRequest) returns (HeadResponse); + + // Search objects in container. Version of query language format SHOULD BE + // set to 1. Search query represented in serialized format (see query + // package). + rpc Search(SearchRequest) returns (SearchResponse); + + // GetRange of data payload. Ranges are set of pairs (offset, length). + // Fragments order in response corresponds to ranges order in request. + rpc GetRange(GetRangeRequest) returns (GetRangeResponse); + + // GetRangeHash returns homomorphic hash of object payload range after XOR + // operation. Ranges are set of pairs (offset, length). Hashes order in + // response corresponds to ranges order in request. Homomorphic hash is + // calculated for XORed data. + rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); +} + +message GetRequest { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false]; + // Raw is the request flag of a physically stored representation of an object + bool Raw = 2; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetResponse { + oneof R { + // Object header and some payload + Object object = 1; + // Chunk of remaining payload + bytes Chunk = 2; + } +} + +message PutRequest { + message PutHeader { + // Object with at least container id and owner id fields + Object Object = 1; + // Token with session public key and user's signature + session.Token Token = 2; + } + + oneof R { + // Header should be the first message in the stream + PutHeader Header = 1; + // Chunk should be a remaining message in stream should be chunks + bytes Chunk = 2; + } + + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message PutResponse { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false]; +} +message DeleteRequest { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false]; + // OwnerID is a wallet address + bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; + // Token with session public key and user's signature + session.Token Token = 3; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// DeleteResponse is empty because we cannot guarantee permanent object removal +// in distributed system. +message DeleteResponse {} + +message HeadRequest { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; + // FullHeaders can be set true for extended headers in the object + bool FullHeaders = 2; + // Raw is the request flag of a physically stored representation of an object + bool Raw = 3; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} +message HeadResponse { + // Object without payload + Object Object = 1; +} + +message SearchRequest { + // ContainerID for searching the object + bytes ContainerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"]; + // Query in the binary serialized format + bytes Query = 2; + // QueryVersion is a version of search query format + uint32 QueryVersion = 3; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message SearchResponse { + // Addresses of found objects + repeated refs.Address Addresses = 1 [(gogoproto.nullable) = false]; +} + +message GetRangeRequest { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false]; + // Ranges of object's payload to return + repeated Range Ranges = 2 [(gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetRangeResponse { + // Fragments of object's payload + repeated bytes Fragments = 1; +} + +message GetRangeHashRequest { + // Address of object (container id + object id) + refs.Address Address = 1 [(gogoproto.nullable) = false]; + // Ranges of object's payload to calculate homomorphic hash + repeated Range Ranges = 2 [(gogoproto.nullable) = false]; + // Salt is used to XOR object's payload ranges before hashing, it can be nil + bytes Salt = 3; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetRangeHashResponse { + // Hashes is a homomorphic hashes of all ranges + repeated bytes Hashes = 1 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; +} + diff --git a/object/types.proto b/object/types.proto new file mode 100644 index 0000000..293f347 --- /dev/null +++ b/object/types.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package object; +option go_package = "github.com/nspcc-dev/neofs-proto/object"; + +import "refs/types.proto"; +import "session/types.proto"; +import "storagegroup/types.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message Range { + // Offset of the data range + uint64 Offset = 1; + // Length of the data range + uint64 Length = 2; +} + +message UserHeader { + // Key of the user's header + string Key = 1; + // Value of the user's header + string Value = 2; +} + +message Header { + oneof Value { + // Link to other objects + Link Link = 1; + // Redirect not used yet + refs.Address Redirect = 2; + // UserHeader is a set of KV headers defined by user + UserHeader UserHeader = 3; + // Transform defines transform operation (e.g. payload split) + Transform Transform = 4; + // Tombstone header that set up in deleted objects + Tombstone Tombstone = 5; + // Verify header that contains session public key and user's signature + session.VerificationHeader Verify = 6; + // HomoHash is a homomorphic hash of original object payload + bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"]; + // PayloadChecksum of actual object's payload + bytes PayloadChecksum = 8; + // Integrity header with checksum of all above headers in the object + IntegrityHeader Integrity = 9; + // StorageGroup contains meta information for the data audit + storagegroup.StorageGroup StorageGroup = 10; + // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. + PublicKey PublicKey = 11; + } +} + +message Tombstone {} + +message SystemHeader { + // Version of the object structure + uint64 Version = 1; + // PayloadLength is an object payload length + uint64 PayloadLength = 2; + + // ID is an object identifier, is a valid UUIDv4 + bytes ID = 3 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; + // OwnerID is a wallet address + bytes OwnerID = 4 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // CID is a SHA256 hash of the container structure (container identifier) + bytes CID = 5 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + // CreatedAt is a timestamp of object creation + CreationPoint CreatedAt = 6 [(gogoproto.nullable) = false]; +} + +message CreationPoint { + // UnixTime is a date of creation in unixtime format + int64 UnixTime = 1; + // Epoch is a date of creation in NeoFS epochs + uint64 Epoch = 2; +} + +message IntegrityHeader { + // HeadersChecksum is a checksum of all above headers in the object + bytes HeadersChecksum = 1; + // ChecksumSignature is an user's signature of checksum to verify if it is correct + bytes ChecksumSignature = 2; +} + +message Link { + enum Type { + Unknown = 0; + // Parent object created during object transformation + Parent = 1; + // Previous object in the linked list created during object transformation + Previous = 2; + // Next object in the linked list created during object transformation + Next = 3; + // Child object created during object transformation + Child = 4; + // Object that included into this storage group + StorageGroup = 5; + } + // Type of link + Type type = 1; + // ID is an object identifier, is a valid UUIDv4 + bytes ID = 2 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; +} + +message Transform { + enum Type { + Unknown = 0; + // Split sets when object created after payload split + Split = 1; + // Sign sets when object created after re-signing (doesn't used) + Sign = 2; + // Mould sets when object created after filling missing headers in the object + Mould = 3; + } + // Type of object transformation + Type type = 1; +} + +message Object { + // SystemHeader describes system header + SystemHeader SystemHeader = 1 [(gogoproto.nullable) = false]; + // Headers describes a set of an extended headers + repeated Header Headers = 2 [(gogoproto.nullable) = false]; + // Payload is an object's payload + bytes Payload = 3; +} + +message PublicKey { + // Value contains marshaled ecdsa public key + bytes Value = 1; +} diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md new file mode 100644 index 0000000..bcae136 --- /dev/null +++ b/proto-docs/accounting.md @@ -0,0 +1,491 @@ +# Protocol Documentation + + +## Table of Contents + +- [accounting/service.proto](#accounting/service.proto) + - Services + - [Accounting](#accounting.Accounting) + + - Messages + - [BalanceRequest](#accounting.BalanceRequest) + - [BalanceResponse](#accounting.BalanceResponse) + + +- [accounting/types.proto](#accounting/types.proto) + + - Messages + - [Account](#accounting.Account) + - [Balances](#accounting.Balances) + - [ContainerCreateTarget](#accounting.ContainerCreateTarget) + - [Lifetime](#accounting.Lifetime) + - [LockTarget](#accounting.LockTarget) + - [PayIO](#accounting.PayIO) + - [Settlement](#accounting.Settlement) + - [Settlement.Container](#accounting.Settlement.Container) + - [Settlement.Receiver](#accounting.Settlement.Receiver) + - [Settlement.Tx](#accounting.Settlement.Tx) + - [Tx](#accounting.Tx) + - [WithdrawTarget](#accounting.WithdrawTarget) + + +- [accounting/withdraw.proto](#accounting/withdraw.proto) + - Services + - [Withdraw](#accounting.Withdraw) + + - Messages + - [DeleteRequest](#accounting.DeleteRequest) + - [DeleteResponse](#accounting.DeleteResponse) + - [GetRequest](#accounting.GetRequest) + - [GetResponse](#accounting.GetResponse) + - [Item](#accounting.Item) + - [ListRequest](#accounting.ListRequest) + - [ListResponse](#accounting.ListResponse) + - [PutRequest](#accounting.PutRequest) + - [PutResponse](#accounting.PutResponse) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## accounting/service.proto + + + + + + +### Service "accounting.Accounting" +Accounting is a service that provides access for accounting balance +information + +``` +rpc Balance(BalanceRequest) returns (BalanceResponse); + +``` + +#### Method Balance + +Balance returns current balance status of the NeoFS user + +| Name | Input | Output | +| ---- | ----- | ------ | +| Balance | [BalanceRequest](#accounting.BalanceRequest) | [BalanceResponse](#accounting.BalanceResponse) | + + + + + +### Message BalanceRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message BalanceResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Balance | [decimal.Decimal](#decimal.Decimal) | | Balance contains current account balance state | +| LockAccounts | [Account](#accounting.Account) | repeated | LockAccounts contains information about locked funds. Locked funds appear when user pays for storage or withdraw assets. | + + + + + + + + +

Top

+ +## accounting/types.proto + + + + + + + +### Message Account + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Address | [string](#string) | | Address is identifier of accounting record | +| ParentAddress | [string](#string) | | ParentAddress is identifier of parent accounting record | +| ActiveFunds | [decimal.Decimal](#decimal.Decimal) | | ActiveFunds is amount of active (non locked) funds for account | +| Lifetime | [Lifetime](#accounting.Lifetime) | | Lifetime is time until account is valid (used for lock accounts) | +| LockTarget | [LockTarget](#accounting.LockTarget) | | LockTarget is the purpose of lock funds (it might be withdraw or payment for storage) | +| LockAccounts | [Account](#accounting.Account) | repeated | LockAccounts contains child accounts with locked funds | + + + + +### Message Balances + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Accounts | [Account](#accounting.Account) | repeated | Accounts contains multiple account snapshots | + + + + +### Message ContainerCreateTarget + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | | CID is container identifier | + + + + +### Message Lifetime + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| unit | [Lifetime.Unit](#accounting.Lifetime.Unit) | | Unit describes how lifetime is measured in account | +| Value | [int64](#int64) | | Value describes how long lifetime will be valid | + + + + +### Message LockTarget +LockTarget must be one of two options + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| WithdrawTarget | [WithdrawTarget](#accounting.WithdrawTarget) | | WithdrawTarget used when user requested withdraw | +| ContainerCreateTarget | [ContainerCreateTarget](#accounting.ContainerCreateTarget) | | ContainerCreateTarget used when user requested creation of container | + + + + +### Message PayIO + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| BlockID | [uint64](#uint64) | | BlockID contains id of the NEO block where withdraw or deposit call was invoked | +| Transactions | [Tx](#accounting.Tx) | repeated | Transactions contains all transactions that founded in block and used for PayIO | + + + + +### Message Settlement + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Epoch | [uint64](#uint64) | | Epoch contains an epoch when settlement was accepted | +| Transactions | [Settlement.Tx](#accounting.Settlement.Tx) | repeated | Transactions is a set of transactions | + + + + +### Message Settlement.Container + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | | CID is container identifier | +| SGIDs | [bytes](#bytes) | repeated | SGIDs is a set of storage groups that successfully passed the audit | + + + + +### Message Settlement.Receiver + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| To | [string](#string) | | To is the address of funds recipient | +| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount is the amount of funds that will be sent | + + + + +### Message Settlement.Tx + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| From | [string](#string) | | From is the address of the sender of funds | +| Container | [Settlement.Container](#accounting.Settlement.Container) | | Container that successfully had passed the audit | +| Receivers | [Settlement.Receiver](#accounting.Settlement.Receiver) | repeated | Receivers is a set of addresses of funds recipients | + + + + +### Message Tx + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [Tx.Type](#accounting.Tx.Type) | | Type describes target of transaction | +| From | [string](#string) | | From describes sender of funds | +| To | [string](#string) | | To describes receiver of funds | +| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount describes amount of funds | +| PublicKeys | [bytes](#bytes) | | PublicKeys contains public key of sender | + + + + +### Message WithdrawTarget + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Cheque | [string](#string) | | Cheque is a string representation of cheque id | + + + + + + +### Lifetime.Unit +Unit can be Unlimited, based on NeoFS epoch or Neo block + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unlimited | 0 | | +| NeoFSEpoch | 1 | | +| NeoBlock | 2 | | + + + + + +### Tx.Type +Type can be withdrawal, payIO or inner + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | | +| Withdraw | 1 | | +| PayIO | 2 | | +| Inner | 3 | | + + + + + + + +

Top

+ +## accounting/withdraw.proto + + + + + + +### Service "accounting.Withdraw" +Withdraw is a service that provides withdraw assets operations from the NeoFS + +``` +rpc Get(GetRequest) returns (GetResponse); +rpc Put(PutRequest) returns (PutResponse); +rpc List(ListRequest) returns (ListResponse); +rpc Delete(DeleteRequest) returns (DeleteResponse); + +``` + +#### Method Get + +Get returns cheque if it was signed by inner ring nodes + +| Name | Input | Output | +| ---- | ----- | ------ | +| Get | [GetRequest](#accounting.GetRequest) | [GetResponse](#accounting.GetResponse) | +#### Method Put + +Put ask inner ring nodes to sign a cheque for withdraw invoke + +| Name | Input | Output | +| ---- | ----- | ------ | +| Put | [PutRequest](#accounting.PutRequest) | [PutResponse](#accounting.PutResponse) | +#### Method List + +List shows all user's checks + +| Name | Input | Output | +| ---- | ----- | ------ | +| List | [ListRequest](#accounting.ListRequest) | [ListResponse](#accounting.ListResponse) | +#### Method Delete + +Delete allows user to remove unused cheque + +| Name | Input | Output | +| ---- | ----- | ------ | +| Delete | [DeleteRequest](#accounting.DeleteRequest) | [DeleteResponse](#accounting.DeleteResponse) | + + + + + +### Message DeleteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is cheque identifier | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message DeleteResponse +DeleteResponse is empty + + + + + +### Message GetRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is cheque identifier | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Withdraw | [Item](#accounting.Item) | | Withdraw is cheque with meta information | + + + + +### Message Item + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is a cheque identifier | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount of funds | +| Height | [uint64](#uint64) | | Height is the neo blockchain height until the cheque is valid | +| Payload | [bytes](#bytes) | | Payload contains cheque representation in bytes | + + + + +### Message ListRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message ListResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Items | [Item](#accounting.Item) | repeated | Items is a set of cheques with meta information | + + + + +### Message PutRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount of funds | +| Height | [uint64](#uint64) | | Height is the neo blockchain height until the cheque is valid | +| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message PutResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is cheque identifier | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md new file mode 100644 index 0000000..737e085 --- /dev/null +++ b/proto-docs/bootstrap.md @@ -0,0 +1,133 @@ +# Protocol Documentation + + +## Table of Contents + +- [bootstrap/service.proto](#bootstrap/service.proto) + - Services + - [Bootstrap](#bootstrap.Bootstrap) + + - Messages + - [Request](#bootstrap.Request) + + +- [bootstrap/types.proto](#bootstrap/types.proto) + + - Messages + - [NodeInfo](#bootstrap.NodeInfo) + - [SpreadMap](#bootstrap.SpreadMap) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## bootstrap/service.proto + + + + + + +### Service "bootstrap.Bootstrap" +Bootstrap service allows neofs-node to connect to the network. Node should +perform at least one bootstrap request in the epoch to stay in the network +for the next epoch. + +``` +rpc Process(Request) returns (SpreadMap); + +``` + +#### Method Process + +Process is method that allows to register node in the network and receive actual netmap + +| Name | Input | Output | +| ---- | ----- | ------ | +| Process | [Request](#bootstrap.Request) | [SpreadMap](#bootstrap.SpreadMap) | + + + + + +### Message Request + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [int32](#int32) | | Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) | +| info | [NodeInfo](#bootstrap.NodeInfo) | | Info contains information about node | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + + + + + +

Top

+ +## bootstrap/types.proto + + + + + + + +### Message NodeInfo + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [string](#string) | | Address is a node [multi-address](https://github.com/multiformats/multiaddr) | +| PubKey | [bytes](#bytes) | | PubKey is a compressed public key representation in bytes | +| Options | [string](#string) | repeated | Options is set of node optional information, such as storage capacity, node location, price and etc | +| Status | [uint64](#uint64) | | Status is bitmap status of the node | + + + + +### Message SpreadMap + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Epoch | [uint64](#uint64) | | Epoch is current epoch for netmap | +| NetMap | [NodeInfo](#bootstrap.NodeInfo) | repeated | NetMap is a set of NodeInfos | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/container.md b/proto-docs/container.md new file mode 100644 index 0000000..6693980 --- /dev/null +++ b/proto-docs/container.md @@ -0,0 +1,261 @@ +# Protocol Documentation + + +## Table of Contents + +- [container/service.proto](#container/service.proto) + - Services + - [Service](#container.Service) + + - Messages + - [DeleteRequest](#container.DeleteRequest) + - [DeleteResponse](#container.DeleteResponse) + - [GetRequest](#container.GetRequest) + - [GetResponse](#container.GetResponse) + - [ListRequest](#container.ListRequest) + - [ListResponse](#container.ListResponse) + - [PutRequest](#container.PutRequest) + - [PutResponse](#container.PutResponse) + + +- [container/types.proto](#container/types.proto) + + - Messages + - [AccessControlList](#container.AccessControlList) + - [AccessGroup](#container.AccessGroup) + - [Container](#container.Container) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## container/service.proto + + + + + + +### Service "container.Service" +Container service provides API for manipulating with the container. + +``` +rpc Put(PutRequest) returns (PutResponse); +rpc Delete(DeleteRequest) returns (DeleteResponse); +rpc Get(GetRequest) returns (GetResponse); +rpc List(ListRequest) returns (ListResponse); + +``` + +#### Method Put + +Put request proposes container to the inner ring nodes. They will +accept new container if user has enough deposit. All containers +are accepted by the consensus, therefore it is asynchronous process. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Put | [PutRequest](#container.PutRequest) | [PutResponse](#container.PutResponse) | +#### Method Delete + +Delete container removes it from the inner ring container storage. It +also asynchronous process done by consensus. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Delete | [DeleteRequest](#container.DeleteRequest) | [DeleteResponse](#container.DeleteResponse) | +#### Method Get + +Get container returns container instance + +| Name | Input | Output | +| ---- | ----- | ------ | +| Get | [GetRequest](#container.GetRequest) | [GetResponse](#container.GetResponse) | +#### Method List + +List returns all user's containers + +| Name | Input | Output | +| ---- | ----- | ------ | +| List | [ListRequest](#container.ListRequest) | [ListResponse](#container.ListResponse) | + + + + + +### Message DeleteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message DeleteResponse +DeleteResponse is empty because delete operation is asynchronous and done +via consensus in inner ring nodes + + + + + +### Message GetRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Container | [Container](#container.Container) | | Container is a structure that contains placement rules and owner id | + + + + +### Message ListRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message ListResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | repeated | CID (container id) is list of SHA256 hashes of the container structures | + + + + +### Message PutRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq container id calculation | +| Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | +| Group | [AccessGroup](#container.AccessGroup) | | Container ACL. | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message PutResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | + + + + + + + + +

Top

+ +## container/types.proto + + + + + + + +### Message AccessControlList + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| List | [AccessGroup](#container.AccessGroup) | repeated | List of access groups. | + + + + +### Message AccessGroup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| AccessMode | [uint32](#uint32) | | Group access mode. | +| UserGroup | [bytes](#bytes) | repeated | Group members. | + + + + +### Message Container +The Container service definition. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address. | +| Salt | [bytes](#bytes) | | Salt is a nonce for unique container id calculation. | +| Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | +| Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | +| List | [AccessControlList](#container.AccessControlList) | | Container ACL. | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/decimal.md b/proto-docs/decimal.md new file mode 100644 index 0000000..62acb86 --- /dev/null +++ b/proto-docs/decimal.md @@ -0,0 +1,61 @@ +# Protocol Documentation + + +## Table of Contents + +- [decimal/decimal.proto](#decimal/decimal.proto) + + - Messages + - [Decimal](#decimal.Decimal) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## decimal/decimal.proto + + + + + + + +### Message Decimal +Decimal is a structure used for representation of assets amount + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [int64](#int64) | | Value is value number | +| Precision | [uint32](#uint32) | | Precision is precision number | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/object.md b/proto-docs/object.md new file mode 100644 index 0000000..e749b98 --- /dev/null +++ b/proto-docs/object.md @@ -0,0 +1,537 @@ +# Protocol Documentation + + +## Table of Contents + +- [object/service.proto](#object/service.proto) + - Services + - [Service](#object.Service) + + - Messages + - [DeleteRequest](#object.DeleteRequest) + - [DeleteResponse](#object.DeleteResponse) + - [GetRangeHashRequest](#object.GetRangeHashRequest) + - [GetRangeHashResponse](#object.GetRangeHashResponse) + - [GetRangeRequest](#object.GetRangeRequest) + - [GetRangeResponse](#object.GetRangeResponse) + - [GetRequest](#object.GetRequest) + - [GetResponse](#object.GetResponse) + - [HeadRequest](#object.HeadRequest) + - [HeadResponse](#object.HeadResponse) + - [PutRequest](#object.PutRequest) + - [PutRequest.PutHeader](#object.PutRequest.PutHeader) + - [PutResponse](#object.PutResponse) + - [SearchRequest](#object.SearchRequest) + - [SearchResponse](#object.SearchResponse) + + +- [object/types.proto](#object/types.proto) + + - Messages + - [CreationPoint](#object.CreationPoint) + - [Header](#object.Header) + - [IntegrityHeader](#object.IntegrityHeader) + - [Link](#object.Link) + - [Object](#object.Object) + - [PublicKey](#object.PublicKey) + - [Range](#object.Range) + - [SystemHeader](#object.SystemHeader) + - [Tombstone](#object.Tombstone) + - [Transform](#object.Transform) + - [UserHeader](#object.UserHeader) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## object/service.proto + + + + + + +### Service "object.Service" +Object service provides API for manipulating with the object. + +``` +rpc Get(GetRequest) returns (stream GetResponse); +rpc Put(stream PutRequest) returns (PutResponse); +rpc Delete(DeleteRequest) returns (DeleteResponse); +rpc Head(HeadRequest) returns (HeadResponse); +rpc Search(SearchRequest) returns (SearchResponse); +rpc GetRange(GetRangeRequest) returns (GetRangeResponse); +rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); + +``` + +#### Method Get + +Get the object from container. Response uses gRPC stream. First response +message carry object of requested address. Chunk messages are parts of +the object's payload if it is needed. All messages except first carry +chunks. Requested object can be restored by concatenation of object +message payload and all chunks keeping receiving order. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Get | [GetRequest](#object.GetRequest) | [GetResponse](#object.GetResponse) | +#### Method Put + +Put the object into container. Request uses gRPC stream. First message +SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD +BE set. Session token SHOULD BE obtained before put operation (see +session package). Chunk messages considered by server as part of object +payload. All messages except first SHOULD BE chunks. Chunk messages +SHOULD BE sent in direct order of fragmentation. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Put | [PutRequest](#object.PutRequest) | [PutResponse](#object.PutResponse) | +#### Method Delete + +Delete the object from a container + +| Name | Input | Output | +| ---- | ----- | ------ | +| Delete | [DeleteRequest](#object.DeleteRequest) | [DeleteResponse](#object.DeleteResponse) | +#### Method Head + +Head returns the object without data payload. Object in the +response has system header only. If full headers flag is set, extended +headers are also present. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Head | [HeadRequest](#object.HeadRequest) | [HeadResponse](#object.HeadResponse) | +#### Method Search + +Search objects in container. Version of query language format SHOULD BE +set to 1. Search query represented in serialized format (see query +package). + +| Name | Input | Output | +| ---- | ----- | ------ | +| Search | [SearchRequest](#object.SearchRequest) | [SearchResponse](#object.SearchResponse) | +#### Method GetRange + +GetRange of data payload. Ranges are set of pairs (offset, length). +Fragments order in response corresponds to ranges order in request. + +| Name | Input | Output | +| ---- | ----- | ------ | +| GetRange | [GetRangeRequest](#object.GetRangeRequest) | [GetRangeResponse](#object.GetRangeResponse) | +#### Method GetRangeHash + +GetRangeHash returns homomorphic hash of object payload range after XOR +operation. Ranges are set of pairs (offset, length). Hashes order in +response corresponds to ranges order in request. Homomorphic hash is +calculated for XORed data. + +| Name | Input | Output | +| ---- | ----- | ------ | +| GetRangeHash | [GetRangeHashRequest](#object.GetRangeHashRequest) | [GetRangeHashResponse](#object.GetRangeHashResponse) | + + + + + +### Message DeleteRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message DeleteResponse +DeleteResponse is empty because we cannot guarantee permanent object removal +in distributed system. + + + + + +### Message GetRangeHashRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to calculate homomorphic hash | +| Salt | [bytes](#bytes) | | Salt is used to XOR object's payload ranges before hashing, it can be nil | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetRangeHashResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Hashes | [bytes](#bytes) | repeated | Hashes is a homomorphic hashes of all ranges | + + + + +### Message GetRangeRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to return | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetRangeResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Fragments | [bytes](#bytes) | repeated | Fragments of object's payload | + + + + +### Message GetRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| object | [Object](#object.Object) | | Object header and some payload | +| Chunk | [bytes](#bytes) | | Chunk of remaining payload | + + + + +### Message HeadRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | +| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message HeadResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Object | [Object](#object.Object) | | Object without payload | + + + + +### Message PutRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Header | [PutRequest.PutHeader](#object.PutRequest.PutHeader) | | Header should be the first message in the stream | +| Chunk | [bytes](#bytes) | | Chunk should be a remaining message in stream should be chunks | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message PutRequest.PutHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Object | [Object](#object.Object) | | Object with at least container id and owner id fields | +| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | + + + + +### Message PutResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | + + + + +### Message SearchRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ContainerID | [bytes](#bytes) | | ContainerID for searching the object | +| Query | [bytes](#bytes) | | Query in the binary serialized format | +| QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message SearchResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Addresses | [refs.Address](#refs.Address) | repeated | Addresses of found objects | + + + + + + + + +

Top

+ +## object/types.proto + + + + + + + +### Message CreationPoint + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| UnixTime | [int64](#int64) | | UnixTime is a date of creation in unixtime format | +| Epoch | [uint64](#uint64) | | Epoch is a date of creation in NeoFS epochs | + + + + +### Message Header + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Link | [Link](#object.Link) | | Link to other objects | +| Redirect | [refs.Address](#refs.Address) | | Redirect not used yet | +| UserHeader | [UserHeader](#object.UserHeader) | | UserHeader is a set of KV headers defined by user | +| Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | +| Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | +| Verify | [session.VerificationHeader](#session.VerificationHeader) | | Verify header that contains session public key and user's signature | +| HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | +| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | +| Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | +| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | +| PublicKey | [PublicKey](#object.PublicKey) | | PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. | + + + + +### Message IntegrityHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| HeadersChecksum | [bytes](#bytes) | | HeadersChecksum is a checksum of all above headers in the object | +| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | + + + + +### Message Link + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [Link.Type](#object.Link.Type) | | Type of link | +| ID | [bytes](#bytes) | | ID is an object identifier, is a valid UUIDv4 | + + + + +### Message Object + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | +| Headers | [Header](#object.Header) | repeated | Headers describes a set of an extended headers | +| Payload | [bytes](#bytes) | | Payload is an object's payload | + + + + +### Message PublicKey + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [bytes](#bytes) | | Value contains marshaled ecdsa public key | + + + + +### Message Range + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Offset | [uint64](#uint64) | | Offset of the data range | +| Length | [uint64](#uint64) | | Length of the data range | + + + + +### Message SystemHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Version | [uint64](#uint64) | | Version of the object structure | +| PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | +| ID | [bytes](#bytes) | | ID is an object identifier, is a valid UUIDv4 | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| CID | [bytes](#bytes) | | CID is a SHA256 hash of the container structure (container identifier) | +| CreatedAt | [CreationPoint](#object.CreationPoint) | | CreatedAt is a timestamp of object creation | + + + + +### Message Tombstone + + + + + + +### Message Transform + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [Transform.Type](#object.Transform.Type) | | Type of object transformation | + + + + +### Message UserHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Key of the user's header | +| Value | [string](#string) | | Value of the user's header | + + + + + + +### Link.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | | +| Parent | 1 | Parent object created during object transformation | +| Previous | 2 | Previous object in the linked list created during object transformation | +| Next | 3 | Next object in the linked list created during object transformation | +| Child | 4 | Child object created during object transformation | +| StorageGroup | 5 | Object that included into this storage group | + + + + + +### Transform.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | | +| Split | 1 | Split sets when object created after payload split | +| Sign | 2 | Sign sets when object created after re-signing (doesn't used) | +| Mould | 3 | Mould sets when object created after filling missing headers in the object | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/query.md b/proto-docs/query.md new file mode 100644 index 0000000..c014c6c --- /dev/null +++ b/proto-docs/query.md @@ -0,0 +1,86 @@ +# Protocol Documentation + + +## Table of Contents + +- [query/types.proto](#query/types.proto) + + - Messages + - [Filter](#query.Filter) + - [Query](#query.Query) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## query/types.proto + + + + + + + +### Message Filter + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [Filter.Type](#query.Filter.Type) | | Type of filter | +| Name | [string](#string) | | Name of field that should be filtered | +| Value | [string](#string) | | Value that should be used for filter | + + + + +### Message Query + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Filters | [Filter](#query.Filter) | repeated | Filters is set of filters, should not be empty | + + + + + + +### Filter.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Exact | 0 | Exact sets when value of filter should be equal to the header value | +| Regex | 1 | Regex sets when value of filter should match the header value by the regular expression | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/refs.md b/proto-docs/refs.md new file mode 100644 index 0000000..b808482 --- /dev/null +++ b/proto-docs/refs.md @@ -0,0 +1,61 @@ +# Protocol Documentation + + +## Table of Contents + +- [refs/types.proto](#refs/types.proto) + + - Messages + - [Address](#refs.Address) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## refs/types.proto + + + + + + + +### Message Address +Address of object (container id + object id) + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ObjectID | [bytes](#bytes) | | ObjectID is an object identifier, valid UUIDv4 represented in bytes | +| CID | [bytes](#bytes) | | CID is container identifier | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/service.md b/proto-docs/service.md new file mode 100644 index 0000000..08a1065 --- /dev/null +++ b/proto-docs/service.md @@ -0,0 +1,121 @@ +# Protocol Documentation + + +## Table of Contents + +- [service/meta.proto](#service/meta.proto) + + - Messages + - [RequestMetaHeader](#service.RequestMetaHeader) + + +- [service/verify.proto](#service/verify.proto) + + - Messages + - [RequestVerificationHeader](#service.RequestVerificationHeader) + - [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) + - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## service/meta.proto + + + + + + + +### Message RequestMetaHeader +RequestMetaHeader contains information about request meta headers +(should be embedded into message) + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | +| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | +| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | + + + + + + + + +

Top

+ +## service/verify.proto + + + + + + + +### Message RequestVerificationHeader +RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request +(should be embedded into message). + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | + + + + +### Message RequestVerificationHeader.Sign + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | +| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | + + + + +### Message RequestVerificationHeader.Signature + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Sign | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Sign is a signature and public key of the request. | +| Origin | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Origin used for requests, when trusted node changes it and re-sign with session key. If session key used for signature request, then Origin should contain public key of user and signed session key. | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/session.md b/proto-docs/session.md new file mode 100644 index 0000000..ba615c3 --- /dev/null +++ b/proto-docs/session.md @@ -0,0 +1,157 @@ +# Protocol Documentation + + +## Table of Contents + +- [session/service.proto](#session/service.proto) + - Services + - [Session](#session.Session) + + - Messages + - [CreateRequest](#session.CreateRequest) + - [CreateResponse](#session.CreateResponse) + + +- [session/types.proto](#session/types.proto) + + - Messages + - [Token](#session.Token) + - [VerificationHeader](#session.VerificationHeader) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## session/service.proto + + + + + + +### Service "session.Session" + + +``` +rpc Create(stream CreateRequest) returns (stream CreateResponse); + +``` + +#### Method Create + +Create is a method that used to open a trusted session to manipulate +an object. In order to put or delete object client have to obtain session +token with trusted node. Trusted node will modify client's object +(add missing headers, checksums, homomorphic hash) and sign id with +session key. Session is established during 4-step handshake in one gRPC stream + +- First client stream message SHOULD BE type of `CreateRequest_Init`. +- First server stream message SHOULD BE type of `CreateResponse_Unsigned`. +- Second client stream message SHOULD BE type of `CreateRequest_Signed`. +- Second server stream message SHOULD BE type of `CreateResponse_Result`. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Create | [CreateRequest](#session.CreateRequest) | [CreateResponse](#session.CreateResponse) | + + + + + +### Message CreateRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Init | [Token](#session.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | +| Signed | [Token](#session.Token) | | Signed Init message response (Unsigned) from server with user private key | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message CreateResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Unsigned | [Token](#session.Token) | | Unsigned token with token ID and session public key generated on server side | +| Result | [Token](#session.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | + + + + + + + + +

Top

+ +## session/types.proto + + + + + + + +### Message Token +User token granting rights for object manipulation + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Header | [VerificationHeader](#session.VerificationHeader) | | Header carries verification data of session key | +| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | +| FirstEpoch | [uint64](#uint64) | | FirstEpoch is an initial epoch of token lifetime | +| LastEpoch | [uint64](#uint64) | | LastEpoch is a last epoch of token lifetime | +| ObjectID | [bytes](#bytes) | repeated | ObjectID is an object identifier of manipulation object | +| Signature | [bytes](#bytes) | | Signature is a token signature, signed by owner of manipulation object | +| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| PublicKeys | [bytes](#bytes) | repeated | PublicKeys associated with owner | + + + + +### Message VerificationHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| PublicKey | [bytes](#bytes) | | PublicKey is a session public key | +| KeySignature | [bytes](#bytes) | | KeySignature is a session public key signature. Signed by trusted side | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/state.md b/proto-docs/state.md new file mode 100644 index 0000000..7950455 --- /dev/null +++ b/proto-docs/state.md @@ -0,0 +1,188 @@ +# Protocol Documentation + + +## Table of Contents + +- [state/service.proto](#state/service.proto) + - Services + - [Status](#state.Status) + + - Messages + - [DumpRequest](#state.DumpRequest) + - [DumpResponse](#state.DumpResponse) + - [HealthRequest](#state.HealthRequest) + - [HealthResponse](#state.HealthResponse) + - [MetricsRequest](#state.MetricsRequest) + - [MetricsResponse](#state.MetricsResponse) + - [NetmapRequest](#state.NetmapRequest) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## state/service.proto + + + + + + +### Service "state.Status" +Status service provides node's healthcheck and status info + +``` +rpc Netmap(NetmapRequest) returns (.bootstrap.SpreadMap); +rpc Metrics(MetricsRequest) returns (MetricsResponse); +rpc HealthCheck(HealthRequest) returns (HealthResponse); +rpc DumpConfig(DumpRequest) returns (DumpResponse); + +``` + +#### Method Netmap + +Netmap request allows to receive current [bootstrap.SpreadMap](bootstrap.md#bootstrap.SpreadMap) + +| Name | Input | Output | +| ---- | ----- | ------ | +| Netmap | [NetmapRequest](#state.NetmapRequest) | [.bootstrap.SpreadMap](#bootstrap.SpreadMap) | +#### Method Metrics + +Metrics request allows to receive metrics in prometheus format + +| Name | Input | Output | +| ---- | ----- | ------ | +| Metrics | [MetricsRequest](#state.MetricsRequest) | [MetricsResponse](#state.MetricsResponse) | +#### Method HealthCheck + +HealthCheck request allows to check health status of the node. +If node unhealthy field Status would contains detailed info. + +| Name | Input | Output | +| ---- | ----- | ------ | +| HealthCheck | [HealthRequest](#state.HealthRequest) | [HealthResponse](#state.HealthResponse) | +#### Method DumpConfig + +DumpConfig request allows dumping settings for the current node. +To permit access, used server config options. +The request should be signed. + +| Name | Input | Output | +| ---- | ----- | ------ | +| DumpConfig | [DumpRequest](#state.DumpRequest) | [DumpResponse](#state.DumpResponse) | + + + + + +### Message DumpRequest +DumpRequest message to fetch current server config. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message DumpResponse +DumpResponse message contains current server config. +Config stored in JSON encoded into slice of bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Config | [bytes](#bytes) | | | + + + + +### Message HealthRequest +HealthRequest message to check current state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message HealthResponse +HealthResponse message with current state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Healthy | [bool](#bool) | | Healthy is true when node alive and healthy | +| Status | [string](#string) | | Status contains detailed information about health status | + + + + +### Message MetricsRequest +MetricsRequest message to request node metrics + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message MetricsResponse +MetricsResponse contains [][]byte, +every []byte is marshaled MetricFamily proto message +from github.com/prometheus/client_model/metrics.proto + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Metrics | [bytes](#bytes) | repeated | | + + + + +### Message NetmapRequest +NetmapRequest message to request current node netmap + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md new file mode 100644 index 0000000..7522902 --- /dev/null +++ b/proto-docs/storagegroup.md @@ -0,0 +1,88 @@ +# Protocol Documentation + + +## Table of Contents + +- [storagegroup/types.proto](#storagegroup/types.proto) + + - Messages + - [StorageGroup](#storagegroup.StorageGroup) + - [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## storagegroup/types.proto + + + + + + + +### Message StorageGroup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | +| ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | +| lifetime | [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid | + + + + +### Message StorageGroup.Lifetime + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| unit | [StorageGroup.Lifetime.Unit](#storagegroup.StorageGroup.Lifetime.Unit) | | Unit is lifetime type | +| Value | [int64](#int64) | | Value for lifetime | + + + + + + +### StorageGroup.Lifetime.Unit + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unlimited | 0 | Unlimited set if storage group always valid | +| NeoFSEpoch | 1 | NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch | +| UnixTime | 2 | UnixTime set if storage group is valid until lifetime unix timestamp | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/query/types.proto b/query/types.proto new file mode 100644 index 0000000..6eaed5d --- /dev/null +++ b/query/types.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; +package query; +option go_package = "github.com/nspcc-dev/neofs-proto/query"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message Filter { + option (gogoproto.goproto_stringer) = false; + + enum Type { + // Exact sets when value of filter should be equal to the header value + Exact = 0; + // Regex sets when value of filter should match the header value by the regular expression + Regex = 1; + } + + // Type of filter + Type type = 1 [(gogoproto.customname) = "Type"]; + // Name of field that should be filtered + string Name = 2; + // Value that should be used for filter + string Value = 3; +} + +message Query { + option (gogoproto.goproto_stringer) = false; + + // Filters is set of filters, should not be empty + repeated Filter Filters = 1 [(gogoproto.nullable) = false]; +} diff --git a/refs/types.proto b/refs/types.proto new file mode 100644 index 0000000..8c7d2eb --- /dev/null +++ b/refs/types.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +package refs; +option go_package = "github.com/nspcc-dev/neofs-proto/refs"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +option (gogoproto.stringer_all) = false; +option (gogoproto.goproto_stringer_all) = false; + +// Address of object (container id + object id) +message Address { + // ObjectID is an object identifier, valid UUIDv4 represented in bytes + bytes ObjectID = 1[(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false]; + // CID is container identifier + bytes CID = 2[(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; +} diff --git a/service/meta.proto b/service/meta.proto new file mode 100644 index 0000000..d3c3005 --- /dev/null +++ b/service/meta.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +package service; +option go_package = "github.com/nspcc-dev/neofs-proto/service"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// RequestMetaHeader contains information about request meta headers +// (should be embedded into message) +message RequestMetaHeader { + // TTL must be larger than zero, it decreased in every NeoFS Node + uint32 TTL = 1; + // Epoch for user can be empty, because node sets epoch to the actual value + uint64 Epoch = 2; + // Version defines protocol version + // TODO: not used for now, should be implemented in future + uint32 Version = 3; +} diff --git a/service/verify.proto b/service/verify.proto new file mode 100644 index 0000000..c70015b --- /dev/null +++ b/service/verify.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package service; +option go_package = "github.com/nspcc-dev/neofs-proto/service"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request +// (should be embedded into message). +message RequestVerificationHeader { + message Sign { + // Sign is signature of the request or session key. + bytes Sign = 1; + // Peer is compressed public key used for signature. + bytes Peer = 2; + } + + message Signature { + // Sign is a signature and public key of the request. + Sign Sign = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // Origin used for requests, when trusted node changes it and re-sign with session key. + // If session key used for signature request, then Origin should contain + // public key of user and signed session key. + Sign Origin = 2; + } + + // Signatures is a set of signatures of every passed NeoFS Node + repeated Signature Signatures = 1; +} diff --git a/session/service.proto b/session/service.proto new file mode 100644 index 0000000..377e77e --- /dev/null +++ b/session/service.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package session; +option go_package = "github.com/nspcc-dev/neofs-proto/session"; + +import "session/types.proto"; +import "service/meta.proto"; +import "service/verify.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + + +service Session { + // Create is a method that used to open a trusted session to manipulate + // an object. In order to put or delete object client have to obtain session + // token with trusted node. Trusted node will modify client's object + // (add missing headers, checksums, homomorphic hash) and sign id with + // session key. Session is established during 4-step handshake in one gRPC stream + // + // - First client stream message SHOULD BE type of `CreateRequest_Init`. + // - First server stream message SHOULD BE type of `CreateResponse_Unsigned`. + // - Second client stream message SHOULD BE type of `CreateRequest_Signed`. + // - Second server stream message SHOULD BE type of `CreateResponse_Result`. + rpc Create (stream CreateRequest) returns (stream CreateResponse); +} + + +message CreateRequest { + // Message should be one of + oneof Message { + // Init is a message to initialize session opening. Carry: + // owner of manipulation object; + // ID of manipulation object; + // token lifetime bounds. + session.Token Init = 1; + // Signed Init message response (Unsigned) from server with user private key + session.Token Signed = 2; + } + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message CreateResponse { + oneof Message { + // Unsigned token with token ID and session public key generated on server side + session.Token Unsigned = 1; + // Result is a resulting token which can be used for object placing through an trusted intermediary + session.Token Result = 2; + } +} diff --git a/session/types.proto b/session/types.proto new file mode 100644 index 0000000..294928b --- /dev/null +++ b/session/types.proto @@ -0,0 +1,34 @@ +syntax = "proto3"; +package session; +option go_package = "github.com/nspcc-dev/neofs-proto/session"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message VerificationHeader { + // PublicKey is a session public key + bytes PublicKey = 1; + // KeySignature is a session public key signature. Signed by trusted side + bytes KeySignature = 2; +} + +// User token granting rights for object manipulation +message Token { + // Header carries verification data of session key + VerificationHeader Header = 1 [(gogoproto.nullable) = false]; + // OwnerID is an owner of manipulation object + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // FirstEpoch is an initial epoch of token lifetime + uint64 FirstEpoch = 3; + // LastEpoch is a last epoch of token lifetime + uint64 LastEpoch = 4; + // ObjectID is an object identifier of manipulation object + repeated bytes ObjectID = 5 [(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false]; + // Signature is a token signature, signed by owner of manipulation object + bytes Signature = 6; + // ID is a token identifier. valid UUIDv4 represented in bytes + bytes ID = 7 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; + // PublicKeys associated with owner + repeated bytes PublicKeys = 8; +} diff --git a/state/service.proto b/state/service.proto new file mode 100644 index 0000000..a30af22 --- /dev/null +++ b/state/service.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package state; +option go_package = "github.com/nspcc-dev/neofs-proto/state"; + +import "service/meta.proto"; +import "service/verify.proto"; +import "bootstrap/types.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +// Status service provides node's healthcheck and status info +service Status { + // Netmap request allows to receive current [bootstrap.SpreadMap](bootstrap.md#bootstrap.SpreadMap) + rpc Netmap(NetmapRequest) returns (bootstrap.SpreadMap); + // Metrics request allows to receive metrics in prometheus format + rpc Metrics(MetricsRequest) returns (MetricsResponse); + // HealthCheck request allows to check health status of the node. + // If node unhealthy field Status would contains detailed info. + rpc HealthCheck(HealthRequest) returns (HealthResponse); + // DumpConfig request allows dumping settings for the current node. + // To permit access, used server config options. + // The request should be signed. + rpc DumpConfig(DumpRequest) returns (DumpResponse); +} + +// NetmapRequest message to request current node netmap +message NetmapRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// MetricsRequest message to request node metrics +message MetricsRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// MetricsResponse contains [][]byte, +// every []byte is marshaled MetricFamily proto message +// from github.com/prometheus/client_model/metrics.proto +message MetricsResponse { + repeated bytes Metrics = 1; +} + +// HealthRequest message to check current state +message HealthRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// HealthResponse message with current state +message HealthResponse { + // Healthy is true when node alive and healthy + bool Healthy = 1; + // Status contains detailed information about health status + string Status = 2; +} + +// DumpRequest message to fetch current server config. +message DumpRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// DumpResponse message contains current server config. +// Config stored in JSON encoded into slice of bytes. +message DumpResponse { + bytes Config = 1; +} diff --git a/storagegroup/types.proto b/storagegroup/types.proto new file mode 100644 index 0000000..5014b96 --- /dev/null +++ b/storagegroup/types.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; +package storagegroup; +option go_package = "github.com/nspcc-dev/neofs-proto/storagegroup"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; + +option (gogoproto.stable_marshaler_all) = true; + +message StorageGroup { + option (gogoproto.goproto_stringer) = false; + + // ValidationDataSize is size of the all object's payloads included into storage group + uint64 ValidationDataSize = 1; + // ValidationHash is homomorphic hash of all object's payloads included into storage group + bytes ValidationHash = 2 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; + + message Lifetime { + enum Unit { + // Unlimited set if storage group always valid + Unlimited = 0; + // NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch + NeoFSEpoch = 1; + // UnixTime set if storage group is valid until lifetime unix timestamp + UnixTime = 2; + } + + // Unit is lifetime type + Unit unit = 1 [(gogoproto.customname) = "Unit"]; + // Value for lifetime + int64 Value = 2; + } + + // Lifetime is time until storage group is valid + Lifetime lifetime = 3 [(gogoproto.customname) = "Lifetime"]; +} From b7cd44ed13f1ae64528670124948439093310c0f Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 30 Jan 2020 15:13:04 +0300 Subject: [PATCH 003/440] fix readme --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 2cd9527..47359f0 100644 --- a/README.md +++ b/README.md @@ -55,15 +55,6 @@ Bootstrap package defines: Decimal defines custom decimal implementation which is used in accounting operations. -### Hash - -Hash package defines homomorphic hash type. - -### Internal - -Internal package defines constant error type and proto interface for custom -protobuf structures. - ### Object Object package defines service and structures for object operations. Object is From cc355807009894edcc31d7b511c3cde0393513c1 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 30 Jan 2020 16:29:38 +0300 Subject: [PATCH 004/440] rename gopackage from neofs-proto to neofs-api --- accounting/service.proto | 2 +- accounting/types.proto | 4 ++-- accounting/withdraw.proto | 2 +- bootstrap/service.proto | 2 +- bootstrap/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- decimal/decimal.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- query/types.proto | 2 +- refs/types.proto | 2 +- service/meta.proto | 2 +- service/verify.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- state/service.proto | 2 +- storagegroup/types.proto | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index f2696c4..c320106 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api/accounting"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index ac512b9..1af83c1 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api/accounting"; import "decimal/decimal.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -85,7 +85,7 @@ message Tx { message Settlement { message Receiver { - // To is the address of funds recipient + // To is the address of funds recipient string To = 1; // Amount is the amount of funds that will be sent decimal.Decimal Amount = 2; diff --git a/accounting/withdraw.proto b/accounting/withdraw.proto index a44e47a..85000b9 100644 --- a/accounting/withdraw.proto +++ b/accounting/withdraw.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-proto/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api/accounting"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/bootstrap/service.proto b/bootstrap/service.proto index f0bf755..fa0248c 100644 --- a/bootstrap/service.proto +++ b/bootstrap/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package bootstrap; -option go_package = "github.com/nspcc-dev/neofs-proto/bootstrap"; +option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 5a566da..02da9ad 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package bootstrap; -option go_package = "github.com/nspcc-dev/neofs-proto/bootstrap"; +option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/container/service.proto b/container/service.proto index 9bd02c9..4576197 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package container; -option go_package = "github.com/nspcc-dev/neofs-proto/container"; +option go_package = "github.com/nspcc-dev/neofs-api/container"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/container/types.proto b/container/types.proto index 4600046..e53587e 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package container; -option go_package = "github.com/nspcc-dev/neofs-proto/container"; +option go_package = "github.com/nspcc-dev/neofs-api/container"; import "github.com/nspcc-dev/netmap/selector.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/decimal/decimal.proto b/decimal/decimal.proto index 42cf2df..e0e16d5 100644 --- a/decimal/decimal.proto +++ b/decimal/decimal.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package decimal; -option go_package = "github.com/nspcc-dev/neofs-proto/decimal"; +option go_package = "github.com/nspcc-dev/neofs-api/decimal"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/object/service.proto b/object/service.proto index 91c0cbd..12f9741 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package object; -option go_package = "github.com/nspcc-dev/neofs-proto/object"; +option go_package = "github.com/nspcc-dev/neofs-api/object"; import "refs/types.proto"; import "object/types.proto"; diff --git a/object/types.proto b/object/types.proto index 293f347..5a0b98e 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package object; -option go_package = "github.com/nspcc-dev/neofs-proto/object"; +option go_package = "github.com/nspcc-dev/neofs-api/object"; import "refs/types.proto"; import "session/types.proto"; diff --git a/query/types.proto b/query/types.proto index 6eaed5d..90f4bbf 100644 --- a/query/types.proto +++ b/query/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package query; -option go_package = "github.com/nspcc-dev/neofs-proto/query"; +option go_package = "github.com/nspcc-dev/neofs-api/query"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/refs/types.proto b/refs/types.proto index 8c7d2eb..c526d56 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package refs; -option go_package = "github.com/nspcc-dev/neofs-proto/refs"; +option go_package = "github.com/nspcc-dev/neofs-api/refs"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/meta.proto b/service/meta.proto index d3c3005..f2cfe8f 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package service; -option go_package = "github.com/nspcc-dev/neofs-proto/service"; +option go_package = "github.com/nspcc-dev/neofs-api/service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/verify.proto b/service/verify.proto index c70015b..6a4a0e0 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package service; -option go_package = "github.com/nspcc-dev/neofs-proto/service"; +option go_package = "github.com/nspcc-dev/neofs-api/service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/session/service.proto b/session/service.proto index 377e77e..95ea9c5 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package session; -option go_package = "github.com/nspcc-dev/neofs-proto/session"; +option go_package = "github.com/nspcc-dev/neofs-api/session"; import "session/types.proto"; import "service/meta.proto"; diff --git a/session/types.proto b/session/types.proto index 294928b..79b24ff 100644 --- a/session/types.proto +++ b/session/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package session; -option go_package = "github.com/nspcc-dev/neofs-proto/session"; +option go_package = "github.com/nspcc-dev/neofs-api/session"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/state/service.proto b/state/service.proto index a30af22..7966d43 100644 --- a/state/service.proto +++ b/state/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package state; -option go_package = "github.com/nspcc-dev/neofs-proto/state"; +option go_package = "github.com/nspcc-dev/neofs-api/state"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 5014b96..238b454 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package storagegroup; -option go_package = "github.com/nspcc-dev/neofs-proto/storagegroup"; +option go_package = "github.com/nspcc-dev/neofs-api/storagegroup"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; From 63b956e50c5e9082cc505f57b0d6ed090df5f982 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 3 Feb 2020 12:08:18 +0300 Subject: [PATCH 005/440] make object.Search to be server-side streaming RPC --- object/service.proto | 2 +- proto-docs/object.md | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index 12f9741..4487a49 100644 --- a/object/service.proto +++ b/object/service.proto @@ -40,7 +40,7 @@ service Service { // Search objects in container. Version of query language format SHOULD BE // set to 1. Search query represented in serialized format (see query // package). - rpc Search(SearchRequest) returns (SearchResponse); + rpc Search(SearchRequest) returns (stream SearchResponse); // GetRange of data payload. Ranges are set of pairs (offset, length). // Fragments order in response corresponds to ranges order in request. diff --git a/proto-docs/object.md b/proto-docs/object.md index e749b98..f19b6f1 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -63,7 +63,7 @@ rpc Get(GetRequest) returns (stream GetResponse); rpc Put(stream PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Head(HeadRequest) returns (HeadResponse); -rpc Search(SearchRequest) returns (SearchResponse); +rpc Search(SearchRequest) returns (stream SearchResponse); rpc GetRange(GetRangeRequest) returns (GetRangeResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); @@ -112,7 +112,8 @@ headers are also present. Search objects in container. Version of query language format SHOULD BE set to 1. Search query represented in serialized format (see query -package). +package). Requested list can be restored by concatenation of addresses +from all messages. Addresses from resulting list are expected to be unique. | Name | Input | Output | | ---- | ----- | ------ | From 6bd0d99dddf70edd6cb43cf9bb4e2d19e30aabc4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Feb 2020 13:38:53 +0300 Subject: [PATCH 006/440] make object.GetRange to be server-side streaming RPC --- object/service.proto | 11 ++++++----- proto-docs/object.md | 5 ++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/object/service.proto b/object/service.proto index 4487a49..fb80e5d 100644 --- a/object/service.proto +++ b/object/service.proto @@ -42,9 +42,10 @@ service Service { // package). rpc Search(SearchRequest) returns (stream SearchResponse); - // GetRange of data payload. Ranges are set of pairs (offset, length). - // Fragments order in response corresponds to ranges order in request. - rpc GetRange(GetRangeRequest) returns (GetRangeResponse); + // GetRange of data payload. Range is a pair (offset, length). + // Requested range can be restored by concatenation of all chunks + // keeping receiving order. + rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // GetRangeHash returns homomorphic hash of object payload range after XOR // operation. Ranges are set of pairs (offset, length). Hashes order in @@ -153,8 +154,8 @@ message SearchResponse { message GetRangeRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; - // Ranges of object's payload to return - repeated Range Ranges = 2 [(gogoproto.nullable) = false]; + // Range of object's payload to return + Range Range = 2 [(gogoproto.nullable) = false]; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index f19b6f1..2d8de6f 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -64,7 +64,7 @@ rpc Put(stream PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Head(HeadRequest) returns (HeadResponse); rpc Search(SearchRequest) returns (stream SearchResponse); -rpc GetRange(GetRangeRequest) returns (GetRangeResponse); +rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); ``` @@ -120,8 +120,7 @@ from all messages. Addresses from resulting list are expected to be unique. | Search | [SearchRequest](#object.SearchRequest) | [SearchResponse](#object.SearchResponse) | #### Method GetRange -GetRange of data payload. Ranges are set of pairs (offset, length). -Fragments order in response corresponds to ranges order in request. +GetRange of data payload. Range is a pair (offset, length). | Name | Input | Output | | ---- | ----- | ------ | From 8959621826a8e1da57aa00d6b58819eab19d2716 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Feb 2020 14:21:15 +0300 Subject: [PATCH 007/440] change GetRangeResponse type from 'repeated bytes' to 'bytes' --- object/service.proto | 4 ++-- proto-docs/object.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index fb80e5d..662bf8a 100644 --- a/object/service.proto +++ b/object/service.proto @@ -163,8 +163,8 @@ message GetRangeRequest { } message GetRangeResponse { - // Fragments of object's payload - repeated bytes Fragments = 1; + // Fragment of object's payload + bytes Fragment = 1; } message GetRangeHashRequest { diff --git a/proto-docs/object.md b/proto-docs/object.md index 2d8de6f..3c4a0ec 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -209,7 +209,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Fragments | [bytes](#bytes) | repeated | Fragments of object's payload | +| Fragment | [bytes](#bytes) | | Fragment of object's payload | From 9b2cb915aceae119f11f13f854fc1dcf01ba6872 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Feb 2020 14:23:14 +0300 Subject: [PATCH 008/440] update GetRangeRequest docs --- proto-docs/object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-docs/object.md b/proto-docs/object.md index 3c4a0ec..57d0d56 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -196,7 +196,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to return | +| Range | [Range](#object.Range) | | Range of object's payload to return | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | From d1d9b75f49dd9ce51adbd1d8983b7cb5c2f740f7 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 5 Feb 2020 15:14:39 +0300 Subject: [PATCH 009/440] Add CSharp namespace to proto files --- accounting/service.proto | 1 + accounting/types.proto | 1 + accounting/withdraw.proto | 1 + bootstrap/service.proto | 1 + bootstrap/types.proto | 3 ++- container/service.proto | 1 + container/types.proto | 1 + decimal/decimal.proto | 1 + object/service.proto | 1 + object/types.proto | 1 + query/types.proto | 1 + refs/types.proto | 1 + service/meta.proto | 1 + service/verify.proto | 1 + session/service.proto | 1 + session/types.proto | 1 + state/service.proto | 1 + storagegroup/types.proto | 1 + 18 files changed, 19 insertions(+), 1 deletion(-) diff --git a/accounting/service.proto b/accounting/service.proto index c320106..12fca58 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package accounting; option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index 1af83c1..1c0cd57 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package accounting; option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option csharp_namespace = "NeoFS.API.Accounting"; import "decimal/decimal.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/accounting/withdraw.proto b/accounting/withdraw.proto index 85000b9..ee23b5d 100644 --- a/accounting/withdraw.proto +++ b/accounting/withdraw.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package accounting; option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/bootstrap/service.proto b/bootstrap/service.proto index fa0248c..db43bf6 100644 --- a/bootstrap/service.proto +++ b/bootstrap/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package bootstrap; option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; +option csharp_namespace = "NeoFS.API.Bootstrap"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 02da9ad..cbce379 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -1,10 +1,11 @@ syntax = "proto3"; package bootstrap; option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; +option csharp_namespace = "NeoFS.API.Bootstrap"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; -option (gogoproto.stable_marshaler_all) = true;; +option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_stringer_all) = false; diff --git a/container/service.proto b/container/service.proto index 4576197..b287a22 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package container; option go_package = "github.com/nspcc-dev/neofs-api/container"; +option csharp_namespace = "NeoFS.API.Container"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/container/types.proto b/container/types.proto index e53587e..775d84c 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package container; option go_package = "github.com/nspcc-dev/neofs-api/container"; +option csharp_namespace = "NeoFS.API.Container"; import "github.com/nspcc-dev/netmap/selector.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/decimal/decimal.proto b/decimal/decimal.proto index e0e16d5..d21ce1b 100644 --- a/decimal/decimal.proto +++ b/decimal/decimal.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package decimal; option go_package = "github.com/nspcc-dev/neofs-api/decimal"; +option csharp_namespace = "NeoFS.API.Decimal"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/object/service.proto b/object/service.proto index 662bf8a..f208472 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package object; option go_package = "github.com/nspcc-dev/neofs-api/object"; +option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "object/types.proto"; diff --git a/object/types.proto b/object/types.proto index 5a0b98e..3abe725 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package object; option go_package = "github.com/nspcc-dev/neofs-api/object"; +option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "session/types.proto"; diff --git a/query/types.proto b/query/types.proto index 90f4bbf..0d35154 100644 --- a/query/types.proto +++ b/query/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package query; option go_package = "github.com/nspcc-dev/neofs-api/query"; +option csharp_namespace = "NeoFS.API.Query"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/refs/types.proto b/refs/types.proto index c526d56..d552d6c 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package refs; option go_package = "github.com/nspcc-dev/neofs-api/refs"; +option csharp_namespace = "NeoFS.API.Refs"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/meta.proto b/service/meta.proto index f2cfe8f..5ca3633 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package service; option go_package = "github.com/nspcc-dev/neofs-api/service"; +option csharp_namespace = "NeoFS.API.Service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/verify.proto b/service/verify.proto index 6a4a0e0..d241d88 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package service; option go_package = "github.com/nspcc-dev/neofs-api/service"; +option csharp_namespace = "NeoFS.API.Service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/session/service.proto b/session/service.proto index 95ea9c5..2c96a3e 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package session; option go_package = "github.com/nspcc-dev/neofs-api/session"; +option csharp_namespace = "NeoFS.API.Session"; import "session/types.proto"; import "service/meta.proto"; diff --git a/session/types.proto b/session/types.proto index 79b24ff..0cf1583 100644 --- a/session/types.proto +++ b/session/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package session; option go_package = "github.com/nspcc-dev/neofs-api/session"; +option csharp_namespace = "NeoFS.API.Session"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/state/service.proto b/state/service.proto index 7966d43..312d465 100644 --- a/state/service.proto +++ b/state/service.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package state; option go_package = "github.com/nspcc-dev/neofs-api/state"; +option csharp_namespace = "NeoFS.API.State"; import "service/meta.proto"; import "service/verify.proto"; diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 238b454..41a211f 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -1,6 +1,7 @@ syntax = "proto3"; package storagegroup; option go_package = "github.com/nspcc-dev/neofs-api/storagegroup"; +option csharp_namespace = "NeoFS.API.StorageGroup"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; From 7fc06acc9b7f5a0961f3be0a94d800ce1e5f92c0 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 10 Feb 2020 13:28:38 +0300 Subject: [PATCH 010/440] Add method to State service to dump debug variables Variables should be stored in JSON encoded to slice of bytes. --- state/service.proto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/state/service.proto b/state/service.proto index 312d465..dc5efe4 100644 --- a/state/service.proto +++ b/state/service.proto @@ -23,6 +23,10 @@ service Status { // To permit access, used server config options. // The request should be signed. rpc DumpConfig(DumpRequest) returns (DumpResponse); + // DumpVars returns debug variables for the current node. + // To permit access, used server config options. + // The request should be signed. + rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); } // NetmapRequest message to request current node netmap @@ -77,3 +81,17 @@ message DumpRequest { message DumpResponse { bytes Config = 1; } + +// DumpVarsRequest message to fetch current server debug variables. +message DumpVarsRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// DumpVarsResponse message contains current server debug variables. +// Variables stored in JSON encoded into slice of bytes. +message DumpVarsResponse { + bytes Variables = 1; +} From f3595a85c592c4a3e043cde89fbcd438470a1099 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 13 Feb 2020 17:21:46 +0300 Subject: [PATCH 011/440] Define ResponseMetaHeader in service package --- service/meta.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service/meta.proto b/service/meta.proto index 5ca3633..97017c9 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -18,3 +18,13 @@ message RequestMetaHeader { // TODO: not used for now, should be implemented in future uint32 Version = 3; } + +// ResponseMetaHeader contains meta information based on request processing by server +// (should be embedded into message) +message ResponseMetaHeader { + // Current NeoFS epoch on server + uint64 Epoch = 1; + // Version defines protocol version + // TODO: not used for now, should be implemented in future + uint32 Version = 2; +} From afd6a5f69e45df0830efed6a938b380282a026f3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 13 Feb 2020 17:22:25 +0300 Subject: [PATCH 012/440] Add ResponseMetaHeader to all Object service response messages --- object/service.proto | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/object/service.proto b/object/service.proto index f208472..dbd2a80 100644 --- a/object/service.proto +++ b/object/service.proto @@ -73,6 +73,9 @@ message GetResponse { // Chunk of remaining payload bytes Chunk = 2; } + + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message PutRequest { @@ -99,6 +102,8 @@ message PutRequest { message PutResponse { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message DeleteRequest { // Address of object (container id + object id) @@ -115,7 +120,10 @@ message DeleteRequest { // DeleteResponse is empty because we cannot guarantee permanent object removal // in distributed system. -message DeleteResponse {} +message DeleteResponse { + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} message HeadRequest { // Address of object (container id + object id) @@ -132,6 +140,8 @@ message HeadRequest { message HeadResponse { // Object without payload Object Object = 1; + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message SearchRequest { @@ -150,6 +160,8 @@ message SearchRequest { message SearchResponse { // Addresses of found objects repeated refs.Address Addresses = 1 [(gogoproto.nullable) = false]; + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message GetRangeRequest { @@ -166,6 +178,8 @@ message GetRangeRequest { message GetRangeResponse { // Fragment of object's payload bytes Fragment = 1; + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message GetRangeHashRequest { @@ -184,5 +198,7 @@ message GetRangeHashRequest { message GetRangeHashResponse { // Hashes is a homomorphic hashes of all ranges repeated bytes Hashes = 1 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; + // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) + service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } From d8a0c287c430bc54087415fc2097b87862e265fa Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 31 Mar 2020 09:58:22 +0300 Subject: [PATCH 013/440] Migrate to NeoFS API Go --- accounting/service.proto | 2 +- accounting/types.proto | 2 +- accounting/withdraw.proto | 2 +- bootstrap/service.proto | 2 +- bootstrap/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- decimal/decimal.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- query/types.proto | 2 +- refs/types.proto | 2 +- service/meta.proto | 2 +- service/verify.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- state/service.proto | 2 +- storagegroup/types.proto | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 12fca58..d1540c4 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index 1c0cd57..02fb691 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; import "decimal/decimal.proto"; diff --git a/accounting/withdraw.proto b/accounting/withdraw.proto index ee23b5d..080a100 100644 --- a/accounting/withdraw.proto +++ b/accounting/withdraw.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package accounting; -option go_package = "github.com/nspcc-dev/neofs-api/accounting"; +option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; diff --git a/bootstrap/service.proto b/bootstrap/service.proto index db43bf6..e37c878 100644 --- a/bootstrap/service.proto +++ b/bootstrap/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package bootstrap; -option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; +option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; option csharp_namespace = "NeoFS.API.Bootstrap"; import "service/meta.proto"; diff --git a/bootstrap/types.proto b/bootstrap/types.proto index cbce379..4ef0fff 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package bootstrap; -option go_package = "github.com/nspcc-dev/neofs-api/bootstrap"; +option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; option csharp_namespace = "NeoFS.API.Bootstrap"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/container/service.proto b/container/service.proto index b287a22..bccf924 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package container; -option go_package = "github.com/nspcc-dev/neofs-api/container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; import "service/meta.proto"; diff --git a/container/types.proto b/container/types.proto index 775d84c..a0d035d 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package container; -option go_package = "github.com/nspcc-dev/neofs-api/container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; import "github.com/nspcc-dev/netmap/selector.proto"; diff --git a/decimal/decimal.proto b/decimal/decimal.proto index d21ce1b..f3d5c00 100644 --- a/decimal/decimal.proto +++ b/decimal/decimal.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package decimal; -option go_package = "github.com/nspcc-dev/neofs-api/decimal"; +option go_package = "github.com/nspcc-dev/neofs-api-go/decimal"; option csharp_namespace = "NeoFS.API.Decimal"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/object/service.proto b/object/service.proto index dbd2a80..2aa21fd 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package object; -option go_package = "github.com/nspcc-dev/neofs-api/object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; diff --git a/object/types.proto b/object/types.proto index 3abe725..f21bf74 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package object; -option go_package = "github.com/nspcc-dev/neofs-api/object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; diff --git a/query/types.proto b/query/types.proto index 0d35154..ebc0d64 100644 --- a/query/types.proto +++ b/query/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package query; -option go_package = "github.com/nspcc-dev/neofs-api/query"; +option go_package = "github.com/nspcc-dev/neofs-api-go/query"; option csharp_namespace = "NeoFS.API.Query"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/refs/types.proto b/refs/types.proto index d552d6c..6b001c0 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package refs; -option go_package = "github.com/nspcc-dev/neofs-api/refs"; +option go_package = "github.com/nspcc-dev/neofs-api-go/refs"; option csharp_namespace = "NeoFS.API.Refs"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/meta.proto b/service/meta.proto index 97017c9..99b37d3 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package service; -option go_package = "github.com/nspcc-dev/neofs-api/service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/service/verify.proto b/service/verify.proto index d241d88..de0a69a 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package service; -option go_package = "github.com/nspcc-dev/neofs-api/service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/session/service.proto b/session/service.proto index 2c96a3e..524213a 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package session; -option go_package = "github.com/nspcc-dev/neofs-api/session"; +option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; import "session/types.proto"; diff --git a/session/types.proto b/session/types.proto index 0cf1583..3ae49a3 100644 --- a/session/types.proto +++ b/session/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package session; -option go_package = "github.com/nspcc-dev/neofs-api/session"; +option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; diff --git a/state/service.proto b/state/service.proto index dc5efe4..bebc913 100644 --- a/state/service.proto +++ b/state/service.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package state; -option go_package = "github.com/nspcc-dev/neofs-api/state"; +option go_package = "github.com/nspcc-dev/neofs-api-go/state"; option csharp_namespace = "NeoFS.API.State"; import "service/meta.proto"; diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 41a211f..fde33aa 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -1,6 +1,6 @@ syntax = "proto3"; package storagegroup; -option go_package = "github.com/nspcc-dev/neofs-api/storagegroup"; +option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup"; option csharp_namespace = "NeoFS.API.StorageGroup"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; From 54060e29be67420de0c65cebe2ce45469e340c92 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 31 Mar 2020 10:17:52 +0300 Subject: [PATCH 014/440] update proto docs --- proto-docs/object.md | 15 +++++++++++++-- proto-docs/service.md | 14 ++++++++++++++ proto-docs/state.md | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/proto-docs/object.md b/proto-docs/object.md index 57d0d56..ce9252b 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -112,8 +112,7 @@ headers are also present. Search objects in container. Version of query language format SHOULD BE set to 1. Search query represented in serialized format (see query -package). Requested list can be restored by concatenation of addresses -from all messages. Addresses from resulting list are expected to be unique. +package). | Name | Input | Output | | ---- | ----- | ------ | @@ -121,6 +120,8 @@ from all messages. Addresses from resulting list are expected to be unique. #### Method GetRange GetRange of data payload. Range is a pair (offset, length). +Requested range can be restored by concatenation of all chunks +keeping receiving order. | Name | Input | Output | | ---- | ----- | ------ | @@ -160,6 +161,10 @@ DeleteResponse is empty because we cannot guarantee permanent object removal in distributed system. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | + @@ -185,6 +190,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Hashes | [bytes](#bytes) | repeated | Hashes is a homomorphic hashes of all ranges | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -210,6 +216,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Fragment | [bytes](#bytes) | | Fragment of object's payload | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -236,6 +243,7 @@ in distributed system. | ----- | ---- | ----- | ----------- | | object | [Object](#object.Object) | | Object header and some payload | | Chunk | [bytes](#bytes) | | Chunk of remaining payload | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -262,6 +270,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object without payload | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -299,6 +308,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -325,6 +335,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Addresses | [refs.Address](#refs.Address) | repeated | Addresses of found objects | +| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | diff --git a/proto-docs/service.md b/proto-docs/service.md index 08a1065..2b6b33e 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -7,6 +7,7 @@ - Messages - [RequestMetaHeader](#service.RequestMetaHeader) + - [ResponseMetaHeader](#service.ResponseMetaHeader) - [service/verify.proto](#service/verify.proto) @@ -43,6 +44,19 @@ RequestMetaHeader contains information about request meta headers | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | + + + +### Message ResponseMetaHeader +ResponseMetaHeader contains meta information based on request processing by server +(should be embedded into message) + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Epoch | [uint64](#uint64) | | Current NeoFS epoch on server | +| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | + diff --git a/proto-docs/state.md b/proto-docs/state.md index 7950455..2b3de4a 100644 --- a/proto-docs/state.md +++ b/proto-docs/state.md @@ -10,6 +10,8 @@ - Messages - [DumpRequest](#state.DumpRequest) - [DumpResponse](#state.DumpResponse) + - [DumpVarsRequest](#state.DumpVarsRequest) + - [DumpVarsResponse](#state.DumpVarsResponse) - [HealthRequest](#state.HealthRequest) - [HealthResponse](#state.HealthResponse) - [MetricsRequest](#state.MetricsRequest) @@ -39,6 +41,7 @@ rpc Netmap(NetmapRequest) returns (.bootstrap.SpreadMap); rpc Metrics(MetricsRequest) returns (MetricsResponse); rpc HealthCheck(HealthRequest) returns (HealthResponse); rpc DumpConfig(DumpRequest) returns (DumpResponse); +rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); ``` @@ -73,6 +76,15 @@ The request should be signed. | Name | Input | Output | | ---- | ----- | ------ | | DumpConfig | [DumpRequest](#state.DumpRequest) | [DumpResponse](#state.DumpResponse) | +#### Method DumpVars + +DumpVars returns debug variables for the current node. +To permit access, used server config options. +The request should be signed. + +| Name | Input | Output | +| ---- | ----- | ------ | +| DumpVars | [DumpVarsRequest](#state.DumpVarsRequest) | [DumpVarsResponse](#state.DumpVarsResponse) | @@ -100,6 +112,30 @@ Config stored in JSON encoded into slice of bytes. | Config | [bytes](#bytes) | | | + + +### Message DumpVarsRequest +DumpVarsRequest message to fetch current server debug variables. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message DumpVarsResponse +DumpVarsResponse message contains current server debug variables. +Variables stored in JSON encoded into slice of bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Variables | [bytes](#bytes) | | | + + ### Message HealthRequest From ed82c2364233b92f15c88d49a6b1278298826e91 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 31 Mar 2020 10:36:51 +0300 Subject: [PATCH 015/440] update netmap library version --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2c672d0..abecfe3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -NETMAP_VERSION=v1.6.1 +NETMAP_VERSION=v1.7.0 GOGOPROTO_VERSION=v1.3.1 NETMAP_URL=https://github.com/nspcc-dev/netmap/archive/$(NETMAP_VERSION).tar.gz From b48cc534f4f13a139556fc63fad37af3f6c49469 Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 18:04:37 +0300 Subject: [PATCH 016/440] docs: Update readme file for public release --- README.md | 113 +++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 47359f0..e00551b 100644 --- a/README.md +++ b/README.md @@ -1,104 +1,103 @@ -# NeoFS-proto +# NeoFS-API -NeoFS-proto repository contains implementation of core NeoFS structures that -can be used for integration with NeoFS. +NeoFS-API repository contains language-agnostic +[protocol buffers](https://developers.google.com/protocol-buffers) definitions +of neofs-node structures and services. ## Description -Repository contains 13 packages that implement NeoFS core structures. These -packages mostly contain protobuf files with service and structure definitions -or NeoFS core types with complemented functions. +NeoFS-API repository is the basis for language-specific libraries, e.g.: -There is a auto-generated documentation for protobuf files in [docs](proto-docs). +- [neofs-api-go](https://github.com/nspcc-dev/neofs-api-go) +- [neofs-api-csharp](https://github.com/nspcc-dev/neofs-api-csharp) -### Accounting +These libraries contain compiled protocol buffers code, defined in this +repository. Use them to integrate applications with NeoFS. -Accounting package defines services and structures for accounting operations: -balance request and `cheque` operations for withdraw. `Cheque` is a structure -with inner ring signatures, which approve that user can withdraw requested -amount of assets. NeoFS smart contract takes binary formatted `cheque` as a -parameter in withdraw call. +This repository contains: + +- 11 protocol buffers packages, +- [auto-generated docs](proto-docs) for protocol buffers, +- [manually written docs](docs) for developers (to be done). + + +### Protocol packages + +#### Accounting + +Accounting package defines services and structures for balance request and +`cheque` operations. + +See: -#### API -Accounting package defines: - [Accounting service](proto-docs/accounting.md#accounting.Accounting) - [Withdraw service](proto-docs/accounting.md#accounting.Withdraw) -### Bootstrap +#### Bootstrap -Bootstrap package defines bootstrap service which is used by storage nodes to -connect to the storage network. +Bootstrap package defines bootstrap service that connects storage nodes +to the network. + +See: -#### API -Bootstrap package defines: - [Bootstrap service](proto-docs/bootstrap.md#bootstrap.Bootstrap) -### Chain +#### Container -Chain package contains util functions for operations with NEO Blockchain types: -wallet addresses, script-hashes. +Container package defines service and structure of containers. NeoFS stores +objects within the registered container according to a specified storage policy. -### Container +See: -Container package defines service and structures for operations with containers. -Objects in NeoFS are stored in containers. Container defines storage -policy for the objects. - -#### API -Bootstrap package defines: - [Container service](proto-docs/container.md#container.Service) -### Decimal +#### Object -Decimal defines custom decimal implementation which is used in accounting -operations. +Object is the storage unit in NeoFS. Object package defines structure of the +object and service requests. -### Object +See: -Object package defines service and structures for object operations. Object is -a core storage structure in NeoFS. Package contains detailed information -about object internal structure. - -#### API -Object package defines: - [Object service](proto-docs/object.md#object.Service) -### Query +#### Query Query package defines structure for object search requests. -### Refs +#### Refs -Refs package defines core identity types: Object ID, Container ID, etc. +Refs package defines identity types: object id, container id, etc. -### Service +#### Service -Service package defines util structure and functions for all NeoFS services -operations: TTL and request signature management, node roles, epoch retriever. +Service package defines utility structures for all public API requests: +TTL, request signature, etc. -### Session +#### Session -Session package defines service and structures for session obtain. Object -operations require an established session with pair of session keys signed by -owner of the object. +Session package defines service and structures to setup session between +the node and the client. Session token is required in some object service +requests. Node uses session private key to re-sign new objects and requests. + +See: -#### API -Session package defines: - [Session service](proto-docs/session.md#session.Session) -### State +#### State State package defines service and structures for metrics gathering. -#### API -State package defines: +See: + - [Status service](proto-docs/state.md#state.Status) -## Contributing +#### StorageGroup + +Storagegroup package defines structure that contains meta data for data audit. +This meta data stored as a header in the NeoFS object. -At this moment, we do not accept contributions. ## License From afd55ac90b4e6744545009a0319dfb4d4eaf610f Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 18:40:04 +0300 Subject: [PATCH 017/440] acl: Define target of access control rules Basic NeoFS ACL applies access rules to request sender. Request senders are combined in groups that calls `targets`. Basic ACL rules may be applied to these targets: 1. User - request sender is the owner of the container, used in the request. 2. System - request sender is the storage node within the container used in the request or inner ring node. 3. Others - request sender is none of the above. Extended ACL rules may be applied for targets, provided with extra information. 4. PubKey - request sender has provided public key. --- acl/types.proto | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 acl/types.proto diff --git a/acl/types.proto b/acl/types.proto new file mode 100644 index 0000000..f20423f --- /dev/null +++ b/acl/types.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package acl; +option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; +option csharp_namespace = "NeoFS.API.Acl"; + +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +option (gogoproto.stable_marshaler_all) = true; + +// Target of the access control rule in access control list. +enum Target { + // Unknown target, default value. + Unknown = 0; + + // User target rule is applied if sender is the owner of the container. + User = 1; + + // System target rule is applied if sender is the storage node within the + // container or inner ring node. + System = 2; + + // Others target rule is applied if sender is not user or system target. + Others = 3; + + // PubKey target rule is applied if sender has public key provided in + // extended ACL. + PubKey = 4; +} From 5b8fecc93d82f499eb1a61278bfa69788a0d81cb Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 18:48:49 +0300 Subject: [PATCH 018/440] docs: Add docs for new ACL package This commit adds auto-generated proto-docs page and ACL section in readme. --- README.md | 5 +++- proto-docs/acl.md | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 proto-docs/acl.md diff --git a/README.md b/README.md index e00551b..ea817f1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ repository. Use them to integrate applications with NeoFS. This repository contains: -- 11 protocol buffers packages, +- 12 protocol buffers packages, - [auto-generated docs](proto-docs) for protocol buffers, - [manually written docs](docs) for developers (to be done). @@ -33,6 +33,9 @@ See: - [Accounting service](proto-docs/accounting.md#accounting.Accounting) - [Withdraw service](proto-docs/accounting.md#accounting.Withdraw) +#### ACL + +ACL package defines targets of access control rules. #### Bootstrap diff --git a/proto-docs/acl.md b/proto-docs/acl.md new file mode 100644 index 0000000..38f328b --- /dev/null +++ b/proto-docs/acl.md @@ -0,0 +1,62 @@ +# Protocol Documentation + + +## Table of Contents + +- [acl/types.proto](#acl/types.proto) + + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## acl/types.proto + + + + + + + + + +### Target +Target of the access control rule in access control list. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | Unknown target, default value. | +| User | 1 | User target rule is applied if sender is the owner of the container. | +| System | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | +| Others | 3 | Others target rule is applied if sender is not user or system target. | +| PubKey | 4 | PubKey target rule is applied if sender has public key provided in extended ACL. | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From 2b667d13ecdd8de766c06718cfb8a21e09d923ba Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 19:22:11 +0300 Subject: [PATCH 019/440] docs: Add `Decimal` section in readme file --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ea817f1..fe31231 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ See: - [Container service](proto-docs/container.md#container.Service) +#### Decimal + +Decimal defines structure for encoding assets amount. + #### Object Object is the storage unit in NeoFS. Object package defines structure of the From 18b698d4292ef7e91611896ffd845196f85aa5f5 Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 19:03:46 +0300 Subject: [PATCH 020/440] container: Replace `AccessGroup` with `BasicACL` With new ACL conception, access control lists in NeoFS defined as a required basic ACL and optional extended ACL. Basic ACL must be set up in container structure. It is a bit mask stored in 32-bit unsigned integer. Seven nibbles represent seven object operations: get, put, head, search, delete, range, range-hash. Every nibble defines access rules for three targets: user, owner, others and has permission bit for bearer token. There is a permission bit for extended ACL and three unused bits. --- container/service.proto | 4 ++-- container/types.proto | 17 +++-------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/container/service.proto b/container/service.proto index bccf924..7df2c66 100644 --- a/container/service.proto +++ b/container/service.proto @@ -42,8 +42,8 @@ message PutRequest { // Rules define storage policy for the object inside the container. netmap.PlacementRule rules = 4 [(gogoproto.nullable) = false]; - // Container ACL. - AccessGroup Group = 5 [(gogoproto.nullable) = false]; + // BasicACL of the container. + uint32 BasicACL = 5; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; diff --git a/container/types.proto b/container/types.proto index a0d035d..dc79bd3 100644 --- a/container/types.proto +++ b/container/types.proto @@ -18,18 +18,7 @@ message Container { uint64 Capacity = 3; // Rules define storage policy for the object inside the container. netmap.PlacementRule Rules = 4 [(gogoproto.nullable) = false]; - // Container ACL. - AccessControlList List = 5 [(gogoproto.nullable) = false]; -} - -message AccessGroup { - // Group access mode. - uint32 AccessMode = 1; - // Group members. - repeated bytes UserGroup = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; -} - -message AccessControlList { - // List of access groups. - repeated AccessGroup List = 1 [(gogoproto.nullable) = false]; + // BasicACL with access control rules for owner, system, others and + // permission bits for bearer token and extended ACL. + uint32 BasicACL = 5; } From 2803a0788dee85ad90aebc4c3b5c51337c5fc43d Mon Sep 17 00:00:00 2001 From: alexvanin Date: Wed, 1 Apr 2020 19:05:30 +0300 Subject: [PATCH 021/440] docs: Update container docs with BasicACL field --- proto-docs/container.md | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/proto-docs/container.md b/proto-docs/container.md index 6693980..f0188ca 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -21,8 +21,6 @@ - [container/types.proto](#container/types.proto) - Messages - - [AccessControlList](#container.AccessControlList) - - [AccessGroup](#container.AccessGroup) - [Container](#container.Container) @@ -166,7 +164,7 @@ via consensus in inner ring nodes | Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| Group | [AccessGroup](#container.AccessGroup) | | Container ACL. | +| BasicACL | [uint32](#uint32) | | BasicACL of the container. | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -196,29 +194,6 @@ via consensus in inner ring nodes - - -### Message AccessControlList - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| List | [AccessGroup](#container.AccessGroup) | repeated | List of access groups. | - - - - -### Message AccessGroup - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| AccessMode | [uint32](#uint32) | | Group access mode. | -| UserGroup | [bytes](#bytes) | repeated | Group members. | - - ### Message Container @@ -231,7 +206,7 @@ The Container service definition. | Salt | [bytes](#bytes) | | Salt is a nonce for unique container id calculation. | | Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | | Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| List | [AccessControlList](#container.AccessControlList) | | Container ACL. | +| BasicACL | [uint32](#uint32) | | BasicACL with access control rules for owner, system, others and permission bits for bearer token and extended ACL. | From 71ea2fccd18719872d8f7056699c816659a28829 Mon Sep 17 00:00:00 2001 From: alexvanin Date: Thu, 2 Apr 2020 14:21:07 +0300 Subject: [PATCH 022/440] docs: Add changelog file --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..80ea98b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog + +## [0.6.0] - 2020-04-02 + +### Added + +- ACL package with enum of ACL targets. + +### Changed + +- Use `BasicACL` field in container structure and `container.Put` request. + +## [0.5.0] - 2020-04-01 + +- Initial release + +[0.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.5.0...v0.6.0 +[0.5.0]: https://github.com/nspcc-dev/neofs-api/releases/tag/v0.5.0 From 81ba455cd290417238f43c77b249b1484b267896 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 9 Apr 2020 19:14:21 +0300 Subject: [PATCH 023/440] Create LICENSE --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 859cebf87add27adc2b03cb4f2b5888ec51f62e6 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 9 Apr 2020 19:15:44 +0300 Subject: [PATCH 024/440] remove old license --- LICENSE.md | 675 ----------------------------------------------------- 1 file changed, 675 deletions(-) delete mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 5c13ba2..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,675 +0,0 @@ -### GNU GENERAL PUBLIC LICENSE - -Version 3, 29 June 2007 - -Copyright (C) 2007 Free Software Foundation, Inc. - - -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. - -### Preamble - -The GNU General Public License is a free, copyleft license for -software and other kinds of works. - -The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom -to share and change all versions of a program--to make sure it remains -free software for all its users. We, the Free Software Foundation, use -the GNU General Public License for most of our software; it applies -also to any other work released this way by its authors. You can apply -it to your programs, too. - -When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - -To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you -have certain responsibilities if you distribute copies of the -software, or if you modify it: responsibilities to respect the freedom -of others. - -For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - -Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - -For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - -Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the -manufacturer can do so. This is fundamentally incompatible with the -aim of protecting users' freedom to change the software. The -systematic pattern of such abuse occurs in the area of products for -individuals to use, which is precisely where it is most unacceptable. -Therefore, we have designed this version of the GPL to prohibit the -practice for those products. If such problems arise substantially in -other domains, we stand ready to extend this provision to those -domains in future versions of the GPL, as needed to protect the -freedom of users. - -Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish -to avoid the special danger that patents applied to a free program -could make it effectively proprietary. To prevent this, the GPL -assures that patents cannot be used to render the program non-free. - -The precise terms and conditions for copying, distribution and -modification follow. - -### TERMS AND CONDITIONS - -#### 0. Definitions. - -"This License" refers to version 3 of the GNU General Public License. - -"Copyright" also means copyright-like laws that apply to other kinds -of works, such as semiconductor masks. - -"The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - -To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of -an exact copy. The resulting work is called a "modified version" of -the earlier work or a work "based on" the earlier work. - -A "covered work" means either the unmodified Program or a work based -on the Program. - -To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - -To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user -through a computer network, with no transfer of a copy, is not -conveying. - -An interactive user interface displays "Appropriate Legal Notices" to -the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - -#### 1. Source Code. - -The "source code" for a work means the preferred form of the work for -making modifications to it. "Object code" means any non-source form of -a work. - -A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - -The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - -The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - -The Corresponding Source need not include anything that users can -regenerate automatically from other parts of the Corresponding Source. - -The Corresponding Source for a work in source code form is that same -work. - -#### 2. Basic Permissions. - -All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - -You may make, run and propagate covered works that you do not convey, -without conditions so long as your license otherwise remains in force. -You may convey covered works to others for the sole purpose of having -them make modifications exclusively for you, or provide you with -facilities for running those works, provided that you comply with the -terms of this License in conveying all material for which you do not -control copyright. Those thus making or running the covered works for -you must do so exclusively on your behalf, under your direction and -control, on terms that prohibit them from making any copies of your -copyrighted material outside their relationship with you. - -Conveying under any other circumstances is permitted solely under the -conditions stated below. Sublicensing is not allowed; section 10 makes -it unnecessary. - -#### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - -No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - -When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such -circumvention is effected by exercising rights under this License with -respect to the covered work, and you disclaim any intention to limit -operation or modification of the work as a means of enforcing, against -the work's users, your or third parties' legal rights to forbid -circumvention of technological measures. - -#### 4. Conveying Verbatim Copies. - -You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - -You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - -#### 5. Conveying Modified Source Versions. - -You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these -conditions: - -- a) The work must carry prominent notices stating that you modified -it, and giving a relevant date. -- b) The work must carry prominent notices stating that it is -released under this License and any conditions added under -section 7. This requirement modifies the requirement in section 4 -to "keep intact all notices". -- c) You must license the entire work, as a whole, under this -License to anyone who comes into possession of a copy. This -License will therefore apply, along with any applicable section 7 -additional terms, to the whole of the work, and all its parts, -regardless of how they are packaged. This License gives no -permission to license the work in any other way, but it does not -invalidate such permission if you have separately received it. -- d) If the work has interactive user interfaces, each must display -Appropriate Legal Notices; however, if the Program has interactive -interfaces that do not display Appropriate Legal Notices, your -work need not make them do so. - -A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - -#### 6. Conveying Non-Source Forms. - -You may convey a covered work in object code form under the terms of -sections 4 and 5, provided that you also convey the machine-readable -Corresponding Source under the terms of this License, in one of these -ways: - -- a) Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by the -Corresponding Source fixed on a durable physical medium -customarily used for software interchange. -- b) Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by a -written offer, valid for at least three years and valid for as -long as you offer spare parts or customer support for that product -model, to give anyone who possesses the object code either (1) a -copy of the Corresponding Source for all the software in the -product that is covered by this License, on a durable physical -medium customarily used for software interchange, for a price no -more than your reasonable cost of physically performing this -conveying of source, or (2) access to copy the Corresponding -Source from a network server at no charge. -- c) Convey individual copies of the object code with a copy of the -written offer to provide the Corresponding Source. This -alternative is allowed only occasionally and noncommercially, and -only if you received the object code with such an offer, in accord -with subsection 6b. -- d) Convey the object code by offering access from a designated -place (gratis or for a charge), and offer equivalent access to the -Corresponding Source in the same way through the same place at no -further charge. You need not require recipients to copy the -Corresponding Source along with the object code. If the place to -copy the object code is a network server, the Corresponding Source -may be on a different server (operated by you or a third party) -that supports equivalent copying facilities, provided you maintain -clear directions next to the object code saying where to find the -Corresponding Source. Regardless of what server hosts the -Corresponding Source, you remain obligated to ensure that it is -available for as long as needed to satisfy these requirements. -- e) Convey the object code using peer-to-peer transmission, -provided you inform other peers where the object code and -Corresponding Source of the work are being offered to the general -public at no charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - -A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, -family, or household purposes, or (2) anything designed or sold for -incorporation into a dwelling. In determining whether a product is a -consumer product, doubtful cases shall be resolved in favor of -coverage. For a particular product received by a particular user, -"normally used" refers to a typical or common use of that class of -product, regardless of the status of the particular user or of the way -in which the particular user actually uses, or expects or is expected -to use, the product. A product is a consumer product regardless of -whether the product has substantial commercial, industrial or -non-consumer uses, unless such uses represent the only significant -mode of use of the product. - -"Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to -install and execute modified versions of a covered work in that User -Product from a modified version of its Corresponding Source. The -information must suffice to ensure that the continued functioning of -the modified object code is in no case prevented or interfered with -solely because modification has been made. - -If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - -The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or -updates for a work that has been modified or installed by the -recipient, or for the User Product in which it has been modified or -installed. Access to a network may be denied when the modification -itself materially and adversely affects the operation of the network -or violates the rules and protocols for communication across the -network. - -Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - -#### 7. Additional Terms. - -"Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - -When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - -Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders -of that material) supplement the terms of this License with terms: - -- a) Disclaiming warranty or limiting liability differently from the -terms of sections 15 and 16 of this License; or -- b) Requiring preservation of specified reasonable legal notices or -author attributions in that material or in the Appropriate Legal -Notices displayed by works containing it; or -- c) Prohibiting misrepresentation of the origin of that material, -or requiring that modified versions of such material be marked in -reasonable ways as different from the original version; or -- d) Limiting the use for publicity purposes of names of licensors -or authors of the material; or -- e) Declining to grant rights under trademark law for use of some -trade names, trademarks, or service marks; or -- f) Requiring indemnification of licensors and authors of that -material by anyone who conveys the material (or modified versions -of it) with contractual assumptions of liability to the recipient, -for any liability that these contractual assumptions directly -impose on those licensors and authors. - -All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - -If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - -Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; the -above requirements apply either way. - -#### 8. Termination. - -You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - -However, if you cease all violation of this License, then your license -from a particular copyright holder is reinstated (a) provisionally, -unless and until the copyright holder explicitly and finally -terminates your license, and (b) permanently, if the copyright holder -fails to notify you of the violation by some reasonable means prior to -60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - -#### 9. Acceptance Not Required for Having Copies. - -You are not required to accept this License in order to receive or run -a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - -#### 10. Automatic Licensing of Downstream Recipients. - -Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - -An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - -You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - -#### 11. Patents. - -A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - -A contributor's "essential patent claims" are all patent claims owned -or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - -Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - -In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - -If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - -If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - -A patent license is "discriminatory" if it does not include within the -scope of its coverage, prohibits the exercise of, or is conditioned on -the non-exercise of one or more of the rights that are specifically -granted under this License. You may not convey a covered work if you -are a party to an arrangement with a third party that is in the -business of distributing software, under which you make payment to the -third party based on the extent of your activity of conveying the -work, and under which the third party grants, to any of the parties -who would receive the covered work from you, a discriminatory patent -license (a) in connection with copies of the covered work conveyed by -you (or copies made from those copies), or (b) primarily for and in -connection with specific products or compilations that contain the -covered work, unless you entered into that arrangement, or that patent -license was granted, prior to 28 March 2007. - -Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - -#### 12. No Surrender of Others' Freedom. - -If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under -this License and any other pertinent obligations, then as a -consequence you may not convey it at all. For example, if you agree to -terms that obligate you to collect a royalty for further conveying -from those to whom you convey the Program, the only way you could -satisfy both those terms and this License would be to refrain entirely -from conveying the Program. - -#### 13. Use with the GNU Affero General Public License. - -Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - -#### 14. Revised Versions of this License. - -The Free Software Foundation may publish revised and/or new versions -of the GNU General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in -detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies that a certain numbered version of the GNU General Public -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that numbered version or -of any later version published by the Free Software Foundation. If the -Program does not specify a version number of the GNU General Public -License, you may choose any version ever published by the Free -Software Foundation. - -If the Program specifies that a proxy can decide which future versions -of the GNU General Public License can be used, that proxy's public -statement of acceptance of a version permanently authorizes you to -choose that version for the Program. - -Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - -#### 15. Disclaimer of Warranty. - -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT -WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE -DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR -CORRECTION. - -#### 16. Limitation of Liability. - -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR -CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES -ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT -NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR -LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM -TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -#### 17. Interpretation of Sections 15 and 16. - -If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS - -### How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these -terms. - -To do so, attach the following notices to the program. It is safest to -attach them to the start of each source file to most effectively state -the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - -Copyright (C) - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Also add information on how to contact you by electronic and paper -mail. - -If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) -This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands \`show w' and \`show c' should show the -appropriate parts of the General Public License. Of course, your -program's commands might be different; for a GUI interface, you would -use an "about box". - -You should also get your employer (if you work as a programmer) or -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. For more information on this, and how to apply and follow -the GNU GPL, see . - -The GNU General Public License does not permit incorporating your -program into proprietary programs. If your program is a subroutine -library, you may consider it more useful to permit linking proprietary -applications with the library. If this is what you want to do, use the -GNU Lesser General Public License instead of this License. But first, -please read . \ No newline at end of file From 25b5c151c7d3286e557bde9d1123252279cbbf0b Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Fri, 10 Apr 2020 09:25:00 +0300 Subject: [PATCH 025/440] update license in readme --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fe31231..d8d0c3d 100644 --- a/README.md +++ b/README.md @@ -108,5 +108,6 @@ This meta data stored as a header in the NeoFS object. ## License -This project is licensed under the GPLv3 License - -see the [LICENSE.md](LICENSE.md) file for details +This project is licensed under the Apache 2.0 License - +see the [LICENSE](LICENSE) file for details + From e0f31302b57f60061e8e6f1d97e368e3293f9e12 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 15 Apr 2020 12:24:21 +0300 Subject: [PATCH 026/440] add bootstrap.Request.State and enum --- bootstrap/service.proto | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bootstrap/service.proto b/bootstrap/service.proto index e37c878..6918bef 100644 --- a/bootstrap/service.proto +++ b/bootstrap/service.proto @@ -19,10 +19,22 @@ service Bootstrap { } message Request { + // Node state + enum State { + // used by default + Unknown = 0; + // used to inform that node online + Online = 1; + // used to inform that node offline + Offline = 2; + } + // Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) int32 type = 1 [(gogoproto.customname) = "Type" , (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeType"]; // Info contains information about node bootstrap.NodeInfo info = 2 [(gogoproto.nullable) = false]; + // State contains node status + State state = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) From 15de641fb10a48db1d43d03684e5b2ae3f685261 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 15 Apr 2020 12:24:40 +0300 Subject: [PATCH 027/440] regenerate docs --- proto-docs/bootstrap.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 737e085..80aa109 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -62,11 +62,25 @@ Process is method that allows to register node in the network and receive actual | ----- | ---- | ----- | ----------- | | type | [int32](#int32) | | Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) | | info | [NodeInfo](#bootstrap.NodeInfo) | | Info contains information about node | +| state | [Request.State](#bootstrap.Request.State) | | State contains node status | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + +### Request.State +Node state + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | used by default | +| Online | 1 | used to inform that node online | +| Offline | 2 | used to inform that node offline | + + From 4c4e3340d6c6999be8fe4aa3a73d8fb75fd03cca Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Wed, 15 Apr 2020 14:37:31 +0300 Subject: [PATCH 028/440] CHANGELOG --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ea98b..786b646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.6.1] - 2020-04-15 + +### Added + +- State field into Bootstrap request. +- Request.State enum: Unknown, Online, Offline. + ## [0.6.0] - 2020-04-02 ### Added @@ -14,5 +21,6 @@ - Initial release -[0.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/nspcc-dev/neofs-api/releases/tag/v0.5.0 +[0.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.5.0...v0.6.0 +[0.6.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.0...v0.6.1 From 17e7c3ae308186b141b35447371209b6d44eef4f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 15 Apr 2020 18:26:03 +0300 Subject: [PATCH 029/440] add PutRequest.PutHeader.CopiesNumber uint32 field --- object/service.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/object/service.proto b/object/service.proto index 2aa21fd..b5042e2 100644 --- a/object/service.proto +++ b/object/service.proto @@ -84,6 +84,8 @@ message PutRequest { Object Object = 1; // Token with session public key and user's signature session.Token Token = 2; + // Number of the object copies to store within the RPC call (zero is processed according to the placement rules) + uint32 CopiesNumber = 3; } oneof R { From 846a84cd0cca23d122c66ad9881b4bcc0d3b78f6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 15 Apr 2020 18:27:46 +0300 Subject: [PATCH 030/440] regenerate docs --- proto-docs/object.md | 1 + 1 file changed, 1 insertion(+) diff --git a/proto-docs/object.md b/proto-docs/object.md index ce9252b..4a1b2da 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -297,6 +297,7 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | | Token | [session.Token](#session.Token) | | Token with session public key and user's signature | +| CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within RPC call (zero is processed according to the placement rules) | From 1d7c767759520e2ef9dcbcc1d37b047667413079 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 16 Apr 2020 16:57:58 +0300 Subject: [PATCH 031/440] update changelog for v0.7.0 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 786b646..c45841d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.7.0] - 2020-04-16 + +### Added + +- Numerical field CopiesNumber into object.PutRequest.PutHeader message. + ## [0.6.1] - 2020-04-15 ### Added @@ -24,3 +30,4 @@ [0.5.0]: https://github.com/nspcc-dev/neofs-api/releases/tag/v0.5.0 [0.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.5.0...v0.6.0 [0.6.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.0...v0.6.1 +[0.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.1...v0.7.0 From ad46d413138bac1bc14438f9adaa533bbbc3e02a Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 20 Apr 2020 12:03:55 +0300 Subject: [PATCH 032/440] make: change deps output --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index abecfe3..6e78b17 100644 --- a/Makefile +++ b/Makefile @@ -7,21 +7,21 @@ GOGOPROTO_URL=https://github.com/gogo/protobuf/archive/$(GOGOPROTO_VERSION).tar. .PHONY: deps docgen deps: - @echo "=> Prepare" + @echo "⇒ Prepare" @rm -rf ./vendor/github.com/gogo/protobuf @rm -rf ./vendor/github.com/nspcc-dev/netmap @mkdir -p ./vendor/github.com/gogo/protobuf @mkdir -p ./vendor/github.com/nspcc-dev/netmap - @echo "=> Download" + @echo "⇒ Download" @curl -sL -o ./vendor/gogo.tar.gz $(GOGOPROTO_URL) @curl -sL -o ./vendor/netmap.tar.gz $(NETMAP_URL) - @echo "=> Vendoring" + @echo "⇒ Vendoring" @tar -xzf ./vendor/gogo.tar.gz --strip-components 1 -C ./vendor/github.com/gogo/protobuf @tar -xzf ./vendor/netmap.tar.gz --strip-components 1 -C ./vendor/github.com/nspcc-dev/netmap - @echo "=> Cleanup" + @echo "⇒ Cleanup" @rm ./vendor/gogo.tar.gz @rm ./vendor/netmap.tar.gz From 096e7211b4cfad1944836fcfc7a357d1ee9069ef Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 20 Apr 2020 12:04:20 +0300 Subject: [PATCH 033/440] proto: add method to change current node state --- state/service.proto | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/state/service.proto b/state/service.proto index bebc913..410a000 100644 --- a/state/service.proto +++ b/state/service.proto @@ -10,7 +10,8 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; -// Status service provides node's healthcheck and status info +// Status service provides node's healthcheck and status info. +// TODO: decide how to describe auth and were contains permissions. service Status { // Netmap request allows to receive current [bootstrap.SpreadMap](bootstrap.md#bootstrap.SpreadMap) rpc Netmap(NetmapRequest) returns (bootstrap.SpreadMap); @@ -27,6 +28,10 @@ service Status { // To permit access, used server config options. // The request should be signed. rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); + // ChangeState allows to change current node state of node. + // To permit access, used server config options. + // The request should be signed. + rpc ChangeState(ChangeStateRequest) returns (ChangeStateResponse); } // NetmapRequest message to request current node netmap @@ -95,3 +100,25 @@ message DumpVarsRequest { message DumpVarsResponse { bytes Variables = 1; } + +// ChangeStateRequest contains a new state of node. +message ChangeStateRequest { + enum State { + // Unknown is default value. Does nothing. + Unknown = 0; + // Online used when need to set node to the online state. + Online = 1; + // Offline used when need to set node to the offline state. + Offline = 2; + } + + // State is a new state of node. + State state = 1; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +// ChangeStateResponse is an empty response, that returns when RPC invoked without errors. +message ChangeStateResponse {} \ No newline at end of file From c9edac72b401d367b70f0a61216adc64a5d8ec51 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 20 Apr 2020 12:04:39 +0300 Subject: [PATCH 034/440] docs: regenerate files --- proto-docs/object.md | 2 +- proto-docs/state.md | 48 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/proto-docs/object.md b/proto-docs/object.md index 4a1b2da..4ec32fc 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -297,7 +297,7 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | | Token | [session.Token](#session.Token) | | Token with session public key and user's signature | -| CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within RPC call (zero is processed according to the placement rules) | +| CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within the RPC call (zero is processed according to the placement rules) | diff --git a/proto-docs/state.md b/proto-docs/state.md index 2b3de4a..3b7b89d 100644 --- a/proto-docs/state.md +++ b/proto-docs/state.md @@ -8,6 +8,8 @@ - [Status](#state.Status) - Messages + - [ChangeStateRequest](#state.ChangeStateRequest) + - [ChangeStateResponse](#state.ChangeStateResponse) - [DumpRequest](#state.DumpRequest) - [DumpResponse](#state.DumpResponse) - [DumpVarsRequest](#state.DumpVarsRequest) @@ -34,7 +36,8 @@ ### Service "state.Status" -Status service provides node's healthcheck and status info +Status service provides node's healthcheck and status info. +TODO: decide how to describe auth and were contains permissions. ``` rpc Netmap(NetmapRequest) returns (.bootstrap.SpreadMap); @@ -42,6 +45,7 @@ rpc Metrics(MetricsRequest) returns (MetricsResponse); rpc HealthCheck(HealthRequest) returns (HealthResponse); rpc DumpConfig(DumpRequest) returns (DumpResponse); rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); +rpc ChangeState(ChangeStateRequest) returns (ChangeStateResponse); ``` @@ -85,9 +89,38 @@ The request should be signed. | Name | Input | Output | | ---- | ----- | ------ | | DumpVars | [DumpVarsRequest](#state.DumpVarsRequest) | [DumpVarsResponse](#state.DumpVarsResponse) | +#### Method ChangeState + +ChangeState allows to change current node state of node. +To permit access, used server config options. +The request should be signed. + +| Name | Input | Output | +| ---- | ----- | ------ | +| ChangeState | [ChangeStateRequest](#state.ChangeStateRequest) | [ChangeStateResponse](#state.ChangeStateResponse) | + + +### Message ChangeStateRequest +ChangeStateRequest contains a new state of node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| state | [ChangeStateRequest.State](#state.ChangeStateRequest.State) | | State is a new state of node. | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message ChangeStateResponse +ChangeStateResponse is an empty response, that returns when RPC invoked without errors. + + + ### Message DumpRequest @@ -198,6 +231,19 @@ NetmapRequest message to request current node netmap + + + +### ChangeStateRequest.State + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | Unknown is default value. Does nothing. | +| Online | 1 | Online used when need to set node to the online state. | +| Offline | 2 | Offline used when need to set node to the offline state. | + + From e411a89c52a8ca40eb97033dce43ca2953e4ccb0 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Mon, 20 Apr 2020 13:41:59 +0300 Subject: [PATCH 035/440] CHANGELOG --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c45841d..6c29099 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Changelog +## [0.7.1] - 2020-04-20 + +### Added + +- Method to change current node state. (`state.ChangeState`) + ## [0.7.0] - 2020-04-16 ### Added -- Numerical field CopiesNumber into object.PutRequest.PutHeader message. +- A numerical field CopiesNumber into `object.PutRequest.PutHeader` message. ## [0.6.1] - 2020-04-15 @@ -31,3 +37,4 @@ [0.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.5.0...v0.6.0 [0.6.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.0...v0.6.1 [0.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.1...v0.7.0 +[0.7.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.0...v0.7.1 From a891eff0121106761eb75b6905408786d124dbc7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 23 Apr 2020 13:34:06 +0300 Subject: [PATCH 036/440] service: add Raw field to RequestMetaHeader --- proto-docs/service.md | 1 + service/meta.proto | 2 ++ 2 files changed, 3 insertions(+) diff --git a/proto-docs/service.md b/proto-docs/service.md index 2b6b33e..a690952 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -43,6 +43,7 @@ RequestMetaHeader contains information about request meta headers | TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | +| Raw | [bool](#bool) | | Raw determines whether the request is raw or not | diff --git a/service/meta.proto b/service/meta.proto index 99b37d3..093f118 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -17,6 +17,8 @@ message RequestMetaHeader { // Version defines protocol version // TODO: not used for now, should be implemented in future uint32 Version = 3; + // Raw determines whether the request is raw or not + bool Raw = 4; } // ResponseMetaHeader contains meta information based on request processing by server From b84fab4d24ae1aecfbca079f23ebe6560567244c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 23 Apr 2020 13:44:21 +0300 Subject: [PATCH 037/440] service: change RequestVerificationHeader message This commit: * removes RequestVerificationHeader.Signature message; * renames RequestVerificationHeader.Sign message to Signature. --- proto-docs/service.md | 17 ++--------------- service/verify.proto | 11 +---------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index a690952..1d98503 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -14,7 +14,6 @@ - Messages - [RequestVerificationHeader](#service.RequestVerificationHeader) - - [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) @@ -85,18 +84,6 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | - - -### Message RequestVerificationHeader.Sign - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | -| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | - - ### Message RequestVerificationHeader.Signature @@ -105,8 +92,8 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Sign | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Sign is a signature and public key of the request. | -| Origin | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Origin used for requests, when trusted node changes it and re-sign with session key. If session key used for signature request, then Origin should contain public key of user and signed session key. | +| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | +| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | diff --git a/service/verify.proto b/service/verify.proto index de0a69a..37a3c86 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -10,22 +10,13 @@ option (gogoproto.stable_marshaler_all) = true; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request // (should be embedded into message). message RequestVerificationHeader { - message Sign { + message Signature { // Sign is signature of the request or session key. bytes Sign = 1; // Peer is compressed public key used for signature. bytes Peer = 2; } - message Signature { - // Sign is a signature and public key of the request. - Sign Sign = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // Origin used for requests, when trusted node changes it and re-sign with session key. - // If session key used for signature request, then Origin should contain - // public key of user and signed session key. - Sign Origin = 2; - } - // Signatures is a set of signatures of every passed NeoFS Node repeated Signature Signatures = 1; } From 6b6894064390bec887b2d1fb93a3d45e39f53c15 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 24 Apr 2020 19:18:28 +0300 Subject: [PATCH 038/440] token: update structure This commit: * moves Token message to service package; * updates token structure (new verb field, some renaming); * replaces VerificationHeader header with Token in object package; * removes no longer used VerificationHeader message. --- object/service.proto | 5 ++-- object/types.proto | 6 ++--- proto-docs/object.md | 6 ++--- proto-docs/service.md | 49 ++++++++++++++++++++++++++++++++++ proto-docs/session.md | 59 +++------------------------------------- service/verify.proto | 62 +++++++++++++++++++++++++++++++++++++++++++ session/service.proto | 9 +++---- session/types.proto | 35 ------------------------ 8 files changed, 127 insertions(+), 104 deletions(-) delete mode 100644 session/types.proto diff --git a/object/service.proto b/object/service.proto index b5042e2..1cf9043 100644 --- a/object/service.proto +++ b/object/service.proto @@ -5,7 +5,6 @@ option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "object/types.proto"; -import "session/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -83,7 +82,7 @@ message PutRequest { // Object with at least container id and owner id fields Object Object = 1; // Token with session public key and user's signature - session.Token Token = 2; + service.Token Token = 2; // Number of the object copies to store within the RPC call (zero is processed according to the placement rules) uint32 CopiesNumber = 3; } @@ -113,7 +112,7 @@ message DeleteRequest { // OwnerID is a wallet address bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; // Token with session public key and user's signature - session.Token Token = 3; + service.Token Token = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/object/types.proto b/object/types.proto index f21bf74..21ab981 100644 --- a/object/types.proto +++ b/object/types.proto @@ -4,7 +4,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; -import "session/types.proto"; +import "service/verify.proto"; import "storagegroup/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -36,8 +36,8 @@ message Header { Transform Transform = 4; // Tombstone header that set up in deleted objects Tombstone Tombstone = 5; - // Verify header that contains session public key and user's signature - session.VerificationHeader Verify = 6; + // Token header contains token of the session within which the object was created + service.Token Token = 6; // HomoHash is a homomorphic hash of original object payload bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"]; // PayloadChecksum of actual object's payload diff --git a/proto-docs/object.md b/proto-docs/object.md index 4ec32fc..7e6069b 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -149,7 +149,7 @@ calculated for XORed data. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | +| Token | [service.Token](#service.Token) | | Token with session public key and user's signature | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -296,7 +296,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | -| Token | [session.Token](#session.Token) | | Token with session public key and user's signature | +| Token | [service.Token](#service.Token) | | Token with session public key and user's signature | | CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within the RPC call (zero is processed according to the placement rules) | @@ -378,7 +378,7 @@ in distributed system. | UserHeader | [UserHeader](#object.UserHeader) | | UserHeader is a set of KV headers defined by user | | Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | -| Verify | [session.VerificationHeader](#session.VerificationHeader) | | Verify header that contains session public key and user's signature | +| Token | [service.Token](#service.Token) | | Token header that contains session token | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | diff --git a/proto-docs/service.md b/proto-docs/service.md index 1d98503..6af3468 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -15,6 +15,8 @@ - Messages - [RequestVerificationHeader](#service.RequestVerificationHeader) - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) + - [Token](#service.Token) + - [Token.Info](#service.Token.Info) - [Scalar Value Types](#scalar-value-types) @@ -82,6 +84,7 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | +| Token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | @@ -95,8 +98,54 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | | Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | + + + +### Message Token +User token granting rights for object manipulation + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| info | [Token.Info](#service.Token.Info) | | Info is a grouped information about token | +| Signature | [bytes](#bytes) | | Signature is a signature of session token information | + + + + +### Message Token.Info + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | +| verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | +| Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | +| Created | [uint64](#uint64) | | Created is an initial epoch of token lifetime | +| ValidUntil | [uint64](#uint64) | | ValidUntil is a last epoch of token lifetime | +| SessionKey | [bytes](#bytes) | | SessionKey is a public key of session key | + + + + +### Token.Info.Verb +Verb is an enumeration of session request types + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Put | 0 | Put refers to object.Put RPC call | +| Get | 1 | Get refers to object.Get RPC call | +| Head | 2 | Head refers to object.Head RPC call | +| Search | 3 | Search refers to object.Search RPC call | +| Delete | 4 | Delete refers to object.Delete RPC call | +| Range | 5 | Range refers to object.GetRange RPC call | +| RangeHash | 6 | RangeHash refers to object.GetRangeHash RPC call | + + diff --git a/proto-docs/session.md b/proto-docs/session.md index ba615c3..4a537e6 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -12,13 +12,6 @@ - [CreateResponse](#session.CreateResponse) -- [session/types.proto](#session/types.proto) - - - Messages - - [Token](#session.Token) - - [VerificationHeader](#session.VerificationHeader) - - - [Scalar Value Types](#scalar-value-types) @@ -68,8 +61,8 @@ session key. Session is established during 4-step handshake in one gRPC stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Init | [Token](#session.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | -| Signed | [Token](#session.Token) | | Signed Init message response (Unsigned) from server with user private key | +| Init | [service.Token](#service.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | +| Signed | [service.Token](#service.Token) | | Signed Init message response (Unsigned) from server with user private key | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -82,52 +75,8 @@ session key. Session is established during 4-step handshake in one gRPC stream | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Unsigned | [Token](#session.Token) | | Unsigned token with token ID and session public key generated on server side | -| Result | [Token](#session.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | - - - - - - - - -

Top

- -## session/types.proto - - - - - - - -### Message Token -User token granting rights for object manipulation - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Header | [VerificationHeader](#session.VerificationHeader) | | Header carries verification data of session key | -| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | -| FirstEpoch | [uint64](#uint64) | | FirstEpoch is an initial epoch of token lifetime | -| LastEpoch | [uint64](#uint64) | | LastEpoch is a last epoch of token lifetime | -| ObjectID | [bytes](#bytes) | repeated | ObjectID is an object identifier of manipulation object | -| Signature | [bytes](#bytes) | | Signature is a token signature, signed by owner of manipulation object | -| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| PublicKeys | [bytes](#bytes) | repeated | PublicKeys associated with owner | - - - - -### Message VerificationHeader - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| PublicKey | [bytes](#bytes) | | PublicKey is a session public key | -| KeySignature | [bytes](#bytes) | | KeySignature is a session public key signature. Signed by trusted side | +| Unsigned | [service.Token](#service.Token) | | Unsigned token with token ID and session public key generated on server side | +| Result | [service.Token](#service.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | diff --git a/service/verify.proto b/service/verify.proto index 37a3c86..97cc7fa 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -3,6 +3,7 @@ package service; option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; +import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -19,4 +20,65 @@ message RequestVerificationHeader { // Signatures is a set of signatures of every passed NeoFS Node repeated Signature Signatures = 1; + + // Token is a token of the session within which the request is sent + Token Token = 2; } + +// User token granting rights for object manipulation +message Token { + message Info { + // ID is a token identifier. valid UUIDv4 represented in bytes + bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; + + // OwnerID is an owner of manipulation object + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + + // Verb is an enumeration of session request types + enum Verb { + // Put refers to object.Put RPC call + Put = 0; + // Get refers to object.Get RPC call + Get = 1; + // Head refers to object.Head RPC call + Head = 2; + // Search refers to object.Search RPC call + Search = 3; + // Delete refers to object.Delete RPC call + Delete = 4; + // Range refers to object.GetRange RPC call + Range = 5; + // RangeHash refers to object.GetRangeHash RPC call + RangeHash = 6; + } + + // Verb is a type of request for which the token is issued + Verb verb = 3 [(gogoproto.customname) = "Verb"]; + + // Address is an object address for which token is issued + refs.Address Address = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; + + // Created is an initial epoch of token lifetime + uint64 Created = 5; + + // ValidUntil is a last epoch of token lifetime + uint64 ValidUntil = 6; + + // SessionKey is a public key of session key + bytes SessionKey = 7; + } + + // Info is a grouped information about token + Info info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.customname) = "Info"]; + + // Signature is a signature of session token information + bytes Signature = 8; +} + +// TODO: for variable token types and version redefine message +// Example: +// message Token { +// TokenType TokenType = 1; +// uint32 Version = 2; +// bytes Data = 3; +// } diff --git a/session/service.proto b/session/service.proto index 524213a..5c22fc3 100644 --- a/session/service.proto +++ b/session/service.proto @@ -3,7 +3,6 @@ package session; option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; -import "session/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -33,9 +32,9 @@ message CreateRequest { // owner of manipulation object; // ID of manipulation object; // token lifetime bounds. - session.Token Init = 1; + service.Token Init = 1; // Signed Init message response (Unsigned) from server with user private key - session.Token Signed = 2; + service.Token Signed = 2; } // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; @@ -46,8 +45,8 @@ message CreateRequest { message CreateResponse { oneof Message { // Unsigned token with token ID and session public key generated on server side - session.Token Unsigned = 1; + service.Token Unsigned = 1; // Result is a resulting token which can be used for object placing through an trusted intermediary - session.Token Result = 2; + service.Token Result = 2; } } diff --git a/session/types.proto b/session/types.proto deleted file mode 100644 index 3ae49a3..0000000 --- a/session/types.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; -package session; -option go_package = "github.com/nspcc-dev/neofs-api-go/session"; -option csharp_namespace = "NeoFS.API.Session"; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -message VerificationHeader { - // PublicKey is a session public key - bytes PublicKey = 1; - // KeySignature is a session public key signature. Signed by trusted side - bytes KeySignature = 2; -} - -// User token granting rights for object manipulation -message Token { - // Header carries verification data of session key - VerificationHeader Header = 1 [(gogoproto.nullable) = false]; - // OwnerID is an owner of manipulation object - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // FirstEpoch is an initial epoch of token lifetime - uint64 FirstEpoch = 3; - // LastEpoch is a last epoch of token lifetime - uint64 LastEpoch = 4; - // ObjectID is an object identifier of manipulation object - repeated bytes ObjectID = 5 [(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false]; - // Signature is a token signature, signed by owner of manipulation object - bytes Signature = 6; - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes ID = 7 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; - // PublicKeys associated with owner - repeated bytes PublicKeys = 8; -} From da3cb02936d1cd8b11e46da091757a6702245fa1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 24 Apr 2020 19:23:20 +0300 Subject: [PATCH 039/440] object: remove redundant Raw field from GetRequest and HeadRequest --- object/service.proto | 4 ---- proto-docs/object.md | 2 -- 2 files changed, 6 deletions(-) diff --git a/object/service.proto b/object/service.proto index 1cf9043..2b4e932 100644 --- a/object/service.proto +++ b/object/service.proto @@ -57,8 +57,6 @@ service Service { message GetRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; - // Raw is the request flag of a physically stored representation of an object - bool Raw = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -131,8 +129,6 @@ message HeadRequest { refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; // FullHeaders can be set true for extended headers in the object bool FullHeaders = 2; - // Raw is the request flag of a physically stored representation of an object - bool Raw = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index 7e6069b..842f008 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -228,7 +228,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -256,7 +255,6 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | -| Raw | [bool](#bool) | | Raw is the request flag of a physically stored representation of an object | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | From 360d3ae2cefb3ec9ade82886525d265981c14241 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 27 Apr 2020 13:14:31 +0300 Subject: [PATCH 040/440] docs: regenerate --- proto-docs/object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-docs/object.md b/proto-docs/object.md index 842f008..3f0a7cd 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -376,7 +376,7 @@ in distributed system. | UserHeader | [UserHeader](#object.UserHeader) | | UserHeader is a set of KV headers defined by user | | Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | -| Token | [service.Token](#service.Token) | | Token header that contains session token | +| Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | From 738d52121471a81abeded78148f9728fc4474c96 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 27 Apr 2020 13:17:16 +0300 Subject: [PATCH 041/440] object: remove Token field from PutRequest.PutHeader and DeleteRequest Session token is presented in RequestVerificationHeader, therefore its presence in request bodies is redundant. --- object/service.proto | 6 +----- proto-docs/object.md | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/object/service.proto b/object/service.proto index 2b4e932..91d0b99 100644 --- a/object/service.proto +++ b/object/service.proto @@ -79,10 +79,8 @@ message PutRequest { message PutHeader { // Object with at least container id and owner id fields Object Object = 1; - // Token with session public key and user's signature - service.Token Token = 2; // Number of the object copies to store within the RPC call (zero is processed according to the placement rules) - uint32 CopiesNumber = 3; + uint32 CopiesNumber = 2; } oneof R { @@ -109,8 +107,6 @@ message DeleteRequest { refs.Address Address = 1 [(gogoproto.nullable) = false]; // OwnerID is a wallet address bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; - // Token with session public key and user's signature - service.Token Token = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index 3f0a7cd..27e4bcf 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -149,7 +149,6 @@ calculated for XORed data. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Token | [service.Token](#service.Token) | | Token with session public key and user's signature | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -294,7 +293,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | -| Token | [service.Token](#service.Token) | | Token with session public key and user's signature | | CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within the RPC call (zero is processed according to the placement rules) | From 1de0d29a74a2ca201e9d5bbbca194042fe0bab91 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 27 Apr 2020 18:44:13 +0300 Subject: [PATCH 042/440] service: remove gogoproto customname from embedded Token.Info field This commit: * removes gogoproto customname option from embedded Token.Info field; * renames Info field of Token message to TokenInfo. --- proto-docs/service.md | 2 +- service/verify.proto | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 6af3468..bf1bc1a 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -107,7 +107,7 @@ User token granting rights for object manipulation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| info | [Token.Info](#service.Token.Info) | | Info is a grouped information about token | +| TokenInfo | [Token.Info](#service.Token.Info) | | Info is a grouped information about token | | Signature | [bytes](#bytes) | | Signature is a signature of session token information | diff --git a/service/verify.proto b/service/verify.proto index 97cc7fa..b25cd47 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -68,8 +68,8 @@ message Token { bytes SessionKey = 7; } - // Info is a grouped information about token - Info info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (gogoproto.customname) = "Info"]; + // TokenInfo is a grouped information about token + Info TokenInfo = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // Signature is a signature of session token information bytes Signature = 8; From 17dca3a387fcc9655b925f94f8920733e260e709 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 28 Apr 2020 12:36:09 +0300 Subject: [PATCH 043/440] Update changelog for v0.7.2 --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c29099..2080afc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [0.7.2] - 2020-04-28 + +### Added + +- `Raw` boolean field to `service.RequestMetaHeader`. +- `Token` message field to `service.RequestVerificationHeader`. + +### Replaced + +- `Token` message from `session` to `service` package. +- `Signature` message with `Sign` one in `service` package. + +### Changed + +- `Token` message structure. + +### Removed + +- `Raw` field from `object.GetRequest` and `object.HeadRequest` messages. +- `Token` field from `object.PutRequest.PutHeader` and `object.DeleteRequest` messages. +- `VerificationHeader` message. + ## [0.7.1] - 2020-04-20 ### Added @@ -38,3 +60,4 @@ [0.6.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.0...v0.6.1 [0.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.1...v0.7.0 [0.7.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.0...v0.7.1 +[0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 \ No newline at end of file From 2913edbd4239dcaa6c4096b38c1b1ad5638da420 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 28 Apr 2020 16:15:24 +0300 Subject: [PATCH 044/440] docs: fix service docs --- proto-docs/service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index bf1bc1a..ce24b31 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -107,7 +107,7 @@ User token granting rights for object manipulation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| TokenInfo | [Token.Info](#service.Token.Info) | | Info is a grouped information about token | +| TokenInfo | [Token.Info](#service.Token.Info) | | TokenInfo is a grouped information about token | | Signature | [bytes](#bytes) | | Signature is a signature of session token information | From 2658db895ca692d557c9cd2ce0293cad470f0b89 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 28 Apr 2020 16:16:52 +0300 Subject: [PATCH 045/440] proto: disable stringer method for CreationPoint --- object/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/object/types.proto b/object/types.proto index 21ab981..46e1549 100644 --- a/object/types.proto +++ b/object/types.proto @@ -70,6 +70,8 @@ message SystemHeader { } message CreationPoint { + option (gogoproto.goproto_stringer) = false; + // UnixTime is a date of creation in unixtime format int64 UnixTime = 1; // Epoch is a date of creation in NeoFS epochs From 228c8f8cbd0d39eea52fb4ad6bc4807c7800f7c2 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 28 Apr 2020 16:25:36 +0300 Subject: [PATCH 046/440] CHANGELOG --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2080afc..79f9afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [0.7.3] - 2020-04-28 + +### Changed + +- `CreationPoint` disabled stringer method. + ## [0.7.2] - 2020-04-28 ### Added @@ -60,4 +66,5 @@ [0.6.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.0...v0.6.1 [0.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.1...v0.7.0 [0.7.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.0...v0.7.1 -[0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 \ No newline at end of file +[0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 +[0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 \ No newline at end of file From ea9e39b3e056fa72d63d57ef776f4b976e4ad10d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 7 May 2020 18:42:29 +0300 Subject: [PATCH 047/440] service: put token lifetime in a separate message --- proto-docs/service.md | 16 ++++++++++++++-- service/verify.proto | 18 ++++++++++++------ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index ce24b31..f62ab55 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -17,6 +17,7 @@ - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) - [Token](#service.Token) - [Token.Info](#service.Token.Info) + - [TokenLifetime](#service.TokenLifetime) - [Scalar Value Types](#scalar-value-types) @@ -123,10 +124,21 @@ User token granting rights for object manipulation | OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | | Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | -| Created | [uint64](#uint64) | | Created is an initial epoch of token lifetime | -| ValidUntil | [uint64](#uint64) | | ValidUntil is a last epoch of token lifetime | +| Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | SessionKey | [bytes](#bytes) | | SessionKey is a public key of session key | + + + +### Message TokenLifetime +TokenLifetime carries a group of lifetime parameters of the token + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Created | [uint64](#uint64) | | Created carries an initial epoch of token lifetime | +| ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | + diff --git a/service/verify.proto b/service/verify.proto index b25cd47..ed360be 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -58,14 +58,11 @@ message Token { // Address is an object address for which token is issued refs.Address Address = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; - // Created is an initial epoch of token lifetime - uint64 Created = 5; - - // ValidUntil is a last epoch of token lifetime - uint64 ValidUntil = 6; + // Lifetime is a lifetime of the session + TokenLifetime Lifetime = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // SessionKey is a public key of session key - bytes SessionKey = 7; + bytes SessionKey = 6; } // TokenInfo is a grouped information about token @@ -75,6 +72,15 @@ message Token { bytes Signature = 8; } +// TokenLifetime carries a group of lifetime parameters of the token +message TokenLifetime { + // Created carries an initial epoch of token lifetime + uint64 Created = 1; + + // ValidUntil carries a last epoch of token lifetime + uint64 ValidUntil = 2; +} + // TODO: for variable token types and version redefine message // Example: // message Token { From cbd5605dc905a5c982e2135998bd6729ea91a882 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 7 May 2020 18:44:23 +0300 Subject: [PATCH 048/440] session: change Create rpc signature This commit: * makes Create rpc call to be unary message; * changes CreateRequest structure; * changes CreateResponse structure. --- proto-docs/session.md | 25 ++++++++----------------- session/service.proto | 43 +++++++++++++++---------------------------- 2 files changed, 23 insertions(+), 45 deletions(-) diff --git a/proto-docs/session.md b/proto-docs/session.md index 4a537e6..5ec7402 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -30,22 +30,13 @@ ``` -rpc Create(stream CreateRequest) returns (stream CreateResponse); +rpc Create(CreateRequest) returns (CreateResponse); ``` #### Method Create -Create is a method that used to open a trusted session to manipulate -an object. In order to put or delete object client have to obtain session -token with trusted node. Trusted node will modify client's object -(add missing headers, checksums, homomorphic hash) and sign id with -session key. Session is established during 4-step handshake in one gRPC stream - -- First client stream message SHOULD BE type of `CreateRequest_Init`. -- First server stream message SHOULD BE type of `CreateResponse_Unsigned`. -- Second client stream message SHOULD BE type of `CreateRequest_Signed`. -- Second server stream message SHOULD BE type of `CreateResponse_Result`. +Create opens new session between the client and the server | Name | Input | Output | | ---- | ----- | ------ | @@ -56,13 +47,13 @@ session key. Session is established during 4-step handshake in one gRPC stream ### Message CreateRequest - +CreateRequest carries an information necessary for opening a session | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Init | [service.Token](#service.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | -| Signed | [service.Token](#service.Token) | | Signed Init message response (Unsigned) from server with user private key | +| OwnerID | [bytes](#bytes) | | OwnerID carries an identifier of a session initiator | +| Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Lifetime carries a lifetime of the session | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -70,13 +61,13 @@ session key. Session is established during 4-step handshake in one gRPC stream ### Message CreateResponse - +CreateResponse carries an information about the opened session | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Unsigned | [service.Token](#service.Token) | | Unsigned token with token ID and session public key generated on server side | -| Result | [service.Token](#service.Token) | | Result is a resulting token which can be used for object placing through an trusted intermediary | +| ID | [bytes](#bytes) | | ID carries an identifier of session token | +| SessionKey | [bytes](#bytes) | | SessionKey carries a session public key | diff --git a/session/service.proto b/session/service.proto index 5c22fc3..b7eb0df 100644 --- a/session/service.proto +++ b/session/service.proto @@ -11,42 +11,29 @@ option (gogoproto.stable_marshaler_all) = true; service Session { - // Create is a method that used to open a trusted session to manipulate - // an object. In order to put or delete object client have to obtain session - // token with trusted node. Trusted node will modify client's object - // (add missing headers, checksums, homomorphic hash) and sign id with - // session key. Session is established during 4-step handshake in one gRPC stream - // - // - First client stream message SHOULD BE type of `CreateRequest_Init`. - // - First server stream message SHOULD BE type of `CreateResponse_Unsigned`. - // - Second client stream message SHOULD BE type of `CreateRequest_Signed`. - // - Second server stream message SHOULD BE type of `CreateResponse_Result`. - rpc Create (stream CreateRequest) returns (stream CreateResponse); + // Create opens new session between the client and the server + rpc Create (CreateRequest) returns (CreateResponse); } - +// CreateRequest carries an information necessary for opening a session message CreateRequest { - // Message should be one of - oneof Message { - // Init is a message to initialize session opening. Carry: - // owner of manipulation object; - // ID of manipulation object; - // token lifetime bounds. - service.Token Init = 1; - // Signed Init message response (Unsigned) from server with user private key - service.Token Signed = 2; - } + // OwnerID carries an identifier of a session initiator + bytes OwnerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; + + // Lifetime carries a lifetime of the session + service.TokenLifetime Lifetime = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } +// CreateResponse carries an information about the opened session message CreateResponse { - oneof Message { - // Unsigned token with token ID and session public key generated on server side - service.Token Unsigned = 1; - // Result is a resulting token which can be used for object placing through an trusted intermediary - service.Token Result = 2; - } + // ID carries an identifier of session token + bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; + + // SessionKey carries a session public key + bytes SessionKey = 2; } From 3bb1b0214f849ad7ad34c75a68c6de7c6993b2b8 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 8 May 2020 10:32:35 +0300 Subject: [PATCH 049/440] Update changelog for v0.7.4 --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79f9afa..eb6c276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.7.4] - 2020-05-08 + +### Added + +- `service.TokenLifetime` message. + +### Changed + +- `service.Token` structure. +- `session.Session.Create` RPC signature. +- `session.CreateRequest` structure. +- `session.CreateResponse` structure. + ## [0.7.3] - 2020-04-28 ### Changed @@ -67,4 +80,5 @@ [0.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.6.1...v0.7.0 [0.7.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.0...v0.7.1 [0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 -[0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 \ No newline at end of file +[0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 +[0.7.4]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.3...v0.7.4 \ No newline at end of file From 80e8ab014bebab27ddb0fb88ef3db79359cb810e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 15 May 2020 15:29:15 +0300 Subject: [PATCH 050/440] service: add OwnerKey byte field to TokenInfo message --- proto-docs/service.md | 1 + service/verify.proto | 3 +++ 2 files changed, 4 insertions(+) diff --git a/proto-docs/service.md b/proto-docs/service.md index f62ab55..423599b 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -126,6 +126,7 @@ User token granting rights for object manipulation | Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | | Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | SessionKey | [bytes](#bytes) | | SessionKey is a public key of session key | +| OwnerKey | [bytes](#bytes) | | OwnerKey is a public key of the token owner | diff --git a/service/verify.proto b/service/verify.proto index ed360be..a6619a6 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -63,6 +63,9 @@ message Token { // SessionKey is a public key of session key bytes SessionKey = 6; + + // OwnerKey is a public key of the token owner + bytes OwnerKey = 7; } // TokenInfo is a grouped information about token From 8f9391b995ed90de4b319f5fa5653b37f1e5afed Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 15 May 2020 15:53:21 +0300 Subject: [PATCH 051/440] Update changelog for v0.7.5 --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb6c276..25a4053 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.7.5] - 2020-05-15 + +### Added + +- `OwnerKey` bytes field to `service.Token.TokenInfo` message. + + ## [0.7.4] - 2020-05-08 ### Added @@ -81,4 +88,5 @@ [0.7.1]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.0...v0.7.1 [0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 [0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 -[0.7.4]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.3...v0.7.4 \ No newline at end of file +[0.7.4]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.3...v0.7.4 +[0.7.5]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.4...v0.7.5 \ No newline at end of file From 952358af51fd5663487a9bb50042faa977ec4c44 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Tue, 26 May 2020 12:36:55 +0300 Subject: [PATCH 052/440] Bump mojor release --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25a4053..204489f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [1.0.0] - 2020-05-16 + +Bump major release + ## [0.7.5] - 2020-05-15 ### Added @@ -89,4 +93,5 @@ [0.7.2]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.1...v0.7.2 [0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 [0.7.4]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.3...v0.7.4 -[0.7.5]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.4...v0.7.5 \ No newline at end of file +[0.7.5]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.4...v0.7.5 +[1.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.5...v1.0.0 \ No newline at end of file From 17e07df8d9be2c44bd0897c8ae201aa04cccb370 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 18 Jun 2020 10:40:35 +0300 Subject: [PATCH 053/440] container: add Get/Set extended ACL rpc --- container/service.proto | 45 +++++++++++++++++++++ proto-docs/container.md | 90 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/container/service.proto b/container/service.proto index 7df2c66..b174052 100644 --- a/container/service.proto +++ b/container/service.proto @@ -27,6 +27,12 @@ service Service { // List returns all user's containers rpc List(ListRequest) returns (ListResponse); + + // SetExtendedACL changes extended ACL rules of the container + rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); + + // GetExtendedACL returns extended ACL rules of the container + rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } message PutRequest { @@ -99,3 +105,42 @@ message ListResponse { // CID (container id) is list of SHA256 hashes of the container structures repeated bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; } + +message ExtendedACLKey { + // ID (container id) is a SHA256 hash of the container structure + bytes ID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; +} + +message ExtendedACLValue { + // EACL carries binary representation of the table of extended ACL rules + bytes EACL = 1; + // Signature carries EACL field signature + bytes Signature = 2; +} + +message SetExtendedACLRequest { + // Key carries key to extended ACL information + ExtendedACLKey Key = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // Value carries extended ACL information + ExtendedACLValue Value = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message SetExtendedACLResponse {} + +message GetExtendedACLRequest { + // Key carries key to extended ACL information + ExtendedACLKey Key = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) + service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) + service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} + +message GetExtendedACLResponse { + // ACL carries extended ACL information + ExtendedACLValue ACL = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; +} diff --git a/proto-docs/container.md b/proto-docs/container.md index f0188ca..fd89acd 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -10,12 +10,18 @@ - Messages - [DeleteRequest](#container.DeleteRequest) - [DeleteResponse](#container.DeleteResponse) + - [ExtendedACLKey](#container.ExtendedACLKey) + - [ExtendedACLValue](#container.ExtendedACLValue) + - [GetExtendedACLRequest](#container.GetExtendedACLRequest) + - [GetExtendedACLResponse](#container.GetExtendedACLResponse) - [GetRequest](#container.GetRequest) - [GetResponse](#container.GetResponse) - [ListRequest](#container.ListRequest) - [ListResponse](#container.ListResponse) - [PutRequest](#container.PutRequest) - [PutResponse](#container.PutResponse) + - [SetExtendedACLRequest](#container.SetExtendedACLRequest) + - [SetExtendedACLResponse](#container.SetExtendedACLResponse) - [container/types.proto](#container/types.proto) @@ -46,6 +52,8 @@ rpc Put(PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Get(GetRequest) returns (GetResponse); rpc List(ListRequest) returns (ListResponse); +rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); +rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); ``` @@ -80,6 +88,20 @@ List returns all user's containers | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#container.ListRequest) | [ListResponse](#container.ListResponse) | +#### Method SetExtendedACL + +SetExtendedACL changes extended ACL rules of the container + +| Name | Input | Output | +| ---- | ----- | ------ | +| SetExtendedACL | [SetExtendedACLRequest](#container.SetExtendedACLRequest) | [SetExtendedACLResponse](#container.SetExtendedACLResponse) | +#### Method GetExtendedACL + +GetExtendedACL returns extended ACL rules of the container + +| Name | Input | Output | +| ---- | ----- | ------ | +| GetExtendedACL | [GetExtendedACLRequest](#container.GetExtendedACLRequest) | [GetExtendedACLResponse](#container.GetExtendedACLResponse) | @@ -104,6 +126,53 @@ via consensus in inner ring nodes + + +### Message ExtendedACLKey + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ID | [bytes](#bytes) | | ID (container id) is a SHA256 hash of the container structure | + + + + +### Message ExtendedACLValue + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| EACL | [bytes](#bytes) | | EACL carries binary representation of the table of extended ACL rules | +| Signature | [bytes](#bytes) | | Signature carries EACL field signature | + + + + +### Message GetExtendedACLRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [ExtendedACLKey](#container.ExtendedACLKey) | | Key carries key to extended ACL information | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message GetExtendedACLResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ACL | [ExtendedACLValue](#container.ExtendedACLValue) | | ACL carries extended ACL information | + + ### Message GetRequest @@ -179,6 +248,27 @@ via consensus in inner ring nodes | ----- | ---- | ----- | ----------- | | CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | + + + +### Message SetExtendedACLRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [ExtendedACLKey](#container.ExtendedACLKey) | | Key carries key to extended ACL information | +| Value | [ExtendedACLValue](#container.ExtendedACLValue) | | Value carries extended ACL information | +| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | +| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + + + +### Message SetExtendedACLResponse + + + From 1d3ffeb841b4fe1d1d594e038cc4210cfc877061 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 18 Jun 2020 10:58:11 +0300 Subject: [PATCH 054/440] service: add Bearer token message to RequestVerificationHeader --- proto-docs/service.md | 29 +++++++++++++++++++++++++++++ service/verify.proto | 26 ++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/proto-docs/service.md b/proto-docs/service.md index 423599b..d492ccd 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -13,6 +13,8 @@ - [service/verify.proto](#service/verify.proto) - Messages + - [BearerTokenMsg](#service.BearerTokenMsg) + - [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) - [RequestVerificationHeader](#service.RequestVerificationHeader) - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) - [Token](#service.Token) @@ -75,6 +77,32 @@ ResponseMetaHeader contains meta information based on request processing by serv + + +### Message BearerTokenMsg +BearerTokenMsg carries information about request ACL rules with limited lifetime + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| TokenInfo | [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) | | TokenInfo is a grouped information about token | +| OwnerKey | [bytes](#bytes) | | OwnerKey is a public key of the token owner | +| Signature | [bytes](#bytes) | | Signature is a signature of token information | + + + + +### Message BearerTokenMsg.Info + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ACLRules | [bytes](#bytes) | | ACLRules is an ACL rules represented in bytes | +| OwnerID | [bytes](#bytes) | | OwnerID is an owner of token | +| ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | + + ### Message RequestVerificationHeader @@ -86,6 +114,7 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | ----- | ---- | ----- | ----------- | | Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | | Token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | +| Bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | diff --git a/service/verify.proto b/service/verify.proto index a6619a6..c78a732 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -23,6 +23,9 @@ message RequestVerificationHeader { // Token is a token of the session within which the request is sent Token Token = 2; + + // Bearer is a Bearer token of the request + BearerTokenMsg Bearer = 3; } // User token granting rights for object manipulation @@ -91,3 +94,26 @@ message TokenLifetime { // uint32 Version = 2; // bytes Data = 3; // } + +// BearerTokenMsg carries information about request ACL rules with limited lifetime +message BearerTokenMsg { + message Info { + // ACLRules is an ACL rules represented in bytes + bytes ACLRules = 1; + + // OwnerID is an owner of token + bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + + // ValidUntil carries a last epoch of token lifetime + uint64 ValidUntil = 3; + } + + // TokenInfo is a grouped information about token + Info TokenInfo = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + + // OwnerKey is a public key of the token owner + bytes OwnerKey = 2; + + // Signature is a signature of token information + bytes Signature = 3; +} From f059c49dec5561166abe14a87c9ee469eade60c1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 18 Jun 2020 11:49:10 +0300 Subject: [PATCH 055/440] service: support extended headers of the request --- proto-docs/service.md | 26 ++++++++++++++++++++++++++ service/meta.proto | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/proto-docs/service.md b/proto-docs/service.md index 423599b..4d96f61 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,6 +6,8 @@ - [service/meta.proto](#service/meta.proto) - Messages + - [RequestExtendedHeader](#service.RequestExtendedHeader) + - [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) - [RequestMetaHeader](#service.RequestMetaHeader) - [ResponseMetaHeader](#service.ResponseMetaHeader) @@ -33,6 +35,29 @@ + + +### Message RequestExtendedHeader +RequestExtendedHeader contains extended headers of request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Headers | [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) | repeated | Headers carries list of key-value headers | + + + + +### Message RequestExtendedHeader.KV +KV contains string key-value pair + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| K | [string](#string) | | K carries extended header key | +| V | [string](#string) | | V carries extra header value | + + ### Message RequestMetaHeader @@ -46,6 +71,7 @@ RequestMetaHeader contains information about request meta headers | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | | Raw | [bool](#bool) | | Raw determines whether the request is raw or not | +| ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request | diff --git a/service/meta.proto b/service/meta.proto index 093f118..8171980 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -19,6 +19,8 @@ message RequestMetaHeader { uint32 Version = 3; // Raw determines whether the request is raw or not bool Raw = 4; + // ExtendedHeader carries extended headers of the request + RequestExtendedHeader ExtendedHeader = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } // ResponseMetaHeader contains meta information based on request processing by server @@ -30,3 +32,18 @@ message ResponseMetaHeader { // TODO: not used for now, should be implemented in future uint32 Version = 2; } + +// RequestExtendedHeader contains extended headers of request +message RequestExtendedHeader { + // KV contains string key-value pair + message KV { + // K carries extended header key + string K = 1; + + // V carries extended header value + string V = 2; + } + + // Headers carries list of key-value headers + repeated KV Headers = 1 [(gogoproto.nullable) = false]; +} From 108d7e0fb048bc7f1af2f087f32f1cbc91f62269 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 18 Jun 2020 11:56:26 +0300 Subject: [PATCH 056/440] service: clarify the description of BearerTokenMsg.Info.ACLRules field --- proto-docs/service.md | 2 +- service/verify.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index d492ccd..a42f0a0 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -98,7 +98,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ACLRules | [bytes](#bytes) | | ACLRules is an ACL rules represented in bytes | +| ACLRules | [bytes](#bytes) | | ACLRules carries a binary representation of the table of extended ACL rules | | OwnerID | [bytes](#bytes) | | OwnerID is an owner of token | | ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | diff --git a/service/verify.proto b/service/verify.proto index c78a732..a7e694f 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -98,7 +98,7 @@ message TokenLifetime { // BearerTokenMsg carries information about request ACL rules with limited lifetime message BearerTokenMsg { message Info { - // ACLRules is an ACL rules represented in bytes + // ACLRules carries a binary representation of the table of extended ACL rules bytes ACLRules = 1; // OwnerID is an owner of token From 3dbaac91d07d5199dbaf156d9944f69b0d777d6e Mon Sep 17 00:00:00 2001 From: alexvanin Date: Thu, 18 Jun 2020 13:44:29 +0300 Subject: [PATCH 057/440] Update changelog for v1.1.0 --- CHANGELOG.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 204489f..9d71309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.1.0] - 2020-06-18 + +### Added + +- Extended ACL support in container service. +- Bearer token support in the object service requests. +- Extended headers for the requests in `service.RequestMetaHeader` + ## [1.0.0] - 2020-05-16 Bump major release @@ -94,4 +102,5 @@ Bump major release [0.7.3]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.2...v0.7.3 [0.7.4]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.3...v0.7.4 [0.7.5]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.4...v0.7.5 -[1.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.5...v1.0.0 \ No newline at end of file +[1.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.5...v1.0.0 +[1.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.0.0...v1.1.0 From 089c6f1928f619d993512c6df7aa71624b80ef84 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 8 Jul 2020 10:22:07 +0300 Subject: [PATCH 058/440] acl: Define EACLTable message for the table of extended ACL rules --- acl/types.proto | 79 ++++++++++++++++++++++++++++ proto-docs/acl.md | 116 +++++++++++++++++++++++++++++++++++++++++- proto-docs/service.md | 2 +- 3 files changed, 195 insertions(+), 2 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index f20423f..7f3efc9 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -25,3 +25,82 @@ enum Target { // extended ACL. PubKey = 4; } + +// EACLRecord groups information about extended ACL rule. +message EACLRecord { + // Operation is an enumeration of operation types. + enum Operation { + OPERATION_UNKNOWN = 0; + GET = 1; + HEAD = 2; + PUT = 3; + DELETE = 4; + SEARCH = 5; + GETRANGE = 6; + GETRANGEHASH = 7; + } + + // Operation carries type of operation. + Operation operation = 1 [(gogoproto.customname) = "Operation", json_name="Operation"]; + + // Action is an enumeration of EACL actions. + enum Action { + ActionUnknown = 0; + Allow = 1; + Deny = 2; + } + + // Action carries ACL target action. + Action action = 2 [(gogoproto.customname) = "Action", json_name="Action"]; + + // FilterInfo groups information about filter. + message FilterInfo { + // Header is an enumeration of filtering header types. + enum Header { + HeaderUnknown = 0; + Request = 1; + ObjectSystem = 2; + ObjectUser = 3; + } + + // Header carries type of header. + Header header = 1 [(gogoproto.customname) = "Header", json_name="HeaderType"]; + + // MatchType is an enumeration of match types. + enum MatchType { + MatchUnknown = 0; + StringEqual = 1; + StringNotEqual = 2; + } + + // MatchType carries type of match. + MatchType matchType = 2 [(gogoproto.customname) = "MatchType", json_name="MatchType"]; + + // HeaderName carries name of filtering header. + string HeaderName = 3 [json_name="Name"]; + + // HeaderVal carries value of filtering header. + string HeaderVal = 4 [json_name="Value"]; + } + + // Filters carries set of filters. + repeated FilterInfo Filters = 3 [json_name="Filters"]; + + // TargetInfo groups information about extended ACL target. + message TargetInfo { + // Target carries target of ACL rule. + acl.Target Target = 1 [json_name="Role"]; + + // KeyList carries public keys of ACL target. + repeated bytes KeyList = 2 [json_name="Keys"]; + } + + // Targets carries information about extended ACL target list. + repeated TargetInfo Targets = 4 [json_name="Targets"]; +} + +// EACLRecord carries the information about extended ACL rules. +message EACLTable { + // Records carries list of extended ACL rule records. + repeated EACLRecord Records = 1 [json_name="Records"]; +} diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 38f328b..f63758b 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -5,7 +5,12 @@ - [acl/types.proto](#acl/types.proto) - + - Messages + - [EACLRecord](#acl.EACLRecord) + - [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) + - [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) + - [EACLTable](#acl.EACLTable) + - [Scalar Value Types](#scalar-value-types) @@ -19,9 +24,118 @@ + + + +### Message EACLRecord +EACLRecord groups information about extended ACL rule. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| operation | [EACLRecord.Operation](#acl.EACLRecord.Operation) | | Operation carries type of operation. | +| action | [EACLRecord.Action](#acl.EACLRecord.Action) | | Action carries ACL target action. | +| Filters | [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) | repeated | Filters carries set of filters. | +| Targets | [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) | repeated | Targets carries information about extended ACL target list. | + + + + +### Message EACLRecord.FilterInfo +FilterInfo groups information about filter. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| header | [EACLRecord.FilterInfo.Header](#acl.EACLRecord.FilterInfo.Header) | | Header carries type of header. | +| matchType | [EACLRecord.FilterInfo.MatchType](#acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | +| HeaderName | [string](#string) | | HeaderName carries name of filtering header. | +| HeaderVal | [string](#string) | | HeaderVal carries value of filtering header. | + + + + +### Message EACLRecord.TargetInfo +TargetInfo groups information about extended ACL target. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Target | [Target](#acl.Target) | | Target carries target of ACL rule. | +| KeyList | [bytes](#bytes) | repeated | KeyList carries public keys of ACL target. | + + + + +### Message EACLTable +EACLRecord carries the information about extended ACL rules. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | + + + +### EACLRecord.Action +Action is an enumeration of EACL actions. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| ActionUnknown | 0 | | +| Allow | 1 | | +| Deny | 2 | | + + + + + +### EACLRecord.FilterInfo.Header +Header is an enumeration of filtering header types. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| HeaderUnknown | 0 | | +| Request | 1 | | +| ObjectSystem | 2 | | +| ObjectUser | 3 | | + + + + + +### EACLRecord.FilterInfo.MatchType +MatchType is an enumeration of match types. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| MatchUnknown | 0 | | +| StringEqual | 1 | | +| StringNotEqual | 2 | | + + + + + +### EACLRecord.Operation +Operation is an enumeration of operation types. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| OPERATION_UNKNOWN | 0 | | +| GET | 1 | | +| HEAD | 2 | | +| PUT | 3 | | +| DELETE | 4 | | +| SEARCH | 5 | | +| GETRANGE | 6 | | +| GETRANGEHASH | 7 | | + + + ### Target diff --git a/proto-docs/service.md b/proto-docs/service.md index 80c52b0..756188b 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -57,7 +57,7 @@ KV contains string key-value pair | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | K | [string](#string) | | K carries extended header key | -| V | [string](#string) | | V carries extra header value | +| V | [string](#string) | | V carries extended header value | From b6a03439192df84dbe8b58e1ca7625e0e73c8ee1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 8 Jul 2020 10:46:02 +0300 Subject: [PATCH 059/440] Update changelog for v1.2.0 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d71309..84772ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.2.0] - 2020-07-08 + +### Added + +- ```acl.EACLRecord```, ```acl.EACLTable``` messages for the table of extended ACL rules. + ## [1.1.0] - 2020-06-18 ### Added @@ -104,3 +110,4 @@ Bump major release [0.7.5]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.4...v0.7.5 [1.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.5...v1.0.0 [1.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.0.0...v1.1.0 +[1.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.1.0...v1.2.0 From 6a2c66cbd8831edd1ce19d3a7908d188f0496044 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 16:14:22 +0300 Subject: [PATCH 060/440] [#20] Add attributes in container definition Signed-off-by: Alex Vanin --- container/types.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/container/types.proto b/container/types.proto index dc79bd3..b8d94f2 100644 --- a/container/types.proto +++ b/container/types.proto @@ -21,4 +21,14 @@ message Container { // BasicACL with access control rules for owner, system, others and // permission bits for bearer token and extended ACL. uint32 BasicACL = 5; + // Attributes define any immutable characteristics of container. + repeated Attribute Attributes = 6; } + +// Attribute is a key-value pair of strings. +message Attribute { + // Key of immutable container attribute. + string Key = 1; + // Value of immutable container attribute. + string Value = 2; +} \ No newline at end of file From 27171ef7533779fb2ffdcc88ce583d4649a45653 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 16:51:35 +0300 Subject: [PATCH 061/440] [#21] Add container id into EACLTable message EACLTable message and signature stored in blockchain storage. If owner has several containers, malicious node can return correct EACLTable of the container other than client actually requested. With container id field in the EACLTable, this malicious behaviour can be detected. ContainerID has id 1, so contract can easily cut container id from byte sequence. Signed-off-by: Alex Vanin --- acl/types.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acl/types.proto b/acl/types.proto index 7f3efc9..91e012f 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -101,6 +101,8 @@ message EACLRecord { // EACLRecord carries the information about extended ACL rules. message EACLTable { + // ContainerID of the container that should use given access control rules. + bytes ContainerID = 1 [json_name="ContainerID"]; // Records carries list of extended ACL rule records. - repeated EACLRecord Records = 1 [json_name="Records"]; + repeated EACLRecord Records = 2 [json_name="Records"]; } From 944cf1ff472e9990ca1f07afc9bf321b7be04b35 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:18:50 +0300 Subject: [PATCH 062/440] [#21] Use EACLTable in EACL related requests With EACLTable in requests and container id in EACLTable there is no need in extra messages such as ExtendedACLKey and ExtendedACLValue. Signed-off-by: Alex Vanin --- container/service.proto | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/container/service.proto b/container/service.proto index b174052..b650ecc 100644 --- a/container/service.proto +++ b/container/service.proto @@ -3,6 +3,7 @@ package container; option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; +import "acl/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "container/types.proto"; @@ -106,23 +107,11 @@ message ListResponse { repeated bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; } -message ExtendedACLKey { - // ID (container id) is a SHA256 hash of the container structure - bytes ID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; -} - -message ExtendedACLValue { - // EACL carries binary representation of the table of extended ACL rules - bytes EACL = 1; - // Signature carries EACL field signature - bytes Signature = 2; -} - message SetExtendedACLRequest { - // Key carries key to extended ACL information - ExtendedACLKey Key = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // Value carries extended ACL information - ExtendedACLValue Value = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // EACL to set for the container. + acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes Signature = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -132,8 +121,8 @@ message SetExtendedACLRequest { message SetExtendedACLResponse {} message GetExtendedACLRequest { - // Key carries key to extended ACL information - ExtendedACLKey Key = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // ContainerID of the container that has Extended ACL. + bytes ContainerID = 1; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -141,6 +130,6 @@ message GetExtendedACLRequest { } message GetExtendedACLResponse { - // ACL carries extended ACL information - ExtendedACLValue ACL = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // EACL that has been requested if it was set up. + acl.EACLTable EACL = 1; } From 9510aaee5d4888225ef227df1ad4b6ff1f1750e5 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:21:02 +0300 Subject: [PATCH 063/440] [#21] Return signature in GetEACL response With EACLTable signature client can verify if EACLTable is not corrupted by malicious node. Signed-off-by: Alex Vanin --- container/service.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/container/service.proto b/container/service.proto index b650ecc..6ce6ff0 100644 --- a/container/service.proto +++ b/container/service.proto @@ -132,4 +132,6 @@ message GetExtendedACLRequest { message GetExtendedACLResponse { // EACL that has been requested if it was set up. acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes Signature = 2; } From 72618c4e4937aaaff93478f66154c2a923f971c9 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:31:21 +0300 Subject: [PATCH 064/440] [#22] Update fields in container put request With explicit signature field, that contains signature of stable-marshalled container message, there is no need to have separate fields of the container in request. Public key will be stored in neofs.id smart-contract for later signature verifications. Signed-off-by: Alex Vanin --- container/service.proto | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/container/service.proto b/container/service.proto index 6ce6ff0..4cce245 100644 --- a/container/service.proto +++ b/container/service.proto @@ -7,7 +7,6 @@ import "acl/types.proto"; import "service/meta.proto"; import "service/verify.proto"; import "container/types.proto"; -import "github.com/nspcc-dev/netmap/selector.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -37,21 +36,13 @@ service Service { } message PutRequest { - // MessageID is a nonce for uniq container id calculation - bytes MessageID = 1 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; - - // Capacity defines amount of data that can be stored in the container (doesn't used for now). - uint64 Capacity = 2; - - // OwnerID is a wallet address - bytes OwnerID = 3 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - - // Rules define storage policy for the object inside the container. - netmap.PlacementRule rules = 4 [(gogoproto.nullable) = false]; - - // BasicACL of the container. - uint32 BasicACL = 5; - + // Container to create in NeoFS. + container.Container Container = 1; + // PublicKey of container owner. It can be public key of the owner + // or it can be public key that bound in neofs.id smart-contract. + bytes PublicKey = 2; + // Signature of stable-marshalled container according to RFC-6979. + bytes Signature = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) From cd6db41fe30dafaeb61f17ec710f698086b65d58 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:31:58 +0300 Subject: [PATCH 065/440] [#22] Add signature field to container delete request Signed-off-by: Alex Vanin --- container/service.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/container/service.proto b/container/service.proto index 4cce245..be06170 100644 --- a/container/service.proto +++ b/container/service.proto @@ -55,9 +55,10 @@ message PutResponse { } message DeleteRequest { - // CID (container id) is a SHA256 hash of the container structure - bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; - + // ContainerID of container to delete from NeoFS. + bytes ContainerID = 1; + // Signature of container id according to RFC-6979. + bytes Signature = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) From ebf96fea9e8ba0b982d605c7bfa7472393a5e967 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:39:28 +0300 Subject: [PATCH 066/440] [#23] Remove meta and verify headers from requests Neofs-node doesn't use these headers in any way. They are obsolete since container API provides proxy between client and morph chain. Signed-off-by: Alex Vanin --- container/service.proto | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/container/service.proto b/container/service.proto index be06170..757de29 100644 --- a/container/service.proto +++ b/container/service.proto @@ -4,8 +4,6 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; import "acl/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; import "container/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -43,10 +41,6 @@ message PutRequest { bytes PublicKey = 2; // Signature of stable-marshalled container according to RFC-6979. bytes Signature = 3; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message PutResponse { @@ -59,10 +53,6 @@ message DeleteRequest { bytes ContainerID = 1; // Signature of container id according to RFC-6979. bytes Signature = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } // DeleteResponse is empty because delete operation is asynchronous and done @@ -73,11 +63,6 @@ message DeleteResponse { } message GetRequest { // CID (container id) is a SHA256 hash of the container structure bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; - - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message GetResponse { @@ -88,10 +73,6 @@ message GetResponse { message ListRequest { // OwnerID is a wallet address bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message ListResponse { @@ -104,10 +85,6 @@ message SetExtendedACLRequest { acl.EACLTable EACL = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. bytes Signature = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message SetExtendedACLResponse {} @@ -115,10 +92,6 @@ message SetExtendedACLResponse {} message GetExtendedACLRequest { // ContainerID of the container that has Extended ACL. bytes ContainerID = 1; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } message GetExtendedACLResponse { From 21f51c8c8b86b7e51578ea88e74122a7f9655658 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:43:55 +0300 Subject: [PATCH 067/440] [#23] Reorganize container message fields Capacity field is obsolete and removed. Salt field renamed to Nonce so it shows better the purpose of the field. Remaining fields are reorded to have fixed size fields on top. It affects stable-marshaller implementation. Signed-off-by: Alex Vanin --- container/types.proto | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/container/types.proto b/container/types.proto index b8d94f2..98c1404 100644 --- a/container/types.proto +++ b/container/types.proto @@ -10,19 +10,17 @@ option (gogoproto.stable_marshaler_all) = true; // The Container service definition. message Container { - // OwnerID is a wallet address. - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // Salt is a nonce for unique container id calculation. - bytes Salt = 2 [(gogoproto.customtype) = "UUID", (gogoproto.nullable) = false]; - // Capacity defines amount of data that can be stored in the container (doesn't used for now). - uint64 Capacity = 3; - // Rules define storage policy for the object inside the container. - netmap.PlacementRule Rules = 4 [(gogoproto.nullable) = false]; - // BasicACL with access control rules for owner, system, others and - // permission bits for bearer token and extended ACL. - uint32 BasicACL = 5; - // Attributes define any immutable characteristics of container. - repeated Attribute Attributes = 6; + // OwnerID is a 25 byte NEO3.0 wallet address. + bytes OwnerID = 1; + // Nonce is a 16 byte UUID, used to avoid collisions of container id. + bytes Nonce = 2; + // BasicACL contains access control rules for owner, system, others groups and + // permission bits for bearer token and Extended ACL. + uint32 BasicACL = 3; + // Attributes define any immutable characteristics of container. + repeated Attribute Attributes = 4; + // Rules define storage policy for the object inside the container. + netmap.PlacementRule Rules = 5; } // Attribute is a key-value pair of strings. From 5928fa9bea547b1d3de7d27ac191cab64d3c02a7 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:46:28 +0300 Subject: [PATCH 068/440] [#23] Use rich field names instead of abbreviations Signed-off-by: Alex Vanin --- container/service.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/container/service.proto b/container/service.proto index 757de29..5d689e5 100644 --- a/container/service.proto +++ b/container/service.proto @@ -45,7 +45,7 @@ message PutRequest { message PutResponse { // CID (container id) is a SHA256 hash of the container structure - bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + bytes ContainerID = 1; } message DeleteRequest { @@ -62,7 +62,7 @@ message DeleteResponse { } message GetRequest { // CID (container id) is a SHA256 hash of the container structure - bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + bytes ContainerID = 1; } message GetResponse { @@ -72,12 +72,12 @@ message GetResponse { message ListRequest { // OwnerID is a wallet address - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + bytes OwnerID = 1; } message ListResponse { // CID (container id) is list of SHA256 hashes of the container structures - repeated bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + repeated bytes ContainerIDs = 1; } message SetExtendedACLRequest { From 62cc321c3eb2a4af8f2f11755efe7b70f6da46eb Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:47:57 +0300 Subject: [PATCH 069/440] [#23] Update comments for autogenerated docs Signed-off-by: Alex Vanin --- container/service.proto | 38 +++++++++++++++++++++++--------------- container/types.proto | 5 ++++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/container/service.proto b/container/service.proto index 5d689e5..1ad1a8d 100644 --- a/container/service.proto +++ b/container/service.proto @@ -9,27 +9,35 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; -// Container service provides API for manipulating with the container. +// Service provides API to access container smart-contract in morph chain +// via NeoFS node. service Service { - // Put request proposes container to the inner ring nodes. They will - // accept new container if user has enough deposit. All containers - // are accepted by the consensus, therefore it is asynchronous process. + // Put invokes 'Put' method in container smart-contract and returns + // response immediately. After new block in morph chain, request is verified + // by inner ring nodes. After one more block in morph chain, container + // added into smart-contract storage. rpc Put(PutRequest) returns (PutResponse); - // Delete container removes it from the inner ring container storage. It - // also asynchronous process done by consensus. + // Delete invokes 'Delete' method in container smart-contract and returns + // response immediately. After new block in morph chain, request is verified + // by inner ring nodes. After one more block in morph chain, container + // removed from smart-contract storage. rpc Delete(DeleteRequest) returns (DeleteResponse); - // Get container returns container instance + // Get returns container from container smart-contract storage. rpc Get(GetRequest) returns (GetResponse); - // List returns all user's containers + // List returns all owner's containers from container smart-contract + // storage. rpc List(ListRequest) returns (ListResponse); - // SetExtendedACL changes extended ACL rules of the container + // SetExtendedACL invokes 'SetEACL' method in container smart-contract and + // returns response immediately. After new block in morph chain, + // Extended ACL added into smart-contract storage. rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); - // GetExtendedACL returns extended ACL rules of the container + // GetExtendedACL returns Extended ACL table and signature from container + // smart-contract storage. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } @@ -44,7 +52,7 @@ message PutRequest { } message PutResponse { - // CID (container id) is a SHA256 hash of the container structure + // ContainerID of the new container. bytes ContainerID = 1; } @@ -61,22 +69,22 @@ message DeleteResponse { } message GetRequest { - // CID (container id) is a SHA256 hash of the container structure + // ContainerID of the container to get. bytes ContainerID = 1; } message GetResponse { - // Container is a structure that contains placement rules and owner id + // Container that has been requested. container.Container Container = 1; } message ListRequest { - // OwnerID is a wallet address + // OwnerID is a 25 byte NEO3.0 wallet address. bytes OwnerID = 1; } message ListResponse { - // CID (container id) is list of SHA256 hashes of the container structures + // ContainerIDs of containers that belong to the owner. repeated bytes ContainerIDs = 1; } diff --git a/container/types.proto b/container/types.proto index 98c1404..9eaf2c0 100644 --- a/container/types.proto +++ b/container/types.proto @@ -8,7 +8,10 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; -// The Container service definition. +// Container is a structure that defines object placement behaviour. Objects +// can be stored only within containers. They define placement rule, attributes +// and access control information. ID of the container is a 32 byte long +// SHA256 hash of stable-marshalled container message. message Container { // OwnerID is a 25 byte NEO3.0 wallet address. bytes OwnerID = 1; From dfcbfdc7d87f65ed0f3f9a1cd38c83828c7f00a6 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 31 Jul 2020 17:48:44 +0300 Subject: [PATCH 070/440] [#23] Regenerate documentation Signed-off-by: Alex Vanin --- proto-docs/acl.md | 1 + proto-docs/container.md | 125 ++++++++++++++++++---------------------- 2 files changed, 57 insertions(+), 69 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index f63758b..475e981 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -73,6 +73,7 @@ EACLRecord carries the information about extended ACL rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| ContainerID | [bytes](#bytes) | | ContainerID of the container that should use given access control rules. | | Records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | diff --git a/proto-docs/container.md b/proto-docs/container.md index fd89acd..b0b539f 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -10,8 +10,6 @@ - Messages - [DeleteRequest](#container.DeleteRequest) - [DeleteResponse](#container.DeleteResponse) - - [ExtendedACLKey](#container.ExtendedACLKey) - - [ExtendedACLValue](#container.ExtendedACLValue) - [GetExtendedACLRequest](#container.GetExtendedACLRequest) - [GetExtendedACLResponse](#container.GetExtendedACLResponse) - [GetRequest](#container.GetRequest) @@ -27,6 +25,7 @@ - [container/types.proto](#container/types.proto) - Messages + - [Attribute](#container.Attribute) - [Container](#container.Container) @@ -45,7 +44,8 @@ ### Service "container.Service" -Container service provides API for manipulating with the container. +Service provides API to access container smart-contract in morph chain +via NeoFS node. ``` rpc Put(PutRequest) returns (PutResponse); @@ -59,45 +59,52 @@ rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); #### Method Put -Put request proposes container to the inner ring nodes. They will -accept new container if user has enough deposit. All containers -are accepted by the consensus, therefore it is asynchronous process. +Put invokes 'Put' method in container smart-contract and returns +response immediately. After new block in morph chain, request is verified +by inner ring nodes. After one more block in morph chain, container +added into smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Put | [PutRequest](#container.PutRequest) | [PutResponse](#container.PutResponse) | #### Method Delete -Delete container removes it from the inner ring container storage. It -also asynchronous process done by consensus. +Delete invokes 'Delete' method in container smart-contract and returns +response immediately. After new block in morph chain, request is verified +by inner ring nodes. After one more block in morph chain, container +removed from smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Delete | [DeleteRequest](#container.DeleteRequest) | [DeleteResponse](#container.DeleteResponse) | #### Method Get -Get container returns container instance +Get returns container from container smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Get | [GetRequest](#container.GetRequest) | [GetResponse](#container.GetResponse) | #### Method List -List returns all user's containers +List returns all owner's containers from container smart-contract +storage. | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#container.ListRequest) | [ListResponse](#container.ListResponse) | #### Method SetExtendedACL -SetExtendedACL changes extended ACL rules of the container +SetExtendedACL invokes 'SetEACL' method in container smart-contract and +returns response immediately. After new block in morph chain, +Extended ACL added into smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | | SetExtendedACL | [SetExtendedACLRequest](#container.SetExtendedACLRequest) | [SetExtendedACLResponse](#container.SetExtendedACLResponse) | #### Method GetExtendedACL -GetExtendedACL returns extended ACL rules of the container +GetExtendedACL returns Extended ACL table and signature from container +smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | @@ -113,9 +120,8 @@ GetExtendedACL returns extended ACL rules of the container | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| ContainerID | [bytes](#bytes) | | ContainerID of container to delete from NeoFS. | +| Signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | @@ -126,29 +132,6 @@ via consensus in inner ring nodes - - -### Message ExtendedACLKey - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID (container id) is a SHA256 hash of the container structure | - - - - -### Message ExtendedACLValue - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| EACL | [bytes](#bytes) | | EACL carries binary representation of the table of extended ACL rules | -| Signature | [bytes](#bytes) | | Signature carries EACL field signature | - - ### Message GetExtendedACLRequest @@ -157,9 +140,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [ExtendedACLKey](#container.ExtendedACLKey) | | Key carries key to extended ACL information | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| ContainerID | [bytes](#bytes) | | ContainerID of the container that has Extended ACL. | @@ -170,7 +151,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ACL | [ExtendedACLValue](#container.ExtendedACLValue) | | ACL carries extended ACL information | +| EACL | [acl.EACLTable](#acl.EACLTable) | | EACL that has been requested if it was set up. | +| Signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -181,9 +163,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| ContainerID | [bytes](#bytes) | | ContainerID of the container to get. | @@ -194,7 +174,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Container | [Container](#container.Container) | | Container is a structure that contains placement rules and owner id | +| Container | [Container](#container.Container) | | Container that has been requested. | @@ -205,9 +185,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | @@ -218,7 +196,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | repeated | CID (container id) is list of SHA256 hashes of the container structures | +| ContainerIDs | [bytes](#bytes) | repeated | ContainerIDs of containers that belong to the owner. | @@ -229,13 +207,9 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq container id calculation | -| Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| BasicACL | [uint32](#uint32) | | BasicACL of the container. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Container | [Container](#container.Container) | | Container to create in NeoFS. | +| PublicKey | [bytes](#bytes) | | PublicKey of container owner. It can be public key of the owner or it can be public key that bound in neofs.id smart-contract. | +| Signature | [bytes](#bytes) | | Signature of stable-marshalled container according to RFC-6979. | @@ -246,7 +220,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | +| ContainerID | [bytes](#bytes) | | ContainerID of the new container. | @@ -257,10 +231,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [ExtendedACLKey](#container.ExtendedACLKey) | | Key carries key to extended ACL information | -| Value | [ExtendedACLValue](#container.ExtendedACLValue) | | Value carries extended ACL information | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| EACL | [acl.EACLTable](#acl.EACLTable) | | EACL to set for the container. | +| Signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -284,19 +256,34 @@ via consensus in inner ring nodes - + -### Message Container -The Container service definition. +### Message Attribute +Attribute is a key-value pair of strings. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address. | -| Salt | [bytes](#bytes) | | Salt is a nonce for unique container id calculation. | -| Capacity | [uint64](#uint64) | | Capacity defines amount of data that can be stored in the container (doesn't used for now). | +| Key | [string](#string) | | Key of immutable container attribute. | +| Value | [string](#string) | | Value of immutable container attribute. | + + + + +### Message Container +Container is a structure that defines object placement behaviour. Objects +can be stored only within containers. They define placement rule, attributes +and access control information. ID of the container is a 32 byte long +SHA256 hash of stable-marshalled container message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | +| Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | +| BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | +| Attributes | [Attribute](#container.Attribute) | repeated | Attributes define any immutable characteristics of container. | | Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | -| BasicACL | [uint32](#uint32) | | BasicACL with access control rules for owner, system, others and permission bits for bearer token and extended ACL. | From 7ea4d475a024af4ef384255176671c96ad5b4815 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 11:43:34 +0300 Subject: [PATCH 071/440] [#26] object: Replace object.Range message definition This commit replaces Range message definition closer to where it is used. In the future, only the types associated with the structure of the object will be defined in types.proto file. Signed-off-by: Leonard Lyubich --- object/service.proto | 7 +++++++ object/types.proto | 7 ------- proto-docs/object.md | 26 +++++++++++++------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/object/service.proto b/object/service.proto index 91d0b99..9affad7 100644 --- a/object/service.proto +++ b/object/service.proto @@ -157,6 +157,13 @@ message SearchResponse { service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } +message Range { + // Offset of the data range + uint64 Offset = 1; + // Length of the data range + uint64 Length = 2; +} + message GetRangeRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; diff --git a/object/types.proto b/object/types.proto index 46e1549..010bf8a 100644 --- a/object/types.proto +++ b/object/types.proto @@ -10,13 +10,6 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; -message Range { - // Offset of the data range - uint64 Offset = 1; - // Length of the data range - uint64 Length = 2; -} - message UserHeader { // Key of the user's header string Key = 1; diff --git a/proto-docs/object.md b/proto-docs/object.md index 27e4bcf..02eb026 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -21,6 +21,7 @@ - [PutRequest](#object.PutRequest) - [PutRequest.PutHeader](#object.PutRequest.PutHeader) - [PutResponse](#object.PutResponse) + - [Range](#object.Range) - [SearchRequest](#object.SearchRequest) - [SearchResponse](#object.SearchResponse) @@ -34,7 +35,6 @@ - [Link](#object.Link) - [Object](#object.Object) - [PublicKey](#object.PublicKey) - - [Range](#object.Range) - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) - [Transform](#object.Transform) @@ -308,6 +308,18 @@ in distributed system. | Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | + + +### Message Range + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Offset | [uint64](#uint64) | | Offset of the data range | +| Length | [uint64](#uint64) | | Length of the data range | + + ### Message SearchRequest @@ -430,18 +442,6 @@ in distributed system. | Value | [bytes](#bytes) | | Value contains marshaled ecdsa public key | - - -### Message Range - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Offset | [uint64](#uint64) | | Offset of the data range | -| Length | [uint64](#uint64) | | Length of the data range | - - ### Message SystemHeader From c2b5b6b6aea5ee51f8b39f4c30593149031498a9 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 12:18:35 +0300 Subject: [PATCH 072/440] [#26] object: Remove gogoproto from object typedef As mentioned in #32, there is a need to remove gogoproto usage from NeoFS API since this plugin is not cross-language. This commit removes usage from object.Object message and all related types. Signed-off-by: Leonard Lyubich --- object/types.proto | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/object/types.proto b/object/types.proto index 010bf8a..9680554 100644 --- a/object/types.proto +++ b/object/types.proto @@ -6,9 +6,6 @@ option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "service/verify.proto"; import "storagegroup/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; message UserHeader { // Key of the user's header @@ -32,7 +29,7 @@ message Header { // Token header contains token of the session within which the object was created service.Token Token = 6; // HomoHash is a homomorphic hash of original object payload - bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"]; + bytes HomoHash = 7; // PayloadChecksum of actual object's payload bytes PayloadChecksum = 8; // Integrity header with checksum of all above headers in the object @@ -53,18 +50,16 @@ message SystemHeader { uint64 PayloadLength = 2; // ID is an object identifier, is a valid UUIDv4 - bytes ID = 3 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; + bytes ID = 3; // OwnerID is a wallet address - bytes OwnerID = 4 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + bytes OwnerID = 4; // CID is a SHA256 hash of the container structure (container identifier) - bytes CID = 5 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + bytes CID = 5; // CreatedAt is a timestamp of object creation - CreationPoint CreatedAt = 6 [(gogoproto.nullable) = false]; + CreationPoint CreatedAt = 6; } message CreationPoint { - option (gogoproto.goproto_stringer) = false; - // UnixTime is a date of creation in unixtime format int64 UnixTime = 1; // Epoch is a date of creation in NeoFS epochs @@ -95,7 +90,7 @@ message Link { // Type of link Type type = 1; // ID is an object identifier, is a valid UUIDv4 - bytes ID = 2 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; + bytes ID = 2; } message Transform { @@ -114,9 +109,9 @@ message Transform { message Object { // SystemHeader describes system header - SystemHeader SystemHeader = 1 [(gogoproto.nullable) = false]; + SystemHeader SystemHeader = 1; // Headers describes a set of an extended headers - repeated Header Headers = 2 [(gogoproto.nullable) = false]; + repeated Header Headers = 2; // Payload is an object's payload bytes Payload = 3; } From a76f634e475df2d0b55293e2e2a4285ad888321b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 12:53:33 +0300 Subject: [PATCH 073/440] [#26] object: Rename UserHeader to Attribute The name of object.UserHeader message implies its use by the user. However, the attributes of an object can also be set internally by the system. To generalize the intended purpose of the message, this commit renames it to an Attribute (like container.Attribute). Signed-off-by: Leonard Lyubich --- object/types.proto | 14 ++++++++------ proto-docs/object.md | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/object/types.proto b/object/types.proto index 9680554..fe14a57 100644 --- a/object/types.proto +++ b/object/types.proto @@ -7,10 +7,12 @@ import "refs/types.proto"; import "service/verify.proto"; import "storagegroup/types.proto"; -message UserHeader { - // Key of the user's header - string Key = 1; - // Value of the user's header +// Attribute groups the parameters of the object attributes. +message Attribute { + // Key carries the string key to the object attribute. + string Key = 1; + + // Value carries the string value of the object attribute. string Value = 2; } @@ -20,8 +22,8 @@ message Header { Link Link = 1; // Redirect not used yet refs.Address Redirect = 2; - // UserHeader is a set of KV headers defined by user - UserHeader UserHeader = 3; + // Attribute is a set of K-V object attributes + Attribute Attribute = 3; // Transform defines transform operation (e.g. payload split) Transform Transform = 4; // Tombstone header that set up in deleted objects diff --git a/proto-docs/object.md b/proto-docs/object.md index 02eb026..2f0c482 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -29,6 +29,7 @@ - [object/types.proto](#object/types.proto) - Messages + - [Attribute](#object.Attribute) - [CreationPoint](#object.CreationPoint) - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) @@ -38,7 +39,6 @@ - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) - [Transform](#object.Transform) - - [UserHeader](#object.UserHeader) - [Scalar Value Types](#scalar-value-types) @@ -361,6 +361,18 @@ in distributed system. + + +### Message Attribute +Attribute groups the parameters of the object attributes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Key carries the string key to the object attribute. | +| Value | [string](#string) | | Value carries the string value of the object attribute. | + + ### Message CreationPoint @@ -383,7 +395,7 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Link | [Link](#object.Link) | | Link to other objects | | Redirect | [refs.Address](#refs.Address) | | Redirect not used yet | -| UserHeader | [UserHeader](#object.UserHeader) | | UserHeader is a set of KV headers defined by user | +| Attribute | [Attribute](#object.Attribute) | | Attribute is a set of K-V object attributes | | Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | | Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | @@ -475,18 +487,6 @@ in distributed system. | ----- | ---- | ----- | ----------- | | type | [Transform.Type](#object.Transform.Type) | | Type of object transformation | - - - -### Message UserHeader - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Key of the user's header | -| Value | [string](#string) | | Value of the user's header | - From 2c3717bdeeef5580717b1d52f0491c02b3442632 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 13:04:45 +0300 Subject: [PATCH 074/440] [#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 --- object/types.proto | 6 +++--- proto-docs/object.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/object/types.proto b/object/types.proto index fe14a57..37d80a4 100644 --- a/object/types.proto +++ b/object/types.proto @@ -16,7 +16,7 @@ message Attribute { string Value = 2; } -message Header { +message ExtendedHeader { oneof Value { // Link to other objects Link Link = 1; @@ -112,8 +112,8 @@ message Transform { message Object { // SystemHeader describes system header SystemHeader SystemHeader = 1; - // Headers describes a set of an extended headers - repeated Header Headers = 2; + // ExtendedHeaders describes a set of an extended headers + repeated ExtendedHeader ExtendedHeaders = 2; // Payload is an object's payload bytes Payload = 3; } diff --git a/proto-docs/object.md b/proto-docs/object.md index 2f0c482..fdc2275 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -31,7 +31,7 @@ - Messages - [Attribute](#object.Attribute) - [CreationPoint](#object.CreationPoint) - - [Header](#object.Header) + - [ExtendedHeader](#object.ExtendedHeader) - [IntegrityHeader](#object.IntegrityHeader) - [Link](#object.Link) - [Object](#object.Object) @@ -385,9 +385,9 @@ Attribute groups the parameters of the object attributes. | Epoch | [uint64](#uint64) | | Epoch is a date of creation in NeoFS epochs | - + -### Message Header +### Message ExtendedHeader @@ -439,7 +439,7 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | -| Headers | [Header](#object.Header) | repeated | Headers describes a set of an extended headers | +| ExtendedHeaders | [ExtendedHeader](#object.ExtendedHeader) | repeated | ExtendedHeaders describes a set of an extended headers | | Payload | [bytes](#bytes) | | Payload is an object's payload | From 5beca3b0d1d84528ce8f3b6c57f5b125d0ed94af Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 13:18:38 +0300 Subject: [PATCH 075/440] [#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 --- object/types.proto | 11 +++++++++-- proto-docs/object.md | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/object/types.proto b/object/types.proto index 37d80a4..0b249fd 100644 --- a/object/types.proto +++ b/object/types.proto @@ -109,13 +109,20 @@ message Transform { Type type = 1; } -message Object { +// Header groups the information about the NeoFS object. +message Header { // SystemHeader describes system header SystemHeader SystemHeader = 1; + // ExtendedHeaders describes a set of an extended headers repeated ExtendedHeader ExtendedHeaders = 2; +} + +message Object { + // Header carries the object header. + Header Header = 1; // Payload is an object's payload - bytes Payload = 3; + bytes Payload = 2; } message PublicKey { diff --git a/proto-docs/object.md b/proto-docs/object.md index fdc2275..8115802 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -32,6 +32,7 @@ - [Attribute](#object.Attribute) - [CreationPoint](#object.CreationPoint) - [ExtendedHeader](#object.ExtendedHeader) + - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) - [Link](#object.Link) - [Object](#object.Object) @@ -406,6 +407,18 @@ Attribute groups the parameters of the object attributes. | PublicKey | [PublicKey](#object.PublicKey) | | PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. | + + +### Message Header +Header groups the information about the NeoFS object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | +| ExtendedHeaders | [ExtendedHeader](#object.ExtendedHeader) | repeated | ExtendedHeaders describes a set of an extended headers | + + ### Message IntegrityHeader @@ -438,8 +451,7 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | -| ExtendedHeaders | [ExtendedHeader](#object.ExtendedHeader) | repeated | ExtendedHeaders describes a set of an extended headers | +| Header | [Header](#object.Header) | | Header carries the object header. | | Payload | [bytes](#bytes) | | Payload is an object's payload | From 6e5565f2389b86ff13e7ebfd68e7f9dd3dc52331 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 15:10:44 +0300 Subject: [PATCH 076/440] [#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 --- object/types.proto | 11 ++--------- proto-docs/object.md | 15 +-------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/object/types.proto b/object/types.proto index 0b249fd..e6bb914 100644 --- a/object/types.proto +++ b/object/types.proto @@ -57,15 +57,8 @@ message SystemHeader { bytes OwnerID = 4; // CID is a SHA256 hash of the container structure (container identifier) bytes CID = 5; - // CreatedAt is a timestamp of object creation - CreationPoint CreatedAt = 6; -} - -message CreationPoint { - // UnixTime is a date of creation in unixtime format - int64 UnixTime = 1; - // Epoch is a date of creation in NeoFS epochs - uint64 Epoch = 2; + // CreationEpoch carries number of NeoFS epoch on which the object was created. + uint64 CreationEpoch = 6; } message IntegrityHeader { diff --git a/proto-docs/object.md b/proto-docs/object.md index 8115802..eb69f23 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -30,7 +30,6 @@ - Messages - [Attribute](#object.Attribute) - - [CreationPoint](#object.CreationPoint) - [ExtendedHeader](#object.ExtendedHeader) - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) @@ -374,18 +373,6 @@ Attribute groups the parameters of the object attributes. | Value | [string](#string) | | Value carries the string value of the object attribute. | - - -### Message CreationPoint - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| UnixTime | [int64](#int64) | | UnixTime is a date of creation in unixtime format | -| Epoch | [uint64](#uint64) | | Epoch is a date of creation in NeoFS epochs | - - ### Message ExtendedHeader @@ -479,7 +466,7 @@ Header groups the information about the NeoFS object. | ID | [bytes](#bytes) | | ID is an object identifier, is a valid UUIDv4 | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | CID | [bytes](#bytes) | | CID is a SHA256 hash of the container structure (container identifier) | -| CreatedAt | [CreationPoint](#object.CreationPoint) | | CreatedAt is a timestamp of object creation | +| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | From b46011db450bf1decb2bb19efc3c569e5cf46b7d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 15:33:10 +0300 Subject: [PATCH 077/440] [#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 --- object/types.proto | 8 +++----- proto-docs/object.md | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/object/types.proto b/object/types.proto index e6bb914..6de2531 100644 --- a/object/types.proto +++ b/object/types.proto @@ -50,13 +50,11 @@ message SystemHeader { uint64 Version = 1; // PayloadLength is an object payload length uint64 PayloadLength = 2; - - // ID is an object identifier, is a valid UUIDv4 - bytes ID = 3; + // Address carries object address in the NeoFS system. + // It encapsulates the object and the container identifiers. + refs.Address Address = 3; // OwnerID is a wallet address bytes OwnerID = 4; - // CID is a SHA256 hash of the container structure (container identifier) - bytes CID = 5; // CreationEpoch carries number of NeoFS epoch on which the object was created. uint64 CreationEpoch = 6; } diff --git a/proto-docs/object.md b/proto-docs/object.md index eb69f23..0b0ac7c 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -463,9 +463,8 @@ Header groups the information about the NeoFS object. | ----- | ---- | ----- | ----------- | | Version | [uint64](#uint64) | | Version of the object structure | | PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | -| ID | [bytes](#bytes) | | ID is an object identifier, is a valid UUIDv4 | +| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| CID | [bytes](#bytes) | | CID is a SHA256 hash of the container structure (container identifier) | | CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | From 96924b04dc5cb287797a3d1e7b2975cffdd38c6c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 15:52:14 +0300 Subject: [PATCH 078/440] [#26] refs: Define ObjectID message This commit defines ObjectID message in refs package. In the future, this structure can be ported into messages in place of the object identifier field to maintain format uniformity. Also, storing the identifier in a dedicated message will allow, if necessary, to expand it with additional information without losing backward compatibility within one version of the API. Signed-off-by: Leonard Lyubich --- proto-docs/refs.md | 12 ++++++++++++ refs/types.proto | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index b808482..94dbc86 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -7,6 +7,7 @@ - Messages - [Address](#refs.Address) + - [ObjectID](#refs.ObjectID) - [Scalar Value Types](#scalar-value-types) @@ -33,6 +34,17 @@ Address of object (container id + object id) | ObjectID | [bytes](#bytes) | | ObjectID is an object identifier, valid UUIDv4 represented in bytes | | CID | [bytes](#bytes) | | CID is container identifier | + + + +### Message ObjectID +ObjectID groups information about the NeoFS object identifier. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [bytes](#bytes) | | Value carries the object identifier in a binary format. | + diff --git a/refs/types.proto b/refs/types.proto index 6b001c0..dd78dc0 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -17,3 +17,9 @@ message Address { // CID is container identifier bytes CID = 2[(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; } + +// ObjectID groups information about the NeoFS object identifier. +message ObjectID { + // Value carries the object identifier in a binary format. + bytes Value = 1; +} \ No newline at end of file From 4bdd05ade883e51c214fb42d4e95697375c8956d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 15:58:38 +0300 Subject: [PATCH 079/440] [#26] refs: Use ObjectID message in Address This commit makes ObjectID field of refs.Address message to use dedicated message for object identifier ObjectID. Signed-off-by: Leonard Lyubich --- proto-docs/refs.md | 2 +- refs/types.proto | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 94dbc86..5947f70 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -31,7 +31,7 @@ Address of object (container id + object id) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ObjectID | [bytes](#bytes) | | ObjectID is an object identifier, valid UUIDv4 represented in bytes | +| ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | | CID | [bytes](#bytes) | | CID is container identifier | diff --git a/refs/types.proto b/refs/types.proto index dd78dc0..45e28a5 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -12,8 +12,8 @@ option (gogoproto.goproto_stringer_all) = false; // Address of object (container id + object id) message Address { - // ObjectID is an object identifier, valid UUIDv4 represented in bytes - bytes ObjectID = 1[(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false]; + // ObjectID carries object identifier. + ObjectID ObjectID = 1; // CID is container identifier bytes CID = 2[(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; } From 485510ab6616b9d5b0973b7f97990107f5f6b143 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 16:04:56 +0300 Subject: [PATCH 080/440] [#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 --- object/types.proto | 18 ++++++++++++++++++ proto-docs/object.md | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/object/types.proto b/object/types.proto index 6de2531..77e82c7 100644 --- a/object/types.proto +++ b/object/types.proto @@ -100,6 +100,24 @@ message Transform { Type type = 1; } +// SplitHeader groups information about spawning the object through a payload splitting. +message SplitHeader { + // Parent carries identifier of the origin object. + refs.ObjectID Parent = 1; + + // Previous carries identifier of the left split neighbor. + refs.ObjectID Previous = 2; + + // Previous carries identifier of the right split neighbor. + refs.ObjectID Next = 3; + + // Children carries list of identifiers of the objects generated by splitting the current. + repeated refs.ObjectID Children = 4; + + // Origin carries the header of the origin object. + Header Origin = 5; +} + // Header groups the information about the NeoFS object. message Header { // SystemHeader describes system header diff --git a/proto-docs/object.md b/proto-docs/object.md index 0b0ac7c..4b87cff 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -36,6 +36,7 @@ - [Link](#object.Link) - [Object](#object.Object) - [PublicKey](#object.PublicKey) + - [SplitHeader](#object.SplitHeader) - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) - [Transform](#object.Transform) @@ -453,6 +454,21 @@ Header groups the information about the NeoFS object. | Value | [bytes](#bytes) | | Value contains marshaled ecdsa public key | + + +### Message SplitHeader +SplitHeader groups information about spawning the object through a payload splitting. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | +| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | +| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. | +| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | +| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | + + ### Message SystemHeader From cbd4cf63f9bb84b673e3efcc093621d92e7d30d0 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 16:50:29 +0300 Subject: [PATCH 081/440] [#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 --- object/types.proto | 18 ++---------------- proto-docs/object.md | 28 +--------------------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/object/types.proto b/object/types.proto index 77e82c7..411a991 100644 --- a/object/types.proto +++ b/object/types.proto @@ -24,8 +24,8 @@ message ExtendedHeader { refs.Address Redirect = 2; // Attribute is a set of K-V object attributes Attribute Attribute = 3; - // Transform defines transform operation (e.g. payload split) - Transform Transform = 4; + // Split carries the position of the object in the split hierarchy. + SplitHeader SplitHeader = 4; // Tombstone header that set up in deleted objects Tombstone Tombstone = 5; // Token header contains token of the session within which the object was created @@ -86,20 +86,6 @@ message Link { bytes ID = 2; } -message Transform { - enum Type { - Unknown = 0; - // Split sets when object created after payload split - Split = 1; - // Sign sets when object created after re-signing (doesn't used) - Sign = 2; - // Mould sets when object created after filling missing headers in the object - Mould = 3; - } - // Type of object transformation - Type type = 1; -} - // SplitHeader groups information about spawning the object through a payload splitting. message SplitHeader { // Parent carries identifier of the origin object. diff --git a/proto-docs/object.md b/proto-docs/object.md index 4b87cff..fd4beba 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -39,7 +39,6 @@ - [SplitHeader](#object.SplitHeader) - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) - - [Transform](#object.Transform) - [Scalar Value Types](#scalar-value-types) @@ -385,7 +384,7 @@ Attribute groups the parameters of the object attributes. | Link | [Link](#object.Link) | | Link to other objects | | Redirect | [refs.Address](#refs.Address) | | Redirect not used yet | | Attribute | [Attribute](#object.Attribute) | | Attribute is a set of K-V object attributes | -| Transform | [Transform](#object.Transform) | | Transform defines transform operation (e.g. payload split) | +| SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | | Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | @@ -490,17 +489,6 @@ SplitHeader groups information about spawning the object through a payload split - - - -### Message Transform - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [Transform.Type](#object.Transform.Type) | | Type of object transformation | - @@ -519,20 +507,6 @@ SplitHeader groups information about spawning the object through a payload split | StorageGroup | 5 | Object that included into this storage group | - - - -### Transform.Type - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | | -| Split | 1 | Split sets when object created after payload split | -| Sign | 2 | Sign sets when object created after re-signing (doesn't used) | -| Mould | 3 | Mould sets when object created after filling missing headers in the object | - - From 9666fd4bc7bbf1c88e785e2804c5d6393e3be383 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 17:08:09 +0300 Subject: [PATCH 082/440] [#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 --- object/types.proto | 50 +++++++++++++++++++++----------------------- proto-docs/object.md | 2 +- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/object/types.proto b/object/types.proto index 411a991..68eb1fa 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,30 +17,28 @@ message Attribute { } message ExtendedHeader { - oneof Value { - // Link to other objects - Link Link = 1; - // Redirect not used yet - refs.Address Redirect = 2; - // Attribute is a set of K-V object attributes - Attribute Attribute = 3; - // Split carries the position of the object in the split hierarchy. - SplitHeader SplitHeader = 4; - // Tombstone header that set up in deleted objects - Tombstone Tombstone = 5; - // Token header contains token of the session within which the object was created - service.Token Token = 6; - // HomoHash is a homomorphic hash of original object payload - bytes HomoHash = 7; - // PayloadChecksum of actual object's payload - bytes PayloadChecksum = 8; - // Integrity header with checksum of all above headers in the object - IntegrityHeader Integrity = 9; - // StorageGroup contains meta information for the data audit - storagegroup.StorageGroup StorageGroup = 10; - // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. - PublicKey PublicKey = 11; - } + // Link to other objects + Link Link = 1; + // Redirect not used yet + refs.Address Redirect = 2; + // Attribute is a set of K-V object attributes + Attribute Attribute = 3; + // Split carries the position of the object in the split hierarchy. + SplitHeader SplitHeader = 4; + // Tombstone header that set up in deleted objects + Tombstone Tombstone = 5; + // Token header contains token of the session within which the object was created + service.Token Token = 6; + // HomoHash is a homomorphic hash of original object payload + bytes HomoHash = 7; + // PayloadChecksum of actual object's payload + bytes PayloadChecksum = 8; + // Integrity header with checksum of all above headers in the object + IntegrityHeader Integrity = 9; + // StorageGroup contains meta information for the data audit + storagegroup.StorageGroup StorageGroup = 10; + // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. + PublicKey PublicKey = 11; } message Tombstone {} @@ -109,8 +107,8 @@ message Header { // SystemHeader describes system header SystemHeader SystemHeader = 1; - // ExtendedHeaders describes a set of an extended headers - repeated ExtendedHeader ExtendedHeaders = 2; + // ExtendedHeader carries the additional part of the header. + ExtendedHeader ExtendedHeader = 2; } message Object { diff --git a/proto-docs/object.md b/proto-docs/object.md index fd4beba..61deded 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -403,7 +403,7 @@ Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | -| ExtendedHeaders | [ExtendedHeader](#object.ExtendedHeader) | repeated | ExtendedHeaders describes a set of an extended headers | +| ExtendedHeader | [ExtendedHeader](#object.ExtendedHeader) | | ExtendedHeader carries the additional part of the header. | From 7ce0945e6c6c8be3f88630bfadf34acf737cd39f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 17:14:20 +0300 Subject: [PATCH 083/440] [#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 --- object/types.proto | 10 ++++------ proto-docs/object.md | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/object/types.proto b/object/types.proto index 68eb1fa..76ab4cf 100644 --- a/object/types.proto +++ b/object/types.proto @@ -44,17 +44,15 @@ message ExtendedHeader { message Tombstone {} message SystemHeader { - // Version of the object structure - uint64 Version = 1; // PayloadLength is an object payload length - uint64 PayloadLength = 2; + uint64 PayloadLength = 1; // Address carries object address in the NeoFS system. // It encapsulates the object and the container identifiers. - refs.Address Address = 3; + refs.Address Address = 2; // OwnerID is a wallet address - bytes OwnerID = 4; + bytes OwnerID = 3; // CreationEpoch carries number of NeoFS epoch on which the object was created. - uint64 CreationEpoch = 6; + uint64 CreationEpoch = 4; } message IntegrityHeader { diff --git a/proto-docs/object.md b/proto-docs/object.md index 61deded..b6a1a54 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -476,7 +476,6 @@ SplitHeader groups information about spawning the object through a payload split | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Version | [uint64](#uint64) | | Version of the object structure | | PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | From 300b1d419752ca638a32fe39057c3965328594d3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 17:21:44 +0300 Subject: [PATCH 084/440] [#26] storagegroup: Add member list to message To encapsulate the complete information about the storage group in StorageGroup message, this commit adds the missing group member list field. Signed-off-by: Leonard Lyubich --- proto-docs/storagegroup.md | 1 + storagegroup/types.proto | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index 7522902..af34ee3 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -34,6 +34,7 @@ | ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | | ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | | lifetime | [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid | +| Members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | diff --git a/storagegroup/types.proto b/storagegroup/types.proto index fde33aa..711d72c 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -4,6 +4,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup"; option csharp_namespace = "NeoFS.API.StorageGroup"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +import "refs/types.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -33,4 +34,8 @@ message StorageGroup { // Lifetime is time until storage group is valid Lifetime lifetime = 3 [(gogoproto.customname) = "Lifetime"]; + + // Members carries the list of identifiers of the object storage group members. + // The list is strictly ordered. + repeated refs.ObjectID Members = 4; } From 4df4badf9cff3ad88e524eb6f9006656d098a1da Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 17:33:32 +0300 Subject: [PATCH 085/440] [#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 --- object/types.proto | 22 ---------------------- proto-docs/object.md | 29 ----------------------------- 2 files changed, 51 deletions(-) diff --git a/object/types.proto b/object/types.proto index 76ab4cf..2437ca9 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,8 +17,6 @@ message Attribute { } message ExtendedHeader { - // Link to other objects - Link Link = 1; // Redirect not used yet refs.Address Redirect = 2; // Attribute is a set of K-V object attributes @@ -62,26 +60,6 @@ message IntegrityHeader { bytes ChecksumSignature = 2; } -message Link { - enum Type { - Unknown = 0; - // Parent object created during object transformation - Parent = 1; - // Previous object in the linked list created during object transformation - Previous = 2; - // Next object in the linked list created during object transformation - Next = 3; - // Child object created during object transformation - Child = 4; - // Object that included into this storage group - StorageGroup = 5; - } - // Type of link - Type type = 1; - // ID is an object identifier, is a valid UUIDv4 - bytes ID = 2; -} - // SplitHeader groups information about spawning the object through a payload splitting. message SplitHeader { // Parent carries identifier of the origin object. diff --git a/proto-docs/object.md b/proto-docs/object.md index b6a1a54..9c77114 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -33,7 +33,6 @@ - [ExtendedHeader](#object.ExtendedHeader) - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) - - [Link](#object.Link) - [Object](#object.Object) - [PublicKey](#object.PublicKey) - [SplitHeader](#object.SplitHeader) @@ -381,7 +380,6 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Link | [Link](#object.Link) | | Link to other objects | | Redirect | [refs.Address](#refs.Address) | | Redirect not used yet | | Attribute | [Attribute](#object.Attribute) | | Attribute is a set of K-V object attributes | | SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | @@ -418,18 +416,6 @@ Header groups the information about the NeoFS object. | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | - - -### Message Link - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [Link.Type](#object.Link.Type) | | Type of link | -| ID | [bytes](#bytes) | | ID is an object identifier, is a valid UUIDv4 | - - ### Message Object @@ -491,21 +477,6 @@ SplitHeader groups information about spawning the object through a payload split - - -### Link.Type - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | | -| Parent | 1 | Parent object created during object transformation | -| Previous | 2 | Previous object in the linked list created during object transformation | -| Next | 3 | Next object in the linked list created during object transformation | -| Child | 4 | Child object created during object transformation | -| StorageGroup | 5 | Object that included into this storage group | - - From 0a5f3d5a0158dc3155b6d6828a312a4416a70150 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 17:40:24 +0300 Subject: [PATCH 086/440] [#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 --- object/types.proto | 2 -- proto-docs/object.md | 1 - 2 files changed, 3 deletions(-) diff --git a/object/types.proto b/object/types.proto index 2437ca9..be4afa4 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,8 +17,6 @@ message Attribute { } message ExtendedHeader { - // Redirect not used yet - refs.Address Redirect = 2; // Attribute is a set of K-V object attributes Attribute Attribute = 3; // Split carries the position of the object in the split hierarchy. diff --git a/proto-docs/object.md b/proto-docs/object.md index 9c77114..3ffd4b3 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -380,7 +380,6 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Redirect | [refs.Address](#refs.Address) | | Redirect not used yet | | Attribute | [Attribute](#object.Attribute) | | Attribute is a set of K-V object attributes | | SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | From b77811716e09c789dba53067f145bc9e5951f09f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 18:16:53 +0300 Subject: [PATCH 087/440] [#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 --- object/types.proto | 11 +++-------- proto-docs/object.md | 15 +-------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/object/types.proto b/object/types.proto index be4afa4..b64f75f 100644 --- a/object/types.proto +++ b/object/types.proto @@ -33,8 +33,6 @@ message ExtendedHeader { IntegrityHeader Integrity = 9; // StorageGroup contains meta information for the data audit storagegroup.StorageGroup StorageGroup = 10; - // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. - PublicKey PublicKey = 11; } message Tombstone {} @@ -54,8 +52,10 @@ message SystemHeader { message IntegrityHeader { // HeadersChecksum is a checksum of all above headers in the object bytes HeadersChecksum = 1; + // CreatorKey carries public key of the object creator in a binary format. + bytes CreatorKey = 2; // ChecksumSignature is an user's signature of checksum to verify if it is correct - bytes ChecksumSignature = 2; + bytes ChecksumSignature = 3; } // SplitHeader groups information about spawning the object through a payload splitting. @@ -91,8 +91,3 @@ message Object { // Payload is an object's payload bytes Payload = 2; } - -message PublicKey { - // Value contains marshaled ecdsa public key - bytes Value = 1; -} diff --git a/proto-docs/object.md b/proto-docs/object.md index 3ffd4b3..0f462e0 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -34,7 +34,6 @@ - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) - [Object](#object.Object) - - [PublicKey](#object.PublicKey) - [SplitHeader](#object.SplitHeader) - [SystemHeader](#object.SystemHeader) - [Tombstone](#object.Tombstone) @@ -388,7 +387,6 @@ Attribute groups the parameters of the object attributes. | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | -| PublicKey | [PublicKey](#object.PublicKey) | | PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. | @@ -412,6 +410,7 @@ Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | HeadersChecksum | [bytes](#bytes) | | HeadersChecksum is a checksum of all above headers in the object | +| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | @@ -427,17 +426,6 @@ Header groups the information about the NeoFS object. | Payload | [bytes](#bytes) | | Payload is an object's payload | - - -### Message PublicKey - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Value | [bytes](#bytes) | | Value contains marshaled ecdsa public key | - - ### Message SplitHeader @@ -475,7 +463,6 @@ SplitHeader groups information about spawning the object through a payload split - From fb2064803e96ce6171fc018f5a4eb7e10da27c65 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 18:48:15 +0300 Subject: [PATCH 088/440] [#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 --- object/types.proto | 20 ++++++++++++++------ proto-docs/object.md | 4 ++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/object/types.proto b/object/types.proto index b64f75f..0baf35a 100644 --- a/object/types.proto +++ b/object/types.proto @@ -27,8 +27,6 @@ message ExtendedHeader { service.Token Token = 6; // HomoHash is a homomorphic hash of original object payload bytes HomoHash = 7; - // PayloadChecksum of actual object's payload - bytes PayloadChecksum = 8; // Integrity header with checksum of all above headers in the object IntegrityHeader Integrity = 9; // StorageGroup contains meta information for the data audit @@ -50,12 +48,22 @@ message SystemHeader { } message IntegrityHeader { - // HeadersChecksum is a checksum of all above headers in the object - bytes HeadersChecksum = 1; + // PayloadChecksum carries the checksum of object payload bytes. + // Changing any byte of the payload changes the checksum. + // It is calculated as a SHA-256 hash over payload bytes. + bytes PayloadChecksum = 1; + // HeaderChecksum carries checksum of the object header structure. + // It covers all object attributes. Changing any field of the object except + // CreatorKey and ChecksumSignature changes the checksum. + // PayloadChecksum and HeaderChecksum cannot be merged due to the need + // to verify the header in the absence of a payload (e.g. in object.Head rpc). + // It is calculated as a SHA-256 hash over marshaled object header + // with cut CreatorKey and ChecksumSignature. + bytes HeaderChecksum = 2; // CreatorKey carries public key of the object creator in a binary format. - bytes CreatorKey = 2; + bytes CreatorKey = 3; // ChecksumSignature is an user's signature of checksum to verify if it is correct - bytes ChecksumSignature = 3; + bytes ChecksumSignature = 4; } // SplitHeader groups information about spawning the object through a payload splitting. diff --git a/proto-docs/object.md b/proto-docs/object.md index 0f462e0..fc95f02 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -384,7 +384,6 @@ Attribute groups the parameters of the object attributes. | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | | Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | -| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum of actual object's payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | @@ -409,7 +408,8 @@ Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| HeadersChecksum | [bytes](#bytes) | | HeadersChecksum is a checksum of all above headers in the object | +| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. | +| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). | | CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | From a28decac3906bec532331b7c7811a7120ef190b1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 18:59:21 +0300 Subject: [PATCH 089/440] [#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 --- object/types.proto | 4 ++-- proto-docs/object.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/object/types.proto b/object/types.proto index 0baf35a..68c42e4 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,8 +17,8 @@ message Attribute { } message ExtendedHeader { - // Attribute is a set of K-V object attributes - Attribute Attribute = 3; + // Attributes carries list of the object attributes in a string key-value format. + repeated Attribute Attributes = 3; // Split carries the position of the object in the split hierarchy. SplitHeader SplitHeader = 4; // Tombstone header that set up in deleted objects diff --git a/proto-docs/object.md b/proto-docs/object.md index fc95f02..73e2a75 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -379,7 +379,7 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Attribute | [Attribute](#object.Attribute) | | Attribute is a set of K-V object attributes | +| Attributes | [Attribute](#object.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | | SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | | Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | @@ -408,8 +408,8 @@ Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. | -| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). | +| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | +| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut CreatorKey and ChecksumSignature. | | CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | From 8e8d9f09828ea811bbd64c14fe3ee10b2fb61bee Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 19:03:44 +0300 Subject: [PATCH 090/440] [#26] object: Replace Epoch to ExtendedHeader This commit replaces CreationEpoch field to ExtendedHeader message. Signed-off-by: Leonard Lyubich --- object/types.proto | 4 ++-- proto-docs/object.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/object/types.proto b/object/types.proto index 68c42e4..33e6bfa 100644 --- a/object/types.proto +++ b/object/types.proto @@ -31,6 +31,8 @@ message ExtendedHeader { IntegrityHeader Integrity = 9; // StorageGroup contains meta information for the data audit storagegroup.StorageGroup StorageGroup = 10; + // CreationEpoch carries number of NeoFS epoch on which the object was created. + uint64 CreationEpoch = 11; } message Tombstone {} @@ -43,8 +45,6 @@ message SystemHeader { refs.Address Address = 2; // OwnerID is a wallet address bytes OwnerID = 3; - // CreationEpoch carries number of NeoFS epoch on which the object was created. - uint64 CreationEpoch = 4; } message IntegrityHeader { diff --git a/proto-docs/object.md b/proto-docs/object.md index 73e2a75..eb108b6 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -386,6 +386,7 @@ Attribute groups the parameters of the object attributes. | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | +| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | @@ -452,7 +453,6 @@ SplitHeader groups information about spawning the object through a payload split | PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | From a3a0de01b3a96d6854d9d590cbbdcc607b448f0e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 19:17:46 +0300 Subject: [PATCH 091/440] [#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 --- object/types.proto | 10 ++++++---- proto-docs/object.md | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/object/types.proto b/object/types.proto index 33e6bfa..dc349ce 100644 --- a/object/types.proto +++ b/object/types.proto @@ -23,8 +23,6 @@ message ExtendedHeader { SplitHeader SplitHeader = 4; // Tombstone header that set up in deleted objects Tombstone Tombstone = 5; - // Token header contains token of the session within which the object was created - service.Token Token = 6; // HomoHash is a homomorphic hash of original object payload bytes HomoHash = 7; // Integrity header with checksum of all above headers in the object @@ -60,10 +58,14 @@ message IntegrityHeader { // It is calculated as a SHA-256 hash over marshaled object header // with cut CreatorKey and ChecksumSignature. bytes HeaderChecksum = 2; + // SessionToken carries token of the session within which the object was created. + // If session token is presented in object, it acts as the user's proof of the + // correctness of the CreatorKey. + service.Token SessionToken = 3; // CreatorKey carries public key of the object creator in a binary format. - bytes CreatorKey = 3; + bytes CreatorKey = 4; // ChecksumSignature is an user's signature of checksum to verify if it is correct - bytes ChecksumSignature = 4; + bytes ChecksumSignature = 5; } // SplitHeader groups information about spawning the object through a payload splitting. diff --git a/proto-docs/object.md b/proto-docs/object.md index eb108b6..bd9da34 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -382,7 +382,6 @@ Attribute groups the parameters of the object attributes. | Attributes | [Attribute](#object.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | | SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | -| Token | [service.Token](#service.Token) | | Token header contains token of the session within which the object was created | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | | Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | @@ -411,6 +410,7 @@ Header groups the information about the NeoFS object. | ----- | ---- | ----- | ----------- | | PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | | HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut CreatorKey and ChecksumSignature. | +| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. | | CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | From 72edea28db209d6baf62c24414bff0abb450c77c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 19:48:15 +0300 Subject: [PATCH 092/440] [#26] object: Change field order in Header This commit changes field order in ExtendedHeader message. Signed-off-by: Leonard Lyubich --- object/types.proto | 24 ++++++++++++------------ proto-docs/object.md | 6 +++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/object/types.proto b/object/types.proto index dc349ce..33f8147 100644 --- a/object/types.proto +++ b/object/types.proto @@ -17,20 +17,20 @@ message Attribute { } message ExtendedHeader { - // Attributes carries list of the object attributes in a string key-value format. - repeated Attribute Attributes = 3; - // Split carries the position of the object in the split hierarchy. - SplitHeader SplitHeader = 4; - // Tombstone header that set up in deleted objects - Tombstone Tombstone = 5; - // HomoHash is a homomorphic hash of original object payload - bytes HomoHash = 7; // Integrity header with checksum of all above headers in the object - IntegrityHeader Integrity = 9; - // StorageGroup contains meta information for the data audit - storagegroup.StorageGroup StorageGroup = 10; + IntegrityHeader Integrity = 1; + // Attributes carries list of the object attributes in a string key-value format. + repeated Attribute Attributes = 2; // CreationEpoch carries number of NeoFS epoch on which the object was created. - uint64 CreationEpoch = 11; + uint64 CreationEpoch = 3; + // Tombstone header that set up in deleted objects + Tombstone Tombstone = 4; + // HomoHash is a homomorphic hash of original object payload + bytes HomoHash = 5; + // StorageGroup contains meta information for the data audit + storagegroup.StorageGroup StorageGroup = 6; + // Split carries the position of the object in the split hierarchy. + SplitHeader SplitHeader = 7; } message Tombstone {} diff --git a/proto-docs/object.md b/proto-docs/object.md index bd9da34..4708165 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -379,13 +379,13 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | Attributes | [Attribute](#object.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | -| SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | +| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | | Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | | HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | -| Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | -| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | +| SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | From 81a4adb202370a05867cab980066406b961c8b50 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 23:36:24 +0300 Subject: [PATCH 093/440] [#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 --- object/types.proto | 126 ++++++++++++++++++++++--------------------- proto-docs/object.md | 106 ++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 115 deletions(-) diff --git a/object/types.proto b/object/types.proto index 33f8147..d22a938 100644 --- a/object/types.proto +++ b/object/types.proto @@ -7,33 +7,76 @@ import "refs/types.proto"; import "service/verify.proto"; import "storagegroup/types.proto"; -// Attribute groups the parameters of the object attributes. -message Attribute { - // Key carries the string key to the object attribute. - string Key = 1; - - // Value carries the string value of the object attribute. - string Value = 2; -} - message ExtendedHeader { - // Integrity header with checksum of all above headers in the object - IntegrityHeader Integrity = 1; + // Integrity groups evidence of the integrity of an object's structure. + message Integrity { + // PayloadChecksum carries the checksum of object payload bytes. + // Changing any byte of the payload changes the checksum. + // It is calculated as a SHA-256 hash over payload bytes. + bytes PayloadChecksum = 1; + // HeaderChecksum carries checksum of the object header structure. + // It covers all object attributes. Changing any field of the object except + // CreatorKey and ChecksumSignature changes the checksum. + // PayloadChecksum and HeaderChecksum cannot be merged due to the need + // to verify the header in the absence of a payload (e.g. in object.Head rpc). + // It is calculated as a SHA-256 hash over marshaled object header + // with cut CreatorKey and ChecksumSignature. + bytes HeaderChecksum = 2; + // SessionToken carries token of the session within which the object was created. + // If session token is presented in object, it acts as the user's proof of the + // correctness of the CreatorKey. + service.Token SessionToken = 3; + // CreatorKey carries public key of the object creator in a binary format. + bytes CreatorKey = 4; + // ChecksumSignature carries signature of the structure checksum by the object creator. + bytes ChecksumSignature = 5; + } + // Integrity carries object integrity evidence. + Integrity integrity = 1; + + // Attribute groups the parameters of the object attributes. + message Attribute { + // Key carries the string key to the object attribute. + string Key = 1; + + // Value carries the string value of the object attribute. + string Value = 2; + } // Attributes carries list of the object attributes in a string key-value format. repeated Attribute Attributes = 2; // CreationEpoch carries number of NeoFS epoch on which the object was created. uint64 CreationEpoch = 3; - // Tombstone header that set up in deleted objects - Tombstone Tombstone = 4; - // HomoHash is a homomorphic hash of original object payload - bytes HomoHash = 5; - // StorageGroup contains meta information for the data audit - storagegroup.StorageGroup StorageGroup = 6; - // Split carries the position of the object in the split hierarchy. - SplitHeader SplitHeader = 7; -} -message Tombstone {} + // Tombstone groups the options for deleting an object. + message Tombstone { + } + // Tombstone marks the object to be deleted. + Tombstone tombstone = 4; + // HomomorphicHash carries homomorphic hash of the object payload. + bytes HomomorphicHash = 5; + // StorageGroup carries information about the NeoFS storage group. + storagegroup.StorageGroup StorageGroup = 6; + + // Split groups information about spawning the object through a payload splitting. + message Split { + // Parent carries identifier of the origin object. + refs.ObjectID Parent = 1; + + // Previous carries identifier of the left split neighbor. + refs.ObjectID Previous = 2; + + // Previous carries identifier of the right split neighbor. + refs.ObjectID Next = 3; + + // Children carries list of identifiers of the objects generated by splitting the current. + repeated refs.ObjectID Children = 4; + + // Origin carries the header of the origin object. + Header Origin = 5; + } + // Split carries the position of the object in the split hierarchy. + Split split = 7; +} message SystemHeader { // PayloadLength is an object payload length @@ -45,47 +88,6 @@ message SystemHeader { bytes OwnerID = 3; } -message IntegrityHeader { - // PayloadChecksum carries the checksum of object payload bytes. - // Changing any byte of the payload changes the checksum. - // It is calculated as a SHA-256 hash over payload bytes. - bytes PayloadChecksum = 1; - // HeaderChecksum carries checksum of the object header structure. - // It covers all object attributes. Changing any field of the object except - // CreatorKey and ChecksumSignature changes the checksum. - // PayloadChecksum and HeaderChecksum cannot be merged due to the need - // to verify the header in the absence of a payload (e.g. in object.Head rpc). - // It is calculated as a SHA-256 hash over marshaled object header - // with cut CreatorKey and ChecksumSignature. - bytes HeaderChecksum = 2; - // SessionToken carries token of the session within which the object was created. - // If session token is presented in object, it acts as the user's proof of the - // correctness of the CreatorKey. - service.Token SessionToken = 3; - // CreatorKey carries public key of the object creator in a binary format. - bytes CreatorKey = 4; - // ChecksumSignature is an user's signature of checksum to verify if it is correct - bytes ChecksumSignature = 5; -} - -// SplitHeader groups information about spawning the object through a payload splitting. -message SplitHeader { - // Parent carries identifier of the origin object. - refs.ObjectID Parent = 1; - - // Previous carries identifier of the left split neighbor. - refs.ObjectID Previous = 2; - - // Previous carries identifier of the right split neighbor. - refs.ObjectID Next = 3; - - // Children carries list of identifiers of the objects generated by splitting the current. - repeated refs.ObjectID Children = 4; - - // Origin carries the header of the origin object. - Header Origin = 5; -} - // Header groups the information about the NeoFS object. message Header { // SystemHeader describes system header diff --git a/proto-docs/object.md b/proto-docs/object.md index 4708165..256c20a 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -29,14 +29,14 @@ - [object/types.proto](#object/types.proto) - Messages - - [Attribute](#object.Attribute) - [ExtendedHeader](#object.ExtendedHeader) + - [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute) + - [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity) + - [ExtendedHeader.Split](#object.ExtendedHeader.Split) + - [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone) - [Header](#object.Header) - - [IntegrityHeader](#object.IntegrityHeader) - [Object](#object.Object) - - [SplitHeader](#object.SplitHeader) - [SystemHeader](#object.SystemHeader) - - [Tombstone](#object.Tombstone) - [Scalar Value Types](#scalar-value-types) @@ -359,9 +359,26 @@ in distributed system. - + -### Message Attribute +### Message ExtendedHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| integrity | [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity) | | Integrity carries object integrity evidence. | +| Attributes | [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | +| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | +| tombstone | [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone) | | Tombstone marks the object to be deleted. | +| HomomorphicHash | [bytes](#bytes) | | HomomorphicHash carries homomorphic hash of the object payload. | +| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup carries information about the NeoFS storage group. | +| split | [ExtendedHeader.Split](#object.ExtendedHeader.Split) | | Split carries the position of the object in the split hierarchy. | + + + + +### Message ExtendedHeader.Attribute Attribute groups the parameters of the object attributes. @@ -371,21 +388,41 @@ Attribute groups the parameters of the object attributes. | Value | [string](#string) | | Value carries the string value of the object attribute. | - - -### Message ExtendedHeader + +### Message ExtendedHeader.Integrity +Integrity groups evidence of the integrity of an object's structure. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object | -| Attributes | [Attribute](#object.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | -| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | -| Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects | -| HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload | -| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit | -| SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. | +| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | +| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut CreatorKey and ChecksumSignature. | +| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. | +| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | +| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature carries signature of the structure checksum by the object creator. | + + + + +### Message ExtendedHeader.Split +Split groups information about spawning the object through a payload splitting. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | +| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | +| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. | +| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | +| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | + + + + +### Message ExtendedHeader.Tombstone +Tombstone groups the options for deleting an object. + @@ -400,21 +437,6 @@ Header groups the information about the NeoFS object. | ExtendedHeader | [ExtendedHeader](#object.ExtendedHeader) | | ExtendedHeader carries the additional part of the header. | - - -### Message IntegrityHeader - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | -| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut CreatorKey and ChecksumSignature. | -| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. | -| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | -| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct | - - ### Message Object @@ -427,21 +449,6 @@ Header groups the information about the NeoFS object. | Payload | [bytes](#bytes) | | Payload is an object's payload | - - -### Message SplitHeader -SplitHeader groups information about spawning the object through a payload splitting. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | -| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | -| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. | -| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | -| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | - - ### Message SystemHeader @@ -454,13 +461,6 @@ SplitHeader groups information about spawning the object through a payload split | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | - - - -### Message Tombstone - - - From 0525786d0903f5b4bae04223b9ca3488370c92f4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 23:43:33 +0300 Subject: [PATCH 094/440] [#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 --- object/types.proto | 175 ++++++++++++++++++++++--------------------- proto-docs/object.md | 81 ++++++++++---------- 2 files changed, 132 insertions(+), 124 deletions(-) diff --git a/object/types.proto b/object/types.proto index d22a938..bdbf17e 100644 --- a/object/types.proto +++ b/object/types.proto @@ -7,94 +7,99 @@ import "refs/types.proto"; import "service/verify.proto"; import "storagegroup/types.proto"; -message ExtendedHeader { - // Integrity groups evidence of the integrity of an object's structure. - message Integrity { - // PayloadChecksum carries the checksum of object payload bytes. - // Changing any byte of the payload changes the checksum. - // It is calculated as a SHA-256 hash over payload bytes. - bytes PayloadChecksum = 1; - // HeaderChecksum carries checksum of the object header structure. - // It covers all object attributes. Changing any field of the object except - // CreatorKey and ChecksumSignature changes the checksum. - // PayloadChecksum and HeaderChecksum cannot be merged due to the need - // to verify the header in the absence of a payload (e.g. in object.Head rpc). - // It is calculated as a SHA-256 hash over marshaled object header - // with cut CreatorKey and ChecksumSignature. - bytes HeaderChecksum = 2; - // SessionToken carries token of the session within which the object was created. - // If session token is presented in object, it acts as the user's proof of the - // correctness of the CreatorKey. - service.Token SessionToken = 3; - // CreatorKey carries public key of the object creator in a binary format. - bytes CreatorKey = 4; - // ChecksumSignature carries signature of the structure checksum by the object creator. - bytes ChecksumSignature = 5; - } - // Integrity carries object integrity evidence. - Integrity integrity = 1; - - // Attribute groups the parameters of the object attributes. - message Attribute { - // Key carries the string key to the object attribute. - string Key = 1; - - // Value carries the string value of the object attribute. - string Value = 2; - } - // Attributes carries list of the object attributes in a string key-value format. - repeated Attribute Attributes = 2; - // CreationEpoch carries number of NeoFS epoch on which the object was created. - uint64 CreationEpoch = 3; - - // Tombstone groups the options for deleting an object. - message Tombstone { - } - // Tombstone marks the object to be deleted. - Tombstone tombstone = 4; - // HomomorphicHash carries homomorphic hash of the object payload. - bytes HomomorphicHash = 5; - // StorageGroup carries information about the NeoFS storage group. - storagegroup.StorageGroup StorageGroup = 6; - - // Split groups information about spawning the object through a payload splitting. - message Split { - // Parent carries identifier of the origin object. - refs.ObjectID Parent = 1; - - // Previous carries identifier of the left split neighbor. - refs.ObjectID Previous = 2; - - // Previous carries identifier of the right split neighbor. - refs.ObjectID Next = 3; - - // Children carries list of identifiers of the objects generated by splitting the current. - repeated refs.ObjectID Children = 4; - - // Origin carries the header of the origin object. - Header Origin = 5; - } - // Split carries the position of the object in the split hierarchy. - Split split = 7; -} - -message SystemHeader { - // PayloadLength is an object payload length - uint64 PayloadLength = 1; - // Address carries object address in the NeoFS system. - // It encapsulates the object and the container identifiers. - refs.Address Address = 2; - // OwnerID is a wallet address - bytes OwnerID = 3; -} - // Header groups the information about the NeoFS object. message Header { - // SystemHeader describes system header - SystemHeader SystemHeader = 1; + // System groups mandatory information about the object. + // Message fields are presented in all NeoFS objects. + message System { + // PayloadLength is an object payload length + uint64 PayloadLength = 1; + // Address carries object address in the NeoFS system. + // It encapsulates the object and the container identifiers. + refs.Address Address = 2; + // OwnerID is a wallet address + bytes OwnerID = 3; + } + // System carries the main part of the header. + // System MUST NOT be NULL. + System system = 1; - // ExtendedHeader carries the additional part of the header. - ExtendedHeader ExtendedHeader = 2; + // Extended groups additional information about the object. + // It encapsulates both user and system attributes needed to regulate + // the NeoFS sub-systems. + message Extended { + // Integrity groups evidence of the integrity of an object's structure. + message Integrity { + // PayloadChecksum carries the checksum of object payload bytes. + // Changing any byte of the payload changes the checksum. + // It is calculated as a SHA-256 hash over payload bytes. + bytes PayloadChecksum = 1; + // HeaderChecksum carries checksum of the object header structure. + // It covers all object attributes. Changing any field of the object except + // CreatorKey and ChecksumSignature changes the checksum. + // PayloadChecksum and HeaderChecksum cannot be merged due to the need + // to verify the header in the absence of a payload (e.g. in object.Head rpc). + // It is calculated as a SHA-256 hash over marshaled object header + // with cut CreatorKey and ChecksumSignature. + bytes HeaderChecksum = 2; + // SessionToken carries token of the session within which the object was created. + // If session token is presented in object, it acts as the user's proof of the + // correctness of the CreatorKey. + service.Token SessionToken = 3; + // CreatorKey carries public key of the object creator in a binary format. + bytes CreatorKey = 4; + // ChecksumSignature carries signature of the structure checksum by the object creator. + bytes ChecksumSignature = 5; + } + // Integrity carries object integrity evidence. + Integrity integrity = 1; + + // Attribute groups the parameters of the object attributes. + message Attribute { + // Key carries the string key to the object attribute. + string Key = 1; + + // Value carries the string value of the object attribute. + string Value = 2; + } + // Attributes carries list of the object attributes in a string key-value format. + repeated Attribute Attributes = 2; + // CreationEpoch carries number of NeoFS epoch on which the object was created. + uint64 CreationEpoch = 3; + + // Tombstone groups the options for deleting an object. + message Tombstone { + } + // Tombstone marks the object to be deleted. + Tombstone tombstone = 4; + // HomomorphicHash carries homomorphic hash of the object payload. + bytes HomomorphicHash = 5; + // StorageGroup carries information about the NeoFS storage group. + storagegroup.StorageGroup StorageGroup = 6; + + // Split groups information about spawning the object through a payload splitting. + message Split { + // Parent carries identifier of the origin object. + refs.ObjectID Parent = 1; + + // Previous carries identifier of the left split neighbor. + refs.ObjectID Previous = 2; + + // Previous carries identifier of the right split neighbor. + refs.ObjectID Next = 3; + + // Children carries list of identifiers of the objects generated by splitting the current. + repeated refs.ObjectID Children = 4; + + // Origin carries the header of the origin object. + Header Origin = 5; + } + // Split carries the position of the object in the split hierarchy. + Split split = 7; + } + + // Extended carries the additional part of the header. + Extended extended = 2; } message Object { diff --git a/proto-docs/object.md b/proto-docs/object.md index 256c20a..59d8548 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -29,14 +29,14 @@ - [object/types.proto](#object/types.proto) - Messages - - [ExtendedHeader](#object.ExtendedHeader) - - [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute) - - [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity) - - [ExtendedHeader.Split](#object.ExtendedHeader.Split) - - [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone) - [Header](#object.Header) + - [Header.Extended](#object.Header.Extended) + - [Header.Extended.Attribute](#object.Header.Extended.Attribute) + - [Header.Extended.Integrity](#object.Header.Extended.Integrity) + - [Header.Extended.Split](#object.Header.Extended.Split) + - [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) + - [Header.System](#object.Header.System) - [Object](#object.Object) - - [SystemHeader](#object.SystemHeader) - [Scalar Value Types](#scalar-value-types) @@ -359,26 +359,40 @@ in distributed system. - - -### Message ExtendedHeader + +### Message Header +Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| integrity | [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity) | | Integrity carries object integrity evidence. | -| Attributes | [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | +| system | [Header.System](#object.Header.System) | | System carries the main part of the header. System MUST NOT be NULL. | +| extended | [Header.Extended](#object.Header.Extended) | | Extended carries the additional part of the header. | + + + + +### Message Header.Extended +Extended groups additional information about the object. +It encapsulates both user and system attributes needed to regulate +the NeoFS sub-systems. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| integrity | [Header.Extended.Integrity](#object.Header.Extended.Integrity) | | Integrity carries object integrity evidence. | +| Attributes | [Header.Extended.Attribute](#object.Header.Extended.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | | CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | -| tombstone | [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone) | | Tombstone marks the object to be deleted. | +| tombstone | [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) | | Tombstone marks the object to be deleted. | | HomomorphicHash | [bytes](#bytes) | | HomomorphicHash carries homomorphic hash of the object payload. | | StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup carries information about the NeoFS storage group. | -| split | [ExtendedHeader.Split](#object.ExtendedHeader.Split) | | Split carries the position of the object in the split hierarchy. | +| split | [Header.Extended.Split](#object.Header.Extended.Split) | | Split carries the position of the object in the split hierarchy. | - + -### Message ExtendedHeader.Attribute +### Message Header.Extended.Attribute Attribute groups the parameters of the object attributes. @@ -388,9 +402,9 @@ Attribute groups the parameters of the object attributes. | Value | [string](#string) | | Value carries the string value of the object attribute. | - + -### Message ExtendedHeader.Integrity +### Message Header.Extended.Integrity Integrity groups evidence of the integrity of an object's structure. @@ -403,9 +417,9 @@ Integrity groups evidence of the integrity of an object's structure. | ChecksumSignature | [bytes](#bytes) | | ChecksumSignature carries signature of the structure checksum by the object creator. | - + -### Message ExtendedHeader.Split +### Message Header.Extended.Split Split groups information about spawning the object through a payload splitting. @@ -418,23 +432,25 @@ Split groups information about spawning the object through a payload splitting. | Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | - + -### Message ExtendedHeader.Tombstone +### Message Header.Extended.Tombstone Tombstone groups the options for deleting an object. - + -### Message Header -Header groups the information about the NeoFS object. +### Message Header.System +System groups mandatory information about the object. +Message fields are presented in all NeoFS objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | -| ExtendedHeader | [ExtendedHeader](#object.ExtendedHeader) | | ExtendedHeader carries the additional part of the header. | +| PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | +| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | +| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | @@ -448,19 +464,6 @@ Header groups the information about the NeoFS object. | Header | [Header](#object.Header) | | Header carries the object header. | | Payload | [bytes](#bytes) | | Payload is an object's payload | - - - -### Message SystemHeader - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | -| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | - From eaad094a2c6b4d673c0416da02858d67104f8de7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 23:54:26 +0300 Subject: [PATCH 095/440] [#26] object: Tidy up comments Signed-off-by: Leonard Lyubich --- object/types.proto | 9 ++++++--- proto-docs/object.md | 9 +++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/object/types.proto b/object/types.proto index bdbf17e..0a5c688 100644 --- a/object/types.proto +++ b/object/types.proto @@ -12,12 +12,13 @@ message Header { // System groups mandatory information about the object. // Message fields are presented in all NeoFS objects. message System { - // PayloadLength is an object payload length + // PayloadLength carries length of the object payload. + // Each object has a fixed payload length since it's immutable. uint64 PayloadLength = 1; // Address carries object address in the NeoFS system. // It encapsulates the object and the container identifiers. refs.Address Address = 2; - // OwnerID is a wallet address + // OwnerID carries identifier the object owner in a binary format. bytes OwnerID = 3; } // System carries the main part of the header. @@ -102,9 +103,11 @@ message Header { Extended extended = 2; } +// Object groups the information about the NeoFS object. +// It consists of payload data with additional service information. message Object { // Header carries the object header. Header Header = 1; - // Payload is an object's payload + // Payload carries the object payload bytes. bytes Payload = 2; } diff --git a/proto-docs/object.md b/proto-docs/object.md index 59d8548..864d852 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -448,21 +448,22 @@ Message fields are presented in all NeoFS objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| PayloadLength | [uint64](#uint64) | | PayloadLength is an object payload length | +| PayloadLength | [uint64](#uint64) | | PayloadLength carries length of the object payload. Each object has a fixed payload length since it's immutable. | | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| OwnerID | [bytes](#bytes) | | OwnerID carries identifier the object owner in a binary format. | ### Message Object - +Object groups the information about the NeoFS object. +It consists of payload data with additional service information. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Header | [Header](#object.Header) | | Header carries the object header. | -| Payload | [bytes](#bytes) | | Payload is an object's payload | +| Payload | [bytes](#bytes) | | Payload carries the object payload bytes. | From a5c1b3683b601a3ad19c183b8442568b47b37b6e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 00:08:56 +0300 Subject: [PATCH 096/440] [#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 --- object/types.proto | 10 +++++----- proto-docs/object.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/object/types.proto b/object/types.proto index 0a5c688..a6505c0 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,9 +9,9 @@ import "storagegroup/types.proto"; // Header groups the information about the NeoFS object. message Header { - // System groups mandatory information about the object. + // Main groups mandatory information about the object. // Message fields are presented in all NeoFS objects. - message System { + message Main { // PayloadLength carries length of the object payload. // Each object has a fixed payload length since it's immutable. uint64 PayloadLength = 1; @@ -21,9 +21,9 @@ message Header { // OwnerID carries identifier the object owner in a binary format. bytes OwnerID = 3; } - // System carries the main part of the header. - // System MUST NOT be NULL. - System system = 1; + // Main carries the main part of the header. + // Main MUST NOT be NULL. + Main main = 1; // Extended groups additional information about the object. // It encapsulates both user and system attributes needed to regulate diff --git a/proto-docs/object.md b/proto-docs/object.md index 864d852..9dc303a 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -35,7 +35,7 @@ - [Header.Extended.Integrity](#object.Header.Extended.Integrity) - [Header.Extended.Split](#object.Header.Extended.Split) - [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) - - [Header.System](#object.Header.System) + - [Header.Main](#object.Header.Main) - [Object](#object.Object) @@ -367,7 +367,7 @@ Header groups the information about the NeoFS object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| system | [Header.System](#object.Header.System) | | System carries the main part of the header. System MUST NOT be NULL. | +| main | [Header.Main](#object.Header.Main) | | Main carries the main part of the header. Main MUST NOT be NULL. | | extended | [Header.Extended](#object.Header.Extended) | | Extended carries the additional part of the header. | @@ -439,10 +439,10 @@ Tombstone groups the options for deleting an object. - + -### Message Header.System -System groups mandatory information about the object. +### Message Header.Main +Main groups mandatory information about the object. Message fields are presented in all NeoFS objects. From 974a2288c46288525e82a6dfdeac82426b312105 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 00:10:51 +0300 Subject: [PATCH 097/440] [#26] object: Add line breaks for readability Signed-off-by: Leonard Lyubich --- object/types.proto | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/object/types.proto b/object/types.proto index a6505c0..4a11b82 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package object; + option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; @@ -21,6 +23,7 @@ message Header { // OwnerID carries identifier the object owner in a binary format. bytes OwnerID = 3; } + // Main carries the main part of the header. // Main MUST NOT be NULL. Main main = 1; @@ -35,6 +38,7 @@ message Header { // Changing any byte of the payload changes the checksum. // It is calculated as a SHA-256 hash over payload bytes. bytes PayloadChecksum = 1; + // HeaderChecksum carries checksum of the object header structure. // It covers all object attributes. Changing any field of the object except // CreatorKey and ChecksumSignature changes the checksum. @@ -43,15 +47,19 @@ message Header { // It is calculated as a SHA-256 hash over marshaled object header // with cut CreatorKey and ChecksumSignature. bytes HeaderChecksum = 2; + // SessionToken carries token of the session within which the object was created. // If session token is presented in object, it acts as the user's proof of the // correctness of the CreatorKey. service.Token SessionToken = 3; + // CreatorKey carries public key of the object creator in a binary format. bytes CreatorKey = 4; + // ChecksumSignature carries signature of the structure checksum by the object creator. bytes ChecksumSignature = 5; } + // Integrity carries object integrity evidence. Integrity integrity = 1; @@ -63,18 +71,23 @@ message Header { // Value carries the string value of the object attribute. string Value = 2; } + // Attributes carries list of the object attributes in a string key-value format. repeated Attribute Attributes = 2; + // CreationEpoch carries number of NeoFS epoch on which the object was created. uint64 CreationEpoch = 3; // Tombstone groups the options for deleting an object. message Tombstone { } + // Tombstone marks the object to be deleted. Tombstone tombstone = 4; + // HomomorphicHash carries homomorphic hash of the object payload. bytes HomomorphicHash = 5; + // StorageGroup carries information about the NeoFS storage group. storagegroup.StorageGroup StorageGroup = 6; @@ -95,6 +108,7 @@ message Header { // Origin carries the header of the origin object. Header Origin = 5; } + // Split carries the position of the object in the split hierarchy. Split split = 7; } @@ -108,6 +122,7 @@ message Header { message Object { // Header carries the object header. Header Header = 1; + // Payload carries the object payload bytes. bytes Payload = 2; } From 248a91b3294d55a23ddcaca4c46598b24b2748ff Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 11:32:49 +0300 Subject: [PATCH 098/440] [#28] storagegroup: Remove gogoproto from typedef As mentioned in #32, there is a need to remove gogoproto usage from NeoFS API since this plugin is not cross-language. This commit removes usage from StorageGroup message and all related types Signed-off-by: Leonard Lyubich --- storagegroup/types.proto | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 711d72c..98604e6 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -3,18 +3,13 @@ package storagegroup; option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup"; option csharp_namespace = "NeoFS.API.StorageGroup"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "refs/types.proto"; -option (gogoproto.stable_marshaler_all) = true; - message StorageGroup { - option (gogoproto.goproto_stringer) = false; - // ValidationDataSize is size of the all object's payloads included into storage group uint64 ValidationDataSize = 1; // ValidationHash is homomorphic hash of all object's payloads included into storage group - bytes ValidationHash = 2 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; + bytes ValidationHash = 2; message Lifetime { enum Unit { @@ -27,13 +22,13 @@ message StorageGroup { } // Unit is lifetime type - Unit unit = 1 [(gogoproto.customname) = "Unit"]; + Unit unit = 1; // Value for lifetime int64 Value = 2; } // Lifetime is time until storage group is valid - Lifetime lifetime = 3 [(gogoproto.customname) = "Lifetime"]; + Lifetime lifetime = 3; // Members carries the list of identifiers of the object storage group members. // The list is strictly ordered. From 487b84e6144ef9e0b542afb57192c7c59745b6bb Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 11:41:51 +0300 Subject: [PATCH 099/440] [#28] storagegroup: Measure lifetime in NeoFS epochs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In previous version of the format storage group lifetime was measured in two epoch times: NeoFS and Unix. Since unix is not processed in the system, this commit narrows the time point of storage group expiration to the system epoch number. The storagegroup.StorageGroup.Lifetime message has therefore been deleted as no longer used. Signed-off-by: Leonard Lyubich --- proto-docs/storagegroup.md | 28 +--------------------------- storagegroup/types.proto | 20 ++------------------ 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index af34ee3..e1d27ae 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -7,7 +7,6 @@ - Messages - [StorageGroup](#storagegroup.StorageGroup) - - [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) - [Scalar Value Types](#scalar-value-types) @@ -33,36 +32,11 @@ | ----- | ---- | ----- | ----------- | | ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | | ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | -| lifetime | [StorageGroup.Lifetime](#storagegroup.StorageGroup.Lifetime) | | Lifetime is time until storage group is valid | +| ExpirationEpoch | [uint64](#uint64) | | ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. | | Members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | - - - -### Message StorageGroup.Lifetime - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| unit | [StorageGroup.Lifetime.Unit](#storagegroup.StorageGroup.Lifetime.Unit) | | Unit is lifetime type | -| Value | [int64](#int64) | | Value for lifetime | - - - - -### StorageGroup.Lifetime.Unit - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unlimited | 0 | Unlimited set if storage group always valid | -| NeoFSEpoch | 1 | NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch | -| UnixTime | 2 | UnixTime set if storage group is valid until lifetime unix timestamp | - - diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 98604e6..0848ac0 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -11,24 +11,8 @@ message StorageGroup { // ValidationHash is homomorphic hash of all object's payloads included into storage group bytes ValidationHash = 2; - message Lifetime { - enum Unit { - // Unlimited set if storage group always valid - Unlimited = 0; - // NeoFSEpoch set if storage group is valid until lifetime NeoFS epoch - NeoFSEpoch = 1; - // UnixTime set if storage group is valid until lifetime unix timestamp - UnixTime = 2; - } - - // Unit is lifetime type - Unit unit = 1; - // Value for lifetime - int64 Value = 2; - } - - // Lifetime is time until storage group is valid - Lifetime lifetime = 3; + // ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. + uint64 ExpirationEpoch = 3; // Members carries the list of identifiers of the object storage group members. // The list is strictly ordered. From d349faa60266c73f8b680fafe60d03a5661714a1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 11:48:26 +0300 Subject: [PATCH 100/440] [#28] storagegroup: Rewrite field comments Signed-off-by: Leonard Lyubich --- proto-docs/storagegroup.md | 7 ++++--- storagegroup/types.proto | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index e1d27ae..c209b86 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -25,13 +25,14 @@ ### Message StorageGroup - +StorageGroup groups the information about the NeoFS storage group. +The storage group consists of objects from single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize is size of the all object's payloads included into storage group | -| ValidationHash | [bytes](#bytes) | | ValidationHash is homomorphic hash of all object's payloads included into storage group | +| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize carries the total size of the payloads of the storage group members. | +| ValidationHash | [bytes](#bytes) | | ValidationHash carries homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the Members field. | | ExpirationEpoch | [uint64](#uint64) | | ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. | | Members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 0848ac0..af93a5f 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -5,10 +5,13 @@ option csharp_namespace = "NeoFS.API.StorageGroup"; import "refs/types.proto"; +// StorageGroup groups the information about the NeoFS storage group. +// The storage group consists of objects from single container. message StorageGroup { - // ValidationDataSize is size of the all object's payloads included into storage group + // ValidationDataSize carries the total size of the payloads of the storage group members. uint64 ValidationDataSize = 1; - // ValidationHash is homomorphic hash of all object's payloads included into storage group + // ValidationHash carries homomorphic hash from the concatenation of the payloads of the storage group members. + // The order of concatenation is the same as the order of the members in the Members field. bytes ValidationHash = 2; // ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. From 2ea912a9104736411bb6053c203bd9dc3a929437 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 11:49:51 +0300 Subject: [PATCH 101/440] [#28] storagegroup: Add linebreaks for readability Signed-off-by: Leonard Lyubich --- storagegroup/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storagegroup/types.proto b/storagegroup/types.proto index af93a5f..894db2e 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package storagegroup; + option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup"; option csharp_namespace = "NeoFS.API.StorageGroup"; @@ -10,6 +12,7 @@ import "refs/types.proto"; message StorageGroup { // ValidationDataSize carries the total size of the payloads of the storage group members. uint64 ValidationDataSize = 1; + // ValidationHash carries homomorphic hash from the concatenation of the payloads of the storage group members. // The order of concatenation is the same as the order of the members in the Members field. bytes ValidationHash = 2; From 67ecea75076cecd4623119ca4c6ead75c22a43ee Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 12:00:47 +0300 Subject: [PATCH 102/440] [#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 --- object/types.proto | 9 ++++++--- proto-docs/object.md | 10 +++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/object/types.proto b/object/types.proto index 4a11b82..3bab3b1 100644 --- a/object/types.proto +++ b/object/types.proto @@ -7,7 +7,6 @@ option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; import "service/verify.proto"; -import "storagegroup/types.proto"; // Header groups the information about the NeoFS object. message Header { @@ -88,8 +87,12 @@ message Header { // HomomorphicHash carries homomorphic hash of the object payload. bytes HomomorphicHash = 5; - // StorageGroup carries information about the NeoFS storage group. - storagegroup.StorageGroup StorageGroup = 6; + // StorageGroup groups meta information about a storage group. + message StorageGroup { + } + + // StorageGroup marks an object containing information about a storage group. + StorageGroup storageGroup = 6; // Split groups information about spawning the object through a payload splitting. message Split { diff --git a/proto-docs/object.md b/proto-docs/object.md index 9dc303a..29d9955 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -34,6 +34,7 @@ - [Header.Extended.Attribute](#object.Header.Extended.Attribute) - [Header.Extended.Integrity](#object.Header.Extended.Integrity) - [Header.Extended.Split](#object.Header.Extended.Split) + - [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) - [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) - [Header.Main](#object.Header.Main) - [Object](#object.Object) @@ -386,7 +387,7 @@ the NeoFS sub-systems. | CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | | tombstone | [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) | | Tombstone marks the object to be deleted. | | HomomorphicHash | [bytes](#bytes) | | HomomorphicHash carries homomorphic hash of the object payload. | -| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup carries information about the NeoFS storage group. | +| storageGroup | [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) | | StorageGroup marks an object containing information about a storage group. | | split | [Header.Extended.Split](#object.Header.Extended.Split) | | Split carries the position of the object in the split hierarchy. | @@ -432,6 +433,13 @@ Split groups information about spawning the object through a payload splitting. | Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | + + +### Message Header.Extended.StorageGroup +StorageGroup groups meta information about a storage group. + + + ### Message Header.Extended.Tombstone From 2f5f6f8fde8991d07e6193fb13aef975ec753b26 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 17:39:57 +0300 Subject: [PATCH 103/440] [#31] refs: Define ContainerID message Define ContainerID message in refs package. In the future, this structure can be ported into messages in place of the container identifier field to maintain format uniformity. Also, storing the identifier in a dedicated message will allow, if necessary, to expand it with additional information without losing backward compatibility within one version of the API. Signed-off-by: Leonard Lyubich --- proto-docs/refs.md | 12 ++++++++++++ refs/types.proto | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 5947f70..06470a2 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -7,6 +7,7 @@ - Messages - [Address](#refs.Address) + - [ContainerID](#refs.ContainerID) - [ObjectID](#refs.ObjectID) @@ -35,6 +36,17 @@ Address of object (container id + object id) | CID | [bytes](#bytes) | | CID is container identifier | + + +### Message ContainerID +ContainerID groups information about the NeoFS container identifier. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [bytes](#bytes) | | Value carries the container identifier in a binary format. | + + ### Message ObjectID diff --git a/refs/types.proto b/refs/types.proto index 45e28a5..3f5c11a 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -22,4 +22,10 @@ message Address { message ObjectID { // Value carries the object identifier in a binary format. bytes Value = 1; -} \ No newline at end of file +} + +// ContainerID groups information about the NeoFS container identifier. +message ContainerID { + // Value carries the container identifier in a binary format. + bytes Value = 1; +} From fccd753a5dc401f358726c87f221f3aedf1d7e15 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 18:07:56 +0300 Subject: [PATCH 104/440] [#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 --- acl/types.proto | 5 +++-- container/service.proto | 23 ++++++++++++----------- object/service.proto | 4 ++-- proto-docs/container.md | 10 +++++----- proto-docs/object.md | 2 +- proto-docs/refs.md | 2 +- refs/types.proto | 4 ++-- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 91e012f..2479ef8 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -3,6 +3,7 @@ package acl; option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; option csharp_namespace = "NeoFS.API.Acl"; +import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -101,8 +102,8 @@ message EACLRecord { // EACLRecord carries the information about extended ACL rules. message EACLTable { - // ContainerID of the container that should use given access control rules. - bytes ContainerID = 1 [json_name="ContainerID"]; + // Carries identifier of the container that should use given access control rules. + refs.ContainerID ContainerID = 1 [json_name="ContainerID"]; // Records carries list of extended ACL rule records. repeated EACLRecord Records = 2 [json_name="Records"]; } diff --git a/container/service.proto b/container/service.proto index 1ad1a8d..28fdd3b 100644 --- a/container/service.proto +++ b/container/service.proto @@ -5,6 +5,7 @@ option csharp_namespace = "NeoFS.API.Container"; import "acl/types.proto"; import "container/types.proto"; +import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -52,25 +53,25 @@ message PutRequest { } message PutResponse { - // ContainerID of the new container. - bytes ContainerID = 1; + // ContainerID carries identifier of the new container. + refs.ContainerID ContainerID = 1; } message DeleteRequest { - // ContainerID of container to delete from NeoFS. - bytes ContainerID = 1; + // ContainerID carries identifier of the container to delete from NeoFS. + refs.ContainerID ContainerID = 1; // Signature of container id according to RFC-6979. bytes Signature = 2; } // DeleteResponse is empty because delete operation is asynchronous and done // via consensus in inner ring nodes -message DeleteResponse { } +message DeleteResponse {} message GetRequest { - // ContainerID of the container to get. - bytes ContainerID = 1; + // ContainerID carries identifier of the container to get. + refs.ContainerID ContainerID = 1; } message GetResponse { @@ -84,8 +85,8 @@ message ListRequest { } message ListResponse { - // ContainerIDs of containers that belong to the owner. - repeated bytes ContainerIDs = 1; + // ContainerIDs carries list of identifiers of the containers that belong to the owner. + repeated refs.ContainerID ContainerIDs = 1; } message SetExtendedACLRequest { @@ -98,8 +99,8 @@ message SetExtendedACLRequest { message SetExtendedACLResponse {} message GetExtendedACLRequest { - // ContainerID of the container that has Extended ACL. - bytes ContainerID = 1; + // ContainerID carries identifier of the container that has Extended ACL. + refs.ContainerID ContainerID = 1; } message GetExtendedACLResponse { diff --git a/object/service.proto b/object/service.proto index 9affad7..19b78a4 100644 --- a/object/service.proto +++ b/object/service.proto @@ -138,8 +138,8 @@ message HeadResponse { } message SearchRequest { - // ContainerID for searching the object - bytes ContainerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"]; + // ContainerID carries search container identifier. + refs.ContainerID ContainerID = 1; // Query in the binary serialized format bytes Query = 2; // QueryVersion is a version of search query format diff --git a/proto-docs/container.md b/proto-docs/container.md index b0b539f..03f9436 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -120,7 +120,7 @@ smart-contract storage. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID of container to delete from NeoFS. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to delete from NeoFS. | | Signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | @@ -140,7 +140,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID of the container that has Extended ACL. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container that has Extended ACL. | @@ -163,7 +163,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID of the container to get. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to get. | @@ -196,7 +196,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerIDs | [bytes](#bytes) | repeated | ContainerIDs of containers that belong to the owner. | +| ContainerIDs | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | @@ -220,7 +220,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID of the new container. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the new container. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 29d9955..03e60e2 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -327,7 +327,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID for searching the object | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. | | Query | [bytes](#bytes) | | Query in the binary serialized format | | QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 06470a2..fce3da2 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -33,7 +33,7 @@ Address of object (container id + object id) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | -| CID | [bytes](#bytes) | | CID is container identifier | +| ContainerID | [ContainerID](#refs.ContainerID) | | ContainerID carries container identifier. | diff --git a/refs/types.proto b/refs/types.proto index 3f5c11a..f952c5a 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -14,8 +14,8 @@ option (gogoproto.goproto_stringer_all) = false; message Address { // ObjectID carries object identifier. ObjectID ObjectID = 1; - // CID is container identifier - bytes CID = 2[(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; + // ContainerID carries container identifier. + ContainerID ContainerID = 2; } // ObjectID groups information about the NeoFS object identifier. From 9bd49343739ff39cc97a286966ac01f60be11039 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 18:11:00 +0300 Subject: [PATCH 105/440] [#31] refs: Define OwnerID message Define OwnerID message in refs package. In the future, this structure can be ported into messages in place of the owner identifier field to maintain format uniformity. Also, storing the identifier in a dedicated message will allow, if necessary, to expand it with additional information without losing backward compatibility within one version of the API. Signed-off-by: Leonard Lyubich --- proto-docs/refs.md | 12 ++++++++++++ refs/types.proto | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index fce3da2..bf57211 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -9,6 +9,7 @@ - [Address](#refs.Address) - [ContainerID](#refs.ContainerID) - [ObjectID](#refs.ObjectID) + - [OwnerID](#refs.OwnerID) - [Scalar Value Types](#scalar-value-types) @@ -57,6 +58,17 @@ ObjectID groups information about the NeoFS object identifier. | ----- | ---- | ----- | ----------- | | Value | [bytes](#bytes) | | Value carries the object identifier in a binary format. | + + + +### Message OwnerID +OwnerID group information about the owner of the NeoFS container. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [bytes](#bytes) | | Value carries the identifier of the container owner in a binary format. | + diff --git a/refs/types.proto b/refs/types.proto index f952c5a..2066a02 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -29,3 +29,9 @@ message ContainerID { // Value carries the container identifier in a binary format. bytes Value = 1; } + +// OwnerID group information about the owner of the NeoFS container. +message OwnerID { + // Value carries the identifier of the container owner in a binary format. + bytes Value = 1; +} \ No newline at end of file From 40420f3ab0da9d5f64592c1c5746aa5cd700adf5 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 19:49:16 +0300 Subject: [PATCH 106/440] [#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 --- accounting/service.proto | 5 +++-- container/service.proto | 4 ++-- container/types.proto | 5 +++-- object/service.proto | 4 ++-- object/types.proto | 4 ++-- proto-docs/accounting.md | 2 +- proto-docs/container.md | 4 ++-- proto-docs/object.md | 4 ++-- proto-docs/service.md | 4 ++-- proto-docs/session.md | 2 +- service/verify.proto | 8 ++++---- session/service.proto | 5 +++-- 12 files changed, 27 insertions(+), 24 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index d1540c4..f381605 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -7,6 +7,7 @@ import "service/meta.proto"; import "service/verify.proto"; import "decimal/decimal.proto"; import "accounting/types.proto"; +import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -19,8 +20,8 @@ service Accounting { } message BalanceRequest { - // OwnerID is a wallet address - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // OwnerID carries user identifier in NeoFS system. + refs.OwnerID OwnerID = 1; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/container/service.proto b/container/service.proto index 28fdd3b..5f01591 100644 --- a/container/service.proto +++ b/container/service.proto @@ -80,8 +80,8 @@ message GetResponse { } message ListRequest { - // OwnerID is a 25 byte NEO3.0 wallet address. - bytes OwnerID = 1; + // OwnerID carries identifier of the container owner. + refs.OwnerID OwnerID = 1; } message ListResponse { diff --git a/container/types.proto b/container/types.proto index 9eaf2c0..d3cc147 100644 --- a/container/types.proto +++ b/container/types.proto @@ -3,6 +3,7 @@ package container; option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; +import "refs/types.proto"; import "github.com/nspcc-dev/netmap/selector.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -13,8 +14,8 @@ option (gogoproto.stable_marshaler_all) = true; // and access control information. ID of the container is a 32 byte long // SHA256 hash of stable-marshalled container message. message Container { - // OwnerID is a 25 byte NEO3.0 wallet address. - bytes OwnerID = 1; + // OwnerID carries identifier of the container owner. + refs.OwnerID OwnerID = 1; // Nonce is a 16 byte UUID, used to avoid collisions of container id. bytes Nonce = 2; // BasicACL contains access control rules for owner, system, others groups and diff --git a/object/service.proto b/object/service.proto index 19b78a4..f1b94e6 100644 --- a/object/service.proto +++ b/object/service.proto @@ -105,8 +105,8 @@ message PutResponse { message DeleteRequest { // Address of object (container id + object id) refs.Address Address = 1 [(gogoproto.nullable) = false]; - // OwnerID is a wallet address - bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; + // OwnerID carries identifier of the object owner. + refs.OwnerID OwnerID = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/object/types.proto b/object/types.proto index 3bab3b1..8589355 100644 --- a/object/types.proto +++ b/object/types.proto @@ -19,8 +19,8 @@ message Header { // Address carries object address in the NeoFS system. // It encapsulates the object and the container identifiers. refs.Address Address = 2; - // OwnerID carries identifier the object owner in a binary format. - bytes OwnerID = 3; + // OwnerID carries identifier of the object owner. + refs.OwnerID OwnerID = 3; } // Main carries the main part of the header. diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index bcae136..ce7156b 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -86,7 +86,7 @@ Balance returns current balance status of the NeoFS user | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries user identifier in NeoFS system. | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | diff --git a/proto-docs/container.md b/proto-docs/container.md index 03f9436..1fb70bd 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -185,7 +185,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | @@ -279,7 +279,7 @@ SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | | Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | | Attributes | [Attribute](#container.Attribute) | repeated | Attributes define any immutable characteristics of container. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 03e60e2..9a84732 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -147,7 +147,7 @@ calculated for XORed data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -458,7 +458,7 @@ Message fields are presented in all NeoFS objects. | ----- | ---- | ----- | ----------- | | PayloadLength | [uint64](#uint64) | | PayloadLength carries length of the object payload. Each object has a fixed payload length since it's immutable. | | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | -| OwnerID | [bytes](#bytes) | | OwnerID carries identifier the object owner in a binary format. | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. | diff --git a/proto-docs/service.md b/proto-docs/service.md index 756188b..72043c5 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -125,7 +125,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ACLRules | [bytes](#bytes) | | ACLRules carries a binary representation of the table of extended ACL rules | -| OwnerID | [bytes](#bytes) | | OwnerID is an owner of token | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. | | ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | @@ -176,7 +176,7 @@ User token granting rights for object manipulation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | | Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | | Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | diff --git a/proto-docs/session.md b/proto-docs/session.md index 5ec7402..8ce09a0 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -52,7 +52,7 @@ CreateRequest carries an information necessary for opening a session | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID carries an identifier of a session initiator | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries an identifier of a session initiator. | | Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Lifetime carries a lifetime of the session | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | diff --git a/service/verify.proto b/service/verify.proto index a7e694f..5206a33 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -34,8 +34,8 @@ message Token { // ID is a token identifier. valid UUIDv4 represented in bytes bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; - // OwnerID is an owner of manipulation object - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // OwnerID carries identifier of the manipulation object owner. + refs.OwnerID OwnerID = 2; // Verb is an enumeration of session request types enum Verb { @@ -101,8 +101,8 @@ message BearerTokenMsg { // ACLRules carries a binary representation of the table of extended ACL rules bytes ACLRules = 1; - // OwnerID is an owner of token - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; + // OwnerID carries identifier of the token owner. + refs.OwnerID OwnerID = 2; // ValidUntil carries a last epoch of token lifetime uint64 ValidUntil = 3; diff --git a/session/service.proto b/session/service.proto index b7eb0df..2f50f37 100644 --- a/session/service.proto +++ b/session/service.proto @@ -5,6 +5,7 @@ option csharp_namespace = "NeoFS.API.Session"; import "service/meta.proto"; import "service/verify.proto"; +import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; @@ -17,8 +18,8 @@ service Session { // CreateRequest carries an information necessary for opening a session message CreateRequest { - // OwnerID carries an identifier of a session initiator - bytes OwnerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; + // OwnerID carries an identifier of a session initiator. + refs.OwnerID OwnerID = 1; // Lifetime carries a lifetime of the session service.TokenLifetime Lifetime = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; From 9454d1adadc910d4e129fdb0cd3585b23a1f2882 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:01:52 +0300 Subject: [PATCH 107/440] [#33] accounting: Remove LockAccounts field from BalanceResponse Remove BalanceResponse field that carried the list of lock account since it ceased to be externally controlled and is now managed by Smart Contract. Signed-off-by: Leonard Lyubich --- accounting/service.proto | 6 +----- proto-docs/accounting.md | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index f381605..afabeb1 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -6,7 +6,6 @@ option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; import "service/verify.proto"; import "decimal/decimal.proto"; -import "accounting/types.proto"; import "refs/types.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; @@ -30,8 +29,5 @@ message BalanceRequest { message BalanceResponse { // Balance contains current account balance state - decimal.Decimal Balance = 1; - // LockAccounts contains information about locked funds. Locked funds appear - // when user pays for storage or withdraw assets. - repeated Account LockAccounts = 2; + decimal.Decimal Balance = 1; } diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index ce7156b..e63afbb 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -100,7 +100,6 @@ Balance returns current balance status of the NeoFS user | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Balance | [decimal.Decimal](#decimal.Decimal) | | Balance contains current account balance state | -| LockAccounts | [Account](#accounting.Account) | repeated | LockAccounts contains information about locked funds. Locked funds appear when user pays for storage or withdraw assets. | From 54319feb4a2571607c65475930340304a58553e7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:05:37 +0300 Subject: [PATCH 108/440] [#33] accounting: Remove no longer used types Some types in accounting package used to prototype the NeoFS system. With the transition to a banking system using blockchain, these types have lost their relevance, so this commit deletes them. Signed-off-by: Leonard Lyubich --- accounting/types.proto | 125 ------------ accounting/withdraw.proto | 101 ---------- proto-docs/accounting.md | 394 -------------------------------------- 3 files changed, 620 deletions(-) delete mode 100644 accounting/types.proto delete mode 100644 accounting/withdraw.proto diff --git a/accounting/types.proto b/accounting/types.proto deleted file mode 100644 index 02fb691..0000000 --- a/accounting/types.proto +++ /dev/null @@ -1,125 +0,0 @@ -syntax = "proto3"; -package accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; -option csharp_namespace = "NeoFS.API.Accounting"; - -import "decimal/decimal.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -message Account { - // OwnerID is a wallet address - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // Address is identifier of accounting record - string Address = 2; - // ParentAddress is identifier of parent accounting record - string ParentAddress = 3; - // ActiveFunds is amount of active (non locked) funds for account - decimal.Decimal ActiveFunds = 4; - // Lifetime is time until account is valid (used for lock accounts) - Lifetime Lifetime = 5 [(gogoproto.nullable) = false]; - // LockTarget is the purpose of lock funds (it might be withdraw or payment for storage) - LockTarget LockTarget = 6; - // LockAccounts contains child accounts with locked funds - repeated Account LockAccounts = 7; -} - -// LockTarget must be one of two options -message LockTarget { - oneof Target { - // WithdrawTarget used when user requested withdraw - WithdrawTarget WithdrawTarget = 1; - // ContainerCreateTarget used when user requested creation of container - ContainerCreateTarget ContainerCreateTarget = 2; - } -} - -message Balances { - // Accounts contains multiple account snapshots - repeated Account Accounts = 1 [(gogoproto.nullable) = false]; -} - -message PayIO { - // BlockID contains id of the NEO block where withdraw or deposit - // call was invoked - uint64 BlockID = 1; - // Transactions contains all transactions that founded in block - // and used for PayIO - repeated Tx Transactions = 2 [(gogoproto.nullable) = false]; -} - -message Lifetime { - // Unit can be Unlimited, based on NeoFS epoch or Neo block - enum Unit { - Unlimited = 0; - NeoFSEpoch = 1; - NeoBlock = 2; - } - - // Unit describes how lifetime is measured in account - Unit unit = 1 [(gogoproto.customname) = "Unit"]; - // Value describes how long lifetime will be valid - int64 Value = 2; -} - -message Tx { - // Type can be withdrawal, payIO or inner - enum Type { - Unknown = 0; - Withdraw = 1; - PayIO = 2; - Inner = 3; - } - - // Type describes target of transaction - Type type = 1 [(gogoproto.customname) = "Type"]; - // From describes sender of funds - string From = 2; - // To describes receiver of funds - string To = 3; - // Amount describes amount of funds - decimal.Decimal Amount = 4; - // PublicKeys contains public key of sender - bytes PublicKeys = 5; -} - -message Settlement { - message Receiver { - // To is the address of funds recipient - string To = 1; - // Amount is the amount of funds that will be sent - decimal.Decimal Amount = 2; - } - - message Container { - // CID is container identifier - bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; - // SGIDs is a set of storage groups that successfully passed the audit - repeated bytes SGIDs = 2 [(gogoproto.customtype) = "SGID", (gogoproto.nullable) = false]; - } - - message Tx { - // From is the address of the sender of funds - string From = 1; - // Container that successfully had passed the audit - Container Container = 2 [(gogoproto.nullable) = false]; - // Receivers is a set of addresses of funds recipients - repeated Receiver Receivers = 3 [(gogoproto.nullable) = false]; - } - - // Epoch contains an epoch when settlement was accepted - uint64 Epoch = 1; - // Transactions is a set of transactions - repeated Tx Transactions = 2; -} - -message ContainerCreateTarget { - // CID is container identifier - bytes CID = 1 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; -} - -message WithdrawTarget { - // Cheque is a string representation of cheque id - string Cheque = 1; -} diff --git a/accounting/withdraw.proto b/accounting/withdraw.proto deleted file mode 100644 index 080a100..0000000 --- a/accounting/withdraw.proto +++ /dev/null @@ -1,101 +0,0 @@ -syntax = "proto3"; -package accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; -option csharp_namespace = "NeoFS.API.Accounting"; - -import "service/meta.proto"; -import "service/verify.proto"; -import "decimal/decimal.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -// Withdraw is a service that provides withdraw assets operations from the NeoFS -service Withdraw { - // Get returns cheque if it was signed by inner ring nodes - rpc Get(GetRequest) returns (GetResponse); - // Put ask inner ring nodes to sign a cheque for withdraw invoke - rpc Put(PutRequest) returns (PutResponse); - // List shows all user's checks - rpc List(ListRequest) returns (ListResponse); - // Delete allows user to remove unused cheque - rpc Delete(DeleteRequest) returns (DeleteResponse); -} - -message Item { - // ID is a cheque identifier - bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; - // OwnerID is a wallet address - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // Amount of funds - decimal.Decimal Amount = 3; - // Height is the neo blockchain height until the cheque is valid - uint64 Height = 4; - // Payload contains cheque representation in bytes - bytes Payload = 5; -} - -message GetRequest { - // ID is cheque identifier - bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; - // OwnerID is a wallet address - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -message GetResponse { - // Withdraw is cheque with meta information - Item Withdraw = 1; -} - -message PutRequest { - // OwnerID is a wallet address - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // Amount of funds - decimal.Decimal Amount = 2; - // Height is the neo blockchain height until the cheque is valid - uint64 Height = 3; - // MessageID is a nonce for uniq request (UUIDv4) - bytes MessageID = 4 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} -message PutResponse { - // ID is cheque identifier - bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; -} - -message ListRequest { - // OwnerID is a wallet address - bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -message ListResponse { - // Items is a set of cheques with meta information - repeated Item Items = 1; -} - -message DeleteRequest { - // ID is cheque identifier - bytes ID = 1 [(gogoproto.customtype) = "ChequeID", (gogoproto.nullable) = false]; - // OwnerID is a wallet address - bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; - // MessageID is a nonce for uniq request (UUIDv4) - bytes MessageID = 3 [(gogoproto.customtype) = "MessageID", (gogoproto.nullable) = false]; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// DeleteResponse is empty -message DeleteResponse {} diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index e63afbb..7b31f60 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -12,39 +12,6 @@ - [BalanceResponse](#accounting.BalanceResponse) -- [accounting/types.proto](#accounting/types.proto) - - - Messages - - [Account](#accounting.Account) - - [Balances](#accounting.Balances) - - [ContainerCreateTarget](#accounting.ContainerCreateTarget) - - [Lifetime](#accounting.Lifetime) - - [LockTarget](#accounting.LockTarget) - - [PayIO](#accounting.PayIO) - - [Settlement](#accounting.Settlement) - - [Settlement.Container](#accounting.Settlement.Container) - - [Settlement.Receiver](#accounting.Settlement.Receiver) - - [Settlement.Tx](#accounting.Settlement.Tx) - - [Tx](#accounting.Tx) - - [WithdrawTarget](#accounting.WithdrawTarget) - - -- [accounting/withdraw.proto](#accounting/withdraw.proto) - - Services - - [Withdraw](#accounting.Withdraw) - - - Messages - - [DeleteRequest](#accounting.DeleteRequest) - - [DeleteResponse](#accounting.DeleteResponse) - - [GetRequest](#accounting.GetRequest) - - [GetResponse](#accounting.GetResponse) - - [Item](#accounting.Item) - - [ListRequest](#accounting.ListRequest) - - [ListResponse](#accounting.ListResponse) - - [PutRequest](#accounting.PutRequest) - - [PutResponse](#accounting.PutResponse) - - - [Scalar Value Types](#scalar-value-types) @@ -107,367 +74,6 @@ Balance returns current balance status of the NeoFS user - -

Top

- -## accounting/types.proto - - - - - - - -### Message Account - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Address | [string](#string) | | Address is identifier of accounting record | -| ParentAddress | [string](#string) | | ParentAddress is identifier of parent accounting record | -| ActiveFunds | [decimal.Decimal](#decimal.Decimal) | | ActiveFunds is amount of active (non locked) funds for account | -| Lifetime | [Lifetime](#accounting.Lifetime) | | Lifetime is time until account is valid (used for lock accounts) | -| LockTarget | [LockTarget](#accounting.LockTarget) | | LockTarget is the purpose of lock funds (it might be withdraw or payment for storage) | -| LockAccounts | [Account](#accounting.Account) | repeated | LockAccounts contains child accounts with locked funds | - - - - -### Message Balances - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Accounts | [Account](#accounting.Account) | repeated | Accounts contains multiple account snapshots | - - - - -### Message ContainerCreateTarget - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | | CID is container identifier | - - - - -### Message Lifetime - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| unit | [Lifetime.Unit](#accounting.Lifetime.Unit) | | Unit describes how lifetime is measured in account | -| Value | [int64](#int64) | | Value describes how long lifetime will be valid | - - - - -### Message LockTarget -LockTarget must be one of two options - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| WithdrawTarget | [WithdrawTarget](#accounting.WithdrawTarget) | | WithdrawTarget used when user requested withdraw | -| ContainerCreateTarget | [ContainerCreateTarget](#accounting.ContainerCreateTarget) | | ContainerCreateTarget used when user requested creation of container | - - - - -### Message PayIO - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| BlockID | [uint64](#uint64) | | BlockID contains id of the NEO block where withdraw or deposit call was invoked | -| Transactions | [Tx](#accounting.Tx) | repeated | Transactions contains all transactions that founded in block and used for PayIO | - - - - -### Message Settlement - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch contains an epoch when settlement was accepted | -| Transactions | [Settlement.Tx](#accounting.Settlement.Tx) | repeated | Transactions is a set of transactions | - - - - -### Message Settlement.Container - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| CID | [bytes](#bytes) | | CID is container identifier | -| SGIDs | [bytes](#bytes) | repeated | SGIDs is a set of storage groups that successfully passed the audit | - - - - -### Message Settlement.Receiver - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| To | [string](#string) | | To is the address of funds recipient | -| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount is the amount of funds that will be sent | - - - - -### Message Settlement.Tx - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| From | [string](#string) | | From is the address of the sender of funds | -| Container | [Settlement.Container](#accounting.Settlement.Container) | | Container that successfully had passed the audit | -| Receivers | [Settlement.Receiver](#accounting.Settlement.Receiver) | repeated | Receivers is a set of addresses of funds recipients | - - - - -### Message Tx - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [Tx.Type](#accounting.Tx.Type) | | Type describes target of transaction | -| From | [string](#string) | | From describes sender of funds | -| To | [string](#string) | | To describes receiver of funds | -| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount describes amount of funds | -| PublicKeys | [bytes](#bytes) | | PublicKeys contains public key of sender | - - - - -### Message WithdrawTarget - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Cheque | [string](#string) | | Cheque is a string representation of cheque id | - - - - - - -### Lifetime.Unit -Unit can be Unlimited, based on NeoFS epoch or Neo block - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unlimited | 0 | | -| NeoFSEpoch | 1 | | -| NeoBlock | 2 | | - - - - - -### Tx.Type -Type can be withdrawal, payIO or inner - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | | -| Withdraw | 1 | | -| PayIO | 2 | | -| Inner | 3 | | - - - - - - - -

Top

- -## accounting/withdraw.proto - - - - - - -### Service "accounting.Withdraw" -Withdraw is a service that provides withdraw assets operations from the NeoFS - -``` -rpc Get(GetRequest) returns (GetResponse); -rpc Put(PutRequest) returns (PutResponse); -rpc List(ListRequest) returns (ListResponse); -rpc Delete(DeleteRequest) returns (DeleteResponse); - -``` - -#### Method Get - -Get returns cheque if it was signed by inner ring nodes - -| Name | Input | Output | -| ---- | ----- | ------ | -| Get | [GetRequest](#accounting.GetRequest) | [GetResponse](#accounting.GetResponse) | -#### Method Put - -Put ask inner ring nodes to sign a cheque for withdraw invoke - -| Name | Input | Output | -| ---- | ----- | ------ | -| Put | [PutRequest](#accounting.PutRequest) | [PutResponse](#accounting.PutResponse) | -#### Method List - -List shows all user's checks - -| Name | Input | Output | -| ---- | ----- | ------ | -| List | [ListRequest](#accounting.ListRequest) | [ListResponse](#accounting.ListResponse) | -#### Method Delete - -Delete allows user to remove unused cheque - -| Name | Input | Output | -| ---- | ----- | ------ | -| Delete | [DeleteRequest](#accounting.DeleteRequest) | [DeleteResponse](#accounting.DeleteResponse) | - - - - - -### Message DeleteRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID is cheque identifier | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message DeleteResponse -DeleteResponse is empty - - - - - -### Message GetRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID is cheque identifier | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message GetResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Withdraw | [Item](#accounting.Item) | | Withdraw is cheque with meta information | - - - - -### Message Item - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID is a cheque identifier | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount of funds | -| Height | [uint64](#uint64) | | Height is the neo blockchain height until the cheque is valid | -| Payload | [bytes](#bytes) | | Payload contains cheque representation in bytes | - - - - -### Message ListRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message ListResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Items | [Item](#accounting.Item) | repeated | Items is a set of cheques with meta information | - - - - -### Message PutRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| Amount | [decimal.Decimal](#decimal.Decimal) | | Amount of funds | -| Height | [uint64](#uint64) | | Height is the neo blockchain height until the cheque is valid | -| MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message PutResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID is cheque identifier | - - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ Type | Java Type | Python Type | From 5cca1fd469bfc7b83c2d982dc924ac7aca2a370b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:10:04 +0300 Subject: [PATCH 109/440] [#32] accounting: 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 BalanceRequest message. Signed-off-by: Leonard Lyubich --- accounting/service.proto | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index afabeb1..2f8e1c8 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -7,9 +7,6 @@ import "service/meta.proto"; import "service/verify.proto"; import "decimal/decimal.proto"; import "refs/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; // Accounting is a service that provides access for accounting balance // information @@ -22,9 +19,9 @@ message BalanceRequest { // OwnerID carries user identifier in NeoFS system. refs.OwnerID OwnerID = 1; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message BalanceResponse { From 1f0e5b61605c4b0b595158dbb315c698ef2c7383 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:12:19 +0300 Subject: [PATCH 110/440] [#32] decimal: 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 Decimal message. Signed-off-by: Leonard Lyubich --- decimal/decimal.proto | 6 ------ 1 file changed, 6 deletions(-) diff --git a/decimal/decimal.proto b/decimal/decimal.proto index f3d5c00..391b528 100644 --- a/decimal/decimal.proto +++ b/decimal/decimal.proto @@ -3,14 +3,8 @@ package decimal; option go_package = "github.com/nspcc-dev/neofs-api-go/decimal"; option csharp_namespace = "NeoFS.API.Decimal"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - // Decimal is a structure used for representation of assets amount message Decimal { - option (gogoproto.goproto_stringer) = false; - // Value is value number int64 Value = 1; // Precision is precision number From 0f478ffaa6f5ad39fab3005c0241bad12d305b38 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:21:36 +0300 Subject: [PATCH 111/440] [#33] decimal: Improve comments Signed-off-by: Leonard Lyubich --- decimal/decimal.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/decimal/decimal.proto b/decimal/decimal.proto index 391b528..6282c12 100644 --- a/decimal/decimal.proto +++ b/decimal/decimal.proto @@ -3,10 +3,11 @@ package decimal; option go_package = "github.com/nspcc-dev/neofs-api-go/decimal"; option csharp_namespace = "NeoFS.API.Decimal"; -// Decimal is a structure used for representation of assets amount +// Decimal represents the decimal numbers. message Decimal { - // Value is value number + // Value carries number value. int64 Value = 1; - // Precision is precision number + + // Precision carries value precision. uint32 Precision = 2; } From e6fce062df9ad696e89f8f0de94c6d94dff8b3ab Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 20:32:10 +0300 Subject: [PATCH 112/440] [#33] decimal: Move Decimal to accounting Move Decimal message definition to accounting package since it is only used there. Package decimal is completely removed from the repository. Signed-off-by: Leonard Lyubich --- accounting/service.proto | 12 ++++++-- decimal/decimal.proto | 13 --------- proto-docs/accounting.md | 15 +++++++++- proto-docs/decimal.md | 61 ---------------------------------------- 4 files changed, 24 insertions(+), 77 deletions(-) delete mode 100644 decimal/decimal.proto delete mode 100644 proto-docs/decimal.md diff --git a/accounting/service.proto b/accounting/service.proto index 2f8e1c8..6f45b30 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -5,7 +5,6 @@ option csharp_namespace = "NeoFS.API.Accounting"; import "service/meta.proto"; import "service/verify.proto"; -import "decimal/decimal.proto"; import "refs/types.proto"; // Accounting is a service that provides access for accounting balance @@ -24,7 +23,16 @@ message BalanceRequest { service.RequestVerificationHeader Verify = 99; } +// Decimal represents the decimal numbers. +message Decimal { + // Value carries number value. + int64 Value = 1; + + // Precision carries value precision. + uint32 Precision = 2; +} + message BalanceResponse { // Balance contains current account balance state - decimal.Decimal Balance = 1; + Decimal Balance = 1; } diff --git a/decimal/decimal.proto b/decimal/decimal.proto deleted file mode 100644 index 6282c12..0000000 --- a/decimal/decimal.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package decimal; -option go_package = "github.com/nspcc-dev/neofs-api-go/decimal"; -option csharp_namespace = "NeoFS.API.Decimal"; - -// Decimal represents the decimal numbers. -message Decimal { - // Value carries number value. - int64 Value = 1; - - // Precision carries value precision. - uint32 Precision = 2; -} diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 7b31f60..64eea91 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -10,6 +10,7 @@ - Messages - [BalanceRequest](#accounting.BalanceRequest) - [BalanceResponse](#accounting.BalanceResponse) + - [Decimal](#accounting.Decimal) - [Scalar Value Types](#scalar-value-types) @@ -66,7 +67,19 @@ Balance returns current balance status of the NeoFS user | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Balance | [decimal.Decimal](#decimal.Decimal) | | Balance contains current account balance state | +| Balance | [Decimal](#accounting.Decimal) | | Balance contains current account balance state | + + + + +### Message Decimal +Decimal represents the decimal numbers. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Value | [int64](#int64) | | Value carries number value. | +| Precision | [uint32](#uint32) | | Precision carries value precision. | diff --git a/proto-docs/decimal.md b/proto-docs/decimal.md deleted file mode 100644 index 62acb86..0000000 --- a/proto-docs/decimal.md +++ /dev/null @@ -1,61 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [decimal/decimal.proto](#decimal/decimal.proto) - - - Messages - - [Decimal](#decimal.Decimal) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## decimal/decimal.proto - - - - - - - -### Message Decimal -Decimal is a structure used for representation of assets amount - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Value | [int64](#int64) | | Value is value number | -| Precision | [uint32](#uint32) | | Precision is precision number | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - From d308f9187293086e5b8891024dcc7a4b0b641ba1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 21:01:50 +0300 Subject: [PATCH 113/440] [#33] accounting: Tidy up the format Signed-off-by: Leonard Lyubich --- accounting/service.proto | 35 +++++++++++++++++++++++++---------- proto-docs/accounting.md | 21 ++++++++++++++------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 6f45b30..f08a312 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package accounting; + option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; @@ -7,20 +9,30 @@ import "service/meta.proto"; import "service/verify.proto"; import "refs/types.proto"; -// Accounting is a service that provides access for accounting balance -// information +// The service provides methods for obtaining information +// about the account balance in NeoFS system. service Accounting { - // Balance returns current balance status of the NeoFS user - rpc Balance(BalanceRequest) returns (BalanceResponse); + // Returns the amount of funds for the requested NeoFS account. + rpc Balance (BalanceRequest) returns (BalanceResponse); } +// Message defines the request body of Balance method. +// +// To indicate the account for which the balance is requested, its identifier is used. +// +// To gain access to the requested information, the request body must be formed according +// to the requirements from the system specification. message BalanceRequest { - // OwnerID carries user identifier in NeoFS system. + // Carries user identifier in NeoFS system for which the balance is requested. refs.OwnerID OwnerID = 1; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } // Decimal represents the decimal numbers. @@ -32,7 +44,10 @@ message Decimal { uint32 Precision = 2; } +// Message defines the response body of Balance method. +// +// The amount of funds is calculated in decimal numbers. message BalanceResponse { - // Balance contains current account balance state + // Carries the amount of funds on the account. Decimal Balance = 1; } diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 64eea91..14d9c7c 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -28,8 +28,8 @@ ### Service "accounting.Accounting" -Accounting is a service that provides access for accounting balance -information +The service provides methods for obtaining information +about the account balance in NeoFS system. ``` rpc Balance(BalanceRequest) returns (BalanceResponse); @@ -38,7 +38,7 @@ rpc Balance(BalanceRequest) returns (BalanceResponse); #### Method Balance -Balance returns current balance status of the NeoFS user +Returns the amount of funds for the requested NeoFS account. | Name | Input | Output | | ---- | ----- | ------ | @@ -49,25 +49,32 @@ Balance returns current balance status of the NeoFS user ### Message BalanceRequest +Message defines the request body of Balance method. +To indicate the account for which the balance is requested, its identifier is used. + +To gain access to the requested information, the request body must be formed according +to the requirements from the system specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries user identifier in NeoFS system. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | ### Message BalanceResponse +Message defines the response body of Balance method. +The amount of funds is calculated in decimal numbers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Balance | [Decimal](#accounting.Decimal) | | Balance contains current account balance state | +| Balance | [Decimal](#accounting.Decimal) | | Carries the amount of funds on the account. | From c88d1fdae3e8a6c8037a0e9a2d1c08236663cff4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 21:21:26 +0300 Subject: [PATCH 114/440] 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 --- object/service.proto | 26 +++++++++++--- proto-docs/object.md | 42 ++++++++++++++++++++-- proto-docs/query.md | 86 -------------------------------------------- query/types.proto | 33 ----------------- 4 files changed, 62 insertions(+), 125 deletions(-) delete mode 100644 proto-docs/query.md delete mode 100644 query/types.proto diff --git a/object/service.proto b/object/service.proto index f1b94e6..735bb39 100644 --- a/object/service.proto +++ b/object/service.proto @@ -140,10 +140,28 @@ message HeadResponse { message SearchRequest { // ContainerID carries search container identifier. refs.ContainerID ContainerID = 1; - // Query in the binary serialized format - bytes Query = 2; - // QueryVersion is a version of search query format - uint32 QueryVersion = 3; + + message Query { + uint32 Version = 1; + + message Filter { + enum MatchType { + MatchUnknown = 0; + StringEqual = 1; + } + + MatchType matchType = 1; + + string Name = 2; + + string Value = 3; + } + + repeated Filter Filters = 2; + } + + Query query = 2; + // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index 9a84732..d6c98b4 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -23,6 +23,8 @@ - [PutResponse](#object.PutResponse) - [Range](#object.Range) - [SearchRequest](#object.SearchRequest) + - [SearchRequest.Query](#object.SearchRequest.Query) + - [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) - [SearchResponse](#object.SearchResponse) @@ -328,12 +330,36 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. | -| Query | [bytes](#bytes) | | Query in the binary serialized format | -| QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format | +| query | [SearchRequest.Query](#object.SearchRequest.Query) | | | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | + + +### Message SearchRequest.Query + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Version | [uint32](#uint32) | | | +| Filters | [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) | repeated | | + + + + +### Message SearchRequest.Query.Filter + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| matchType | [SearchRequest.Query.Filter.MatchType](#object.SearchRequest.Query.Filter.MatchType) | | | +| Name | [string](#string) | | | +| Value | [string](#string) | | | + + ### Message SearchResponse @@ -347,6 +373,18 @@ in distributed system. + + + +### SearchRequest.Query.Filter.MatchType + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| MatchUnknown | 0 | | +| StringEqual | 1 | | + + diff --git a/proto-docs/query.md b/proto-docs/query.md deleted file mode 100644 index c014c6c..0000000 --- a/proto-docs/query.md +++ /dev/null @@ -1,86 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [query/types.proto](#query/types.proto) - - - Messages - - [Filter](#query.Filter) - - [Query](#query.Query) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## query/types.proto - - - - - - - -### Message Filter - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [Filter.Type](#query.Filter.Type) | | Type of filter | -| Name | [string](#string) | | Name of field that should be filtered | -| Value | [string](#string) | | Value that should be used for filter | - - - - -### Message Query - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Filters | [Filter](#query.Filter) | repeated | Filters is set of filters, should not be empty | - - - - - - -### Filter.Type - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Exact | 0 | Exact sets when value of filter should be equal to the header value | -| Regex | 1 | Regex sets when value of filter should match the header value by the regular expression | - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/query/types.proto b/query/types.proto deleted file mode 100644 index ebc0d64..0000000 --- a/query/types.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; -package query; -option go_package = "github.com/nspcc-dev/neofs-api-go/query"; -option csharp_namespace = "NeoFS.API.Query"; - -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -message Filter { - option (gogoproto.goproto_stringer) = false; - - enum Type { - // Exact sets when value of filter should be equal to the header value - Exact = 0; - // Regex sets when value of filter should match the header value by the regular expression - Regex = 1; - } - - // Type of filter - Type type = 1 [(gogoproto.customname) = "Type"]; - // Name of field that should be filtered - string Name = 2; - // Value that should be used for filter - string Value = 3; -} - -message Query { - option (gogoproto.goproto_stringer) = false; - - // Filters is set of filters, should not be empty - repeated Filter Filters = 1 [(gogoproto.nullable) = false]; -} From 7c71813d226e9229f06d97bf4cac5aec942c2ec4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:29:11 +0300 Subject: [PATCH 115/440] [#34] bootstrap: Define node state enum in NodeInfo Replaces Status field of NodeInfo with State field value of NodeInfo.State enumeration. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 10 ++++++++-- proto-docs/bootstrap.md | 15 ++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 4ef0fff..74cd5ed 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -24,6 +24,12 @@ message NodeInfo { bytes PubKey = 2 [(gogoproto.jsontag) = "pubkey,omitempty"]; // Options is set of node optional information, such as storage capacity, node location, price and etc repeated string Options = 3 [(gogoproto.jsontag) = "options,omitempty"]; - // Status is bitmap status of the node - uint64 Status = 4 [(gogoproto.jsontag) = "status", (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeStatus"]; + + enum State { + Unknown = 0; + Online = 1; + Offline = 2; + } + + State state = 4; } diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 80aa109..11b4f23 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -105,7 +105,7 @@ Node state | Address | [string](#string) | | Address is a node [multi-address](https://github.com/multiformats/multiaddr) | | PubKey | [bytes](#bytes) | | PubKey is a compressed public key representation in bytes | | Options | [string](#string) | repeated | Options is set of node optional information, such as storage capacity, node location, price and etc | -| Status | [uint64](#uint64) | | Status is bitmap status of the node | +| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | | @@ -121,6 +121,19 @@ Node state + + + +### NodeInfo.State + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | | +| Online | 1 | | +| Offline | 2 | | + + From 5b410c69158df560f6b3b4ce04cf3e05c08f5cb0 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:31:02 +0300 Subject: [PATCH 116/440] [#34] bootstrap: Remove Bootstrap service Remove Bootstrap service with all related types from bootstrap package since it was used to prototype NeoFS system. Signed-off-by: Leonard Lyubich --- bootstrap/service.proto | 42 ------------------------ proto-docs/bootstrap.md | 71 ----------------------------------------- 2 files changed, 113 deletions(-) delete mode 100644 bootstrap/service.proto diff --git a/bootstrap/service.proto b/bootstrap/service.proto deleted file mode 100644 index 6918bef..0000000 --- a/bootstrap/service.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package bootstrap; -option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; -option csharp_namespace = "NeoFS.API.Bootstrap"; - -import "service/meta.proto"; -import "service/verify.proto"; -import "bootstrap/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -// Bootstrap service allows neofs-node to connect to the network. Node should -// perform at least one bootstrap request in the epoch to stay in the network -// for the next epoch. -service Bootstrap { - // Process is method that allows to register node in the network and receive actual netmap - rpc Process(Request) returns (bootstrap.SpreadMap); -} - -message Request { - // Node state - enum State { - // used by default - Unknown = 0; - // used to inform that node online - Online = 1; - // used to inform that node offline - Offline = 2; - } - - // Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) - int32 type = 1 [(gogoproto.customname) = "Type" , (gogoproto.nullable) = false, (gogoproto.customtype) = "NodeType"]; - // Info contains information about node - bootstrap.NodeInfo info = 2 [(gogoproto.nullable) = false]; - // State contains node status - State state = 3; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 11b4f23..fada056 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -3,14 +3,6 @@ ## Table of Contents -- [bootstrap/service.proto](#bootstrap/service.proto) - - Services - - [Bootstrap](#bootstrap.Bootstrap) - - - Messages - - [Request](#bootstrap.Request) - - - [bootstrap/types.proto](#bootstrap/types.proto) - Messages @@ -22,69 +14,6 @@ - -

Top

- -## bootstrap/service.proto - - - - - - -### Service "bootstrap.Bootstrap" -Bootstrap service allows neofs-node to connect to the network. Node should -perform at least one bootstrap request in the epoch to stay in the network -for the next epoch. - -``` -rpc Process(Request) returns (SpreadMap); - -``` - -#### Method Process - -Process is method that allows to register node in the network and receive actual netmap - -| Name | Input | Output | -| ---- | ----- | ------ | -| Process | [Request](#bootstrap.Request) | [SpreadMap](#bootstrap.SpreadMap) | - - - - - -### Message Request - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [int32](#int32) | | Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) | -| info | [NodeInfo](#bootstrap.NodeInfo) | | Info contains information about node | -| state | [Request.State](#bootstrap.Request.State) | | State contains node status | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - - - -### Request.State -Node state - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | used by default | -| Online | 1 | used to inform that node online | -| Offline | 2 | used to inform that node offline | - - - - - -

Top

From abbf0f7893f5e8c3e69fa1c0c5a01c3668566768 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:33:56 +0300 Subject: [PATCH 117/440] [#30] state: Remove State service Remove state package from the repository since State service is not part of the public API. Signed-off-by: Leonard Lyubich --- proto-docs/state.md | 270 -------------------------------------------- state/service.proto | 124 -------------------- 2 files changed, 394 deletions(-) delete mode 100644 proto-docs/state.md delete mode 100644 state/service.proto diff --git a/proto-docs/state.md b/proto-docs/state.md deleted file mode 100644 index 3b7b89d..0000000 --- a/proto-docs/state.md +++ /dev/null @@ -1,270 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [state/service.proto](#state/service.proto) - - Services - - [Status](#state.Status) - - - Messages - - [ChangeStateRequest](#state.ChangeStateRequest) - - [ChangeStateResponse](#state.ChangeStateResponse) - - [DumpRequest](#state.DumpRequest) - - [DumpResponse](#state.DumpResponse) - - [DumpVarsRequest](#state.DumpVarsRequest) - - [DumpVarsResponse](#state.DumpVarsResponse) - - [HealthRequest](#state.HealthRequest) - - [HealthResponse](#state.HealthResponse) - - [MetricsRequest](#state.MetricsRequest) - - [MetricsResponse](#state.MetricsResponse) - - [NetmapRequest](#state.NetmapRequest) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## state/service.proto - - - - - - -### Service "state.Status" -Status service provides node's healthcheck and status info. -TODO: decide how to describe auth and were contains permissions. - -``` -rpc Netmap(NetmapRequest) returns (.bootstrap.SpreadMap); -rpc Metrics(MetricsRequest) returns (MetricsResponse); -rpc HealthCheck(HealthRequest) returns (HealthResponse); -rpc DumpConfig(DumpRequest) returns (DumpResponse); -rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); -rpc ChangeState(ChangeStateRequest) returns (ChangeStateResponse); - -``` - -#### Method Netmap - -Netmap request allows to receive current [bootstrap.SpreadMap](bootstrap.md#bootstrap.SpreadMap) - -| Name | Input | Output | -| ---- | ----- | ------ | -| Netmap | [NetmapRequest](#state.NetmapRequest) | [.bootstrap.SpreadMap](#bootstrap.SpreadMap) | -#### Method Metrics - -Metrics request allows to receive metrics in prometheus format - -| Name | Input | Output | -| ---- | ----- | ------ | -| Metrics | [MetricsRequest](#state.MetricsRequest) | [MetricsResponse](#state.MetricsResponse) | -#### Method HealthCheck - -HealthCheck request allows to check health status of the node. -If node unhealthy field Status would contains detailed info. - -| Name | Input | Output | -| ---- | ----- | ------ | -| HealthCheck | [HealthRequest](#state.HealthRequest) | [HealthResponse](#state.HealthResponse) | -#### Method DumpConfig - -DumpConfig request allows dumping settings for the current node. -To permit access, used server config options. -The request should be signed. - -| Name | Input | Output | -| ---- | ----- | ------ | -| DumpConfig | [DumpRequest](#state.DumpRequest) | [DumpResponse](#state.DumpResponse) | -#### Method DumpVars - -DumpVars returns debug variables for the current node. -To permit access, used server config options. -The request should be signed. - -| Name | Input | Output | -| ---- | ----- | ------ | -| DumpVars | [DumpVarsRequest](#state.DumpVarsRequest) | [DumpVarsResponse](#state.DumpVarsResponse) | -#### Method ChangeState - -ChangeState allows to change current node state of node. -To permit access, used server config options. -The request should be signed. - -| Name | Input | Output | -| ---- | ----- | ------ | -| ChangeState | [ChangeStateRequest](#state.ChangeStateRequest) | [ChangeStateResponse](#state.ChangeStateResponse) | - - - - - -### Message ChangeStateRequest -ChangeStateRequest contains a new state of node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| state | [ChangeStateRequest.State](#state.ChangeStateRequest.State) | | State is a new state of node. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message ChangeStateResponse -ChangeStateResponse is an empty response, that returns when RPC invoked without errors. - - - - - -### Message DumpRequest -DumpRequest message to fetch current server config. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message DumpResponse -DumpResponse message contains current server config. -Config stored in JSON encoded into slice of bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Config | [bytes](#bytes) | | | - - - - -### Message DumpVarsRequest -DumpVarsRequest message to fetch current server debug variables. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message DumpVarsResponse -DumpVarsResponse message contains current server debug variables. -Variables stored in JSON encoded into slice of bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Variables | [bytes](#bytes) | | | - - - - -### Message HealthRequest -HealthRequest message to check current state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message HealthResponse -HealthResponse message with current state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Healthy | [bool](#bool) | | Healthy is true when node alive and healthy | -| Status | [string](#string) | | Status contains detailed information about health status | - - - - -### Message MetricsRequest -MetricsRequest message to request node metrics - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - -### Message MetricsResponse -MetricsResponse contains [][]byte, -every []byte is marshaled MetricFamily proto message -from github.com/prometheus/client_model/metrics.proto - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Metrics | [bytes](#bytes) | repeated | | - - - - -### Message NetmapRequest -NetmapRequest message to request current node netmap - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | - - - - - - -### ChangeStateRequest.State - - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | Unknown is default value. Does nothing. | -| Online | 1 | Online used when need to set node to the online state. | -| Offline | 2 | Offline used when need to set node to the offline state. | - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/state/service.proto b/state/service.proto deleted file mode 100644 index 410a000..0000000 --- a/state/service.proto +++ /dev/null @@ -1,124 +0,0 @@ -syntax = "proto3"; -package state; -option go_package = "github.com/nspcc-dev/neofs-api-go/state"; -option csharp_namespace = "NeoFS.API.State"; - -import "service/meta.proto"; -import "service/verify.proto"; -import "bootstrap/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -// Status service provides node's healthcheck and status info. -// TODO: decide how to describe auth and were contains permissions. -service Status { - // Netmap request allows to receive current [bootstrap.SpreadMap](bootstrap.md#bootstrap.SpreadMap) - rpc Netmap(NetmapRequest) returns (bootstrap.SpreadMap); - // Metrics request allows to receive metrics in prometheus format - rpc Metrics(MetricsRequest) returns (MetricsResponse); - // HealthCheck request allows to check health status of the node. - // If node unhealthy field Status would contains detailed info. - rpc HealthCheck(HealthRequest) returns (HealthResponse); - // DumpConfig request allows dumping settings for the current node. - // To permit access, used server config options. - // The request should be signed. - rpc DumpConfig(DumpRequest) returns (DumpResponse); - // DumpVars returns debug variables for the current node. - // To permit access, used server config options. - // The request should be signed. - rpc DumpVars(DumpVarsRequest) returns (DumpVarsResponse); - // ChangeState allows to change current node state of node. - // To permit access, used server config options. - // The request should be signed. - rpc ChangeState(ChangeStateRequest) returns (ChangeStateResponse); -} - -// NetmapRequest message to request current node netmap -message NetmapRequest { - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// MetricsRequest message to request node metrics -message MetricsRequest { - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// MetricsResponse contains [][]byte, -// every []byte is marshaled MetricFamily proto message -// from github.com/prometheus/client_model/metrics.proto -message MetricsResponse { - repeated bytes Metrics = 1; -} - -// HealthRequest message to check current state -message HealthRequest { - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// HealthResponse message with current state -message HealthResponse { - // Healthy is true when node alive and healthy - bool Healthy = 1; - // Status contains detailed information about health status - string Status = 2; -} - -// DumpRequest message to fetch current server config. -message DumpRequest { - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// DumpResponse message contains current server config. -// Config stored in JSON encoded into slice of bytes. -message DumpResponse { - bytes Config = 1; -} - -// DumpVarsRequest message to fetch current server debug variables. -message DumpVarsRequest { - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// DumpVarsResponse message contains current server debug variables. -// Variables stored in JSON encoded into slice of bytes. -message DumpVarsResponse { - bytes Variables = 1; -} - -// ChangeStateRequest contains a new state of node. -message ChangeStateRequest { - enum State { - // Unknown is default value. Does nothing. - Unknown = 0; - // Online used when need to set node to the online state. - Online = 1; - // Offline used when need to set node to the offline state. - Offline = 2; - } - - // State is a new state of node. - State state = 1; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; -} - -// ChangeStateResponse is an empty response, that returns when RPC invoked without errors. -message ChangeStateResponse {} \ No newline at end of file From 4caf9a7258bc2ae375818832ba684b44fc86a354 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:36:14 +0300 Subject: [PATCH 118/440] [#34] bootstrap: Remove no longer used SpreadMap After removing State service from the public API, SpreadMap message became redundant, so it is deleted. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 7 ------- proto-docs/bootstrap.md | 13 ------------- 2 files changed, 20 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 74cd5ed..cafc547 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -10,13 +10,6 @@ option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stringer_all) = false; option (gogoproto.goproto_stringer_all) = false; -message SpreadMap { - // Epoch is current epoch for netmap - uint64 Epoch = 1; - // NetMap is a set of NodeInfos - repeated NodeInfo NetMap = 2 [(gogoproto.nullable) = false]; -} - message NodeInfo { // Address is a node [multi-address](https://github.com/multiformats/multiaddr) string Address = 1 [(gogoproto.jsontag) = "address"]; diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index fada056..3d1038e 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -7,7 +7,6 @@ - Messages - [NodeInfo](#bootstrap.NodeInfo) - - [SpreadMap](#bootstrap.SpreadMap) - [Scalar Value Types](#scalar-value-types) @@ -36,18 +35,6 @@ | Options | [string](#string) | repeated | Options is set of node optional information, such as storage capacity, node location, price and etc | | state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | | - - - -### Message SpreadMap - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is current epoch for netmap | -| NetMap | [NodeInfo](#bootstrap.NodeInfo) | repeated | NetMap is a set of NodeInfos | - From 50d4fcb24a6fd13ed91529cd7cb09c536b422df1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:37:42 +0300 Subject: [PATCH 119/440] [#32] bootstrap: 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 NodeInfo message. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index cafc547..f0a4d8a 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -3,20 +3,13 @@ package bootstrap; option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; option csharp_namespace = "NeoFS.API.Bootstrap"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_stringer_all) = false; - message NodeInfo { // Address is a node [multi-address](https://github.com/multiformats/multiaddr) - string Address = 1 [(gogoproto.jsontag) = "address"]; + string Address = 1; // PubKey is a compressed public key representation in bytes - bytes PubKey = 2 [(gogoproto.jsontag) = "pubkey,omitempty"]; + bytes PubKey = 2; // Options is set of node optional information, such as storage capacity, node location, price and etc - repeated string Options = 3 [(gogoproto.jsontag) = "options,omitempty"]; + repeated string Options = 3; enum State { Unknown = 0; From 87e1d013073e1183d4273499c58225e47de7e2d3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 5 Aug 2020 22:44:53 +0300 Subject: [PATCH 120/440] [#34] bootstrap: Tidy up the format Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 20 ++++++++++++++++---- proto-docs/bootstrap.md | 18 +++++++++--------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index f0a4d8a..3b52adc 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -1,21 +1,33 @@ syntax = "proto3"; + package bootstrap; + option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; option csharp_namespace = "NeoFS.API.Bootstrap"; +// Groups the information about the NeoFS node. message NodeInfo { - // Address is a node [multi-address](https://github.com/multiformats/multiaddr) + // Carries network address of the NeoFS node. string Address = 1; - // PubKey is a compressed public key representation in bytes - bytes PubKey = 2; - // Options is set of node optional information, such as storage capacity, node location, price and etc + + // Carries public key of the NeoFS node in a binary format. + bytes PublicKey = 2; + + // Carries options of the NeoFS node. repeated string Options = 3; + // Represents the enumeration of various states of the NeoFS node. enum State { + // Undefined state. Unknown = 0; + + // Active state on the network. Online = 1; + + // Network unavailable state. Offline = 2; } + // Carries state of the NeoFS node. State state = 4; } diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 3d1038e..39ac713 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -25,15 +25,15 @@ ### Message NodeInfo - +Groups the information about the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [string](#string) | | Address is a node [multi-address](https://github.com/multiformats/multiaddr) | -| PubKey | [bytes](#bytes) | | PubKey is a compressed public key representation in bytes | -| Options | [string](#string) | repeated | Options is set of node optional information, such as storage capacity, node location, price and etc | -| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | | +| Address | [string](#string) | | Carries network address of the NeoFS node. | +| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | +| Options | [string](#string) | repeated | Carries options of the NeoFS node. | +| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | Carries state of the NeoFS node. | @@ -41,13 +41,13 @@ ### NodeInfo.State - +Represents the enumeration of various states of the NeoFS node. | Name | Number | Description | | ---- | ------ | ----------- | -| Unknown | 0 | | -| Online | 1 | | -| Offline | 2 | | +| Unknown | 0 | Undefined state. | +| Online | 1 | Active state on the network. | +| Offline | 2 | Network unavailable state. | From 44ec19962a640450714de10a96285b75873c2582 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 00:40:36 +0300 Subject: [PATCH 121/440] bootstrap: Replace options with attributes in NodeInfo Rename Options to Attributes to be in sync with Objects and Nodes and Containers. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 13 +++++++++++-- proto-docs/bootstrap.md | 15 ++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/bootstrap/types.proto b/bootstrap/types.proto index 3b52adc..c7d99bb 100644 --- a/bootstrap/types.proto +++ b/bootstrap/types.proto @@ -13,8 +13,17 @@ message NodeInfo { // Carries public key of the NeoFS node in a binary format. bytes PublicKey = 2; - // Carries options of the NeoFS node. - repeated string Options = 3; + // Groups attributes of the NeoFS node. + message Attribute { + // Carries string key to the node attribute. + string Key = 1; + + // Carries string value of the node attribute. + string Value = 2; + } + + // // Carries list of the NeoFS node attributes in a string key-value format. + repeated Attribute Attributes = 3; // Represents the enumeration of various states of the NeoFS node. enum State { diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md index 39ac713..ad08a7d 100644 --- a/proto-docs/bootstrap.md +++ b/proto-docs/bootstrap.md @@ -7,6 +7,7 @@ - Messages - [NodeInfo](#bootstrap.NodeInfo) + - [NodeInfo.Attribute](#bootstrap.NodeInfo.Attribute) - [Scalar Value Types](#scalar-value-types) @@ -32,9 +33,21 @@ Groups the information about the NeoFS node. | ----- | ---- | ----- | ----------- | | Address | [string](#string) | | Carries network address of the NeoFS node. | | PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | -| Options | [string](#string) | repeated | Carries options of the NeoFS node. | +| Attributes | [NodeInfo.Attribute](#bootstrap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | | state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | Carries state of the NeoFS node. | + + + +### Message NodeInfo.Attribute +Groups attributes of the NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Carries string key to the node attribute. | +| Value | [string](#string) | | Carries string value of the node attribute. | + From f60273beb9db241dc428746233e8b69d6c6a3d88 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 00:52:40 +0300 Subject: [PATCH 122/440] [#34] Add netmap package Introduce netmap package to repository. Also as initial use, added container storage rules message netmap.PlacementRule. Signed-off-by: Leonard Lyubich --- netmap/types.proto | 56 +++++++++++++++++ proto-docs/netmap.md | 146 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 netmap/types.proto create mode 100644 proto-docs/netmap.md diff --git a/netmap/types.proto b/netmap/types.proto new file mode 100644 index 0000000..a0e4026 --- /dev/null +++ b/netmap/types.proto @@ -0,0 +1,56 @@ +syntax = "proto3"; + +package netmap; + +option go_package = "github.com/nspcc-dev/neofs-api-go/netmap"; +option csharp_namespace = "NeoFS.API.Netmap"; + +message PlacementRule { + uint32 ReplFactor = 1; + + message SFGroup { + message Filter { + string Key = 1; + + message SimpleFilters { + repeated SimpleFilter Filters = 1; + } + + message SimpleFilter { + enum Operation { + NP = 0; + EQ = 1; + NE = 2; + GT = 3; + GE = 4; + LT = 5; + LE = 6; + OR = 7; + AND = 8; + } + + Operation Op = 1; + + oneof Args { + string Value = 2; + SimpleFilters FArgs = 3; + } + } + + SimpleFilter F = 2; + } + + repeated Filter Filters = 1; + + message Selector { + uint32 Count = 1; + string Key = 2; + } + + repeated Selector Selectors = 2; + + repeated uint32 Exclude = 3; + } + + repeated SFGroup SFGroups = 2; +} diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md new file mode 100644 index 0000000..e961682 --- /dev/null +++ b/proto-docs/netmap.md @@ -0,0 +1,146 @@ +# Protocol Documentation + + +## Table of Contents + +- [netmap/types.proto](#netmap/types.proto) + + - Messages + - [PlacementRule](#netmap.PlacementRule) + - [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) + - [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) + - [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) + - [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) + - [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## netmap/types.proto + + + + + + + +### Message PlacementRule + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ReplFactor | [uint32](#uint32) | | | +| SFGroups | [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) | repeated | | + + + + +### Message PlacementRule.SFGroup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Filters | [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) | repeated | | +| Selectors | [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) | repeated | | +| Exclude | [uint32](#uint32) | repeated | | + + + + +### Message PlacementRule.SFGroup.Filter + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | | +| F | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | | | + + + + +### Message PlacementRule.SFGroup.Filter.SimpleFilter + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Op | [PlacementRule.SFGroup.Filter.SimpleFilter.Operation](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter.Operation) | | | +| Value | [string](#string) | | | +| FArgs | [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) | | | + + + + +### Message PlacementRule.SFGroup.Filter.SimpleFilters + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Filters | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | repeated | | + + + + +### Message PlacementRule.SFGroup.Selector + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Count | [uint32](#uint32) | | | +| Key | [string](#string) | | | + + + + + + +### PlacementRule.SFGroup.Filter.SimpleFilter.Operation + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| NP | 0 | | +| EQ | 1 | | +| NE | 2 | | +| GT | 3 | | +| GE | 4 | | +| LT | 5 | | +| LE | 6 | | +| OR | 7 | | +| AND | 8 | | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From 031579a68dae514b21be6702a970d2ff4c0c81b7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 00:58:09 +0300 Subject: [PATCH 123/440] [#34] bootstrap: Move NodeInfo to netmap Move NodeInfo message definition to netmap package. Package bootstrap is completely removed from the repository. Signed-off-by: Leonard Lyubich --- bootstrap/types.proto | 42 ------------------------------------------ netmap/types.proto | 36 ++++++++++++++++++++++++++++++++++++ proto-docs/netmap.md | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 42 deletions(-) delete mode 100644 bootstrap/types.proto diff --git a/bootstrap/types.proto b/bootstrap/types.proto deleted file mode 100644 index c7d99bb..0000000 --- a/bootstrap/types.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; - -package bootstrap; - -option go_package = "github.com/nspcc-dev/neofs-api-go/bootstrap"; -option csharp_namespace = "NeoFS.API.Bootstrap"; - -// Groups the information about the NeoFS node. -message NodeInfo { - // Carries network address of the NeoFS node. - string Address = 1; - - // Carries public key of the NeoFS node in a binary format. - bytes PublicKey = 2; - - // Groups attributes of the NeoFS node. - message Attribute { - // Carries string key to the node attribute. - string Key = 1; - - // Carries string value of the node attribute. - string Value = 2; - } - - // // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute Attributes = 3; - - // Represents the enumeration of various states of the NeoFS node. - enum State { - // Undefined state. - Unknown = 0; - - // Active state on the network. - Online = 1; - - // Network unavailable state. - Offline = 2; - } - - // Carries state of the NeoFS node. - State state = 4; -} diff --git a/netmap/types.proto b/netmap/types.proto index a0e4026..54ec189 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -54,3 +54,39 @@ message PlacementRule { repeated SFGroup SFGroups = 2; } + +// Groups the information about the NeoFS node. +message NodeInfo { + // Carries network address of the NeoFS node. + string Address = 1; + + // Carries public key of the NeoFS node in a binary format. + bytes PublicKey = 2; + + // Groups attributes of the NeoFS node. + message Attribute { + // Carries string key to the node attribute. + string Key = 1; + + // Carries string value of the node attribute. + string Value = 2; + } + + // // Carries list of the NeoFS node attributes in a string key-value format. + repeated Attribute Attributes = 3; + + // Represents the enumeration of various states of the NeoFS node. + enum State { + // Undefined state. + Unknown = 0; + + // Active state on the network. + Online = 1; + + // Network unavailable state. + Offline = 2; + } + + // Carries state of the NeoFS node. + State state = 4; +} \ No newline at end of file diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index e961682..4e25adb 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -6,6 +6,8 @@ - [netmap/types.proto](#netmap/types.proto) - Messages + - [NodeInfo](#netmap.NodeInfo) + - [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) - [PlacementRule](#netmap.PlacementRule) - [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) - [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) @@ -27,6 +29,32 @@ + + +### Message NodeInfo +Groups the information about the NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Address | [string](#string) | | Carries network address of the NeoFS node. | +| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | +| Attributes | [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | +| state | [NodeInfo.State](#netmap.NodeInfo.State) | | Carries state of the NeoFS node. | + + + + +### Message NodeInfo.Attribute +Groups attributes of the NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Carries string key to the node attribute. | +| Value | [string](#string) | | Carries string value of the node attribute. | + + ### Message PlacementRule @@ -102,6 +130,19 @@ + + +### NodeInfo.State +Represents the enumeration of various states of the NeoFS node. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| Unknown | 0 | Undefined state. | +| Online | 1 | Active state on the network. | +| Offline | 2 | Network unavailable state. | + + + ### PlacementRule.SFGroup.Filter.SimpleFilter.Operation From d38377793af1f01653e0779d13305419c7256ab6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:01:24 +0300 Subject: [PATCH 124/440] [#32] acl: 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 acl package. Signed-off-by: Leonard Lyubich --- acl/types.proto | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 2479ef8..2a5d7cf 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -4,8 +4,6 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; option csharp_namespace = "NeoFS.API.Acl"; import "refs/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; -option (gogoproto.stable_marshaler_all) = true; // Target of the access control rule in access control list. enum Target { @@ -42,7 +40,7 @@ message EACLRecord { } // Operation carries type of operation. - Operation operation = 1 [(gogoproto.customname) = "Operation", json_name="Operation"]; + Operation operation = 1 [json_name = "Operation"]; // Action is an enumeration of EACL actions. enum Action { @@ -52,7 +50,7 @@ message EACLRecord { } // Action carries ACL target action. - Action action = 2 [(gogoproto.customname) = "Action", json_name="Action"]; + Action action = 2 [json_name = "Action"]; // FilterInfo groups information about filter. message FilterInfo { @@ -65,7 +63,7 @@ message EACLRecord { } // Header carries type of header. - Header header = 1 [(gogoproto.customname) = "Header", json_name="HeaderType"]; + Header header = 1 [json_name = "HeaderType"]; // MatchType is an enumeration of match types. enum MatchType { @@ -75,7 +73,7 @@ message EACLRecord { } // MatchType carries type of match. - MatchType matchType = 2 [(gogoproto.customname) = "MatchType", json_name="MatchType"]; + MatchType matchType = 2 [json_name = "MatchType"]; // HeaderName carries name of filtering header. string HeaderName = 3 [json_name="Name"]; From fca07c84d6649ea871bf27f84ece61ea88eaaffe Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:10:09 +0300 Subject: [PATCH 125/440] acl: Tidy up the format Signed-off-by: Leonard Lyubich --- acl/types.proto | 13 ++++++------- proto-docs/acl.md | 3 +-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 2a5d7cf..c6225d8 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package acl; + option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; option csharp_namespace = "NeoFS.API.Acl"; @@ -11,18 +13,14 @@ enum Target { Unknown = 0; // User target rule is applied if sender is the owner of the container. - User = 1; + User = 1; // System target rule is applied if sender is the storage node within the // container or inner ring node. - System = 2; + System = 2; // Others target rule is applied if sender is not user or system target. - Others = 3; - - // PubKey target rule is applied if sender has public key provided in - // extended ACL. - PubKey = 4; + Others = 3; } // EACLRecord groups information about extended ACL rule. @@ -102,6 +100,7 @@ message EACLRecord { message EACLTable { // Carries identifier of the container that should use given access control rules. refs.ContainerID ContainerID = 1 [json_name="ContainerID"]; + // Records carries list of extended ACL rule records. repeated EACLRecord Records = 2 [json_name="Records"]; } diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 475e981..d653214 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -73,7 +73,7 @@ EACLRecord carries the information about extended ACL rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [bytes](#bytes) | | ContainerID of the container that should use given access control rules. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | | Records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | @@ -148,7 +148,6 @@ Target of the access control rule in access control list. | User | 1 | User target rule is applied if sender is the owner of the container. | | System | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | | Others | 3 | Others target rule is applied if sender is not user or system target. | -| PubKey | 4 | PubKey target rule is applied if sender has public key provided in extended ACL. | From 0046e8fb14ea7829d521618075003c65de5c7442 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:12:34 +0300 Subject: [PATCH 126/440] [#32] container: 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 container package. Signed-off-by: Leonard Lyubich --- container/service.proto | 3 --- container/types.proto | 3 --- 2 files changed, 6 deletions(-) diff --git a/container/service.proto b/container/service.proto index 5f01591..2ae4ced 100644 --- a/container/service.proto +++ b/container/service.proto @@ -6,9 +6,6 @@ option csharp_namespace = "NeoFS.API.Container"; import "acl/types.proto"; import "container/types.proto"; import "refs/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; // Service provides API to access container smart-contract in morph chain // via NeoFS node. diff --git a/container/types.proto b/container/types.proto index d3cc147..d9160ae 100644 --- a/container/types.proto +++ b/container/types.proto @@ -5,9 +5,6 @@ option csharp_namespace = "NeoFS.API.Container"; import "refs/types.proto"; import "github.com/nspcc-dev/netmap/selector.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes From f9c865eb53dc3d4314dc849ef6b2e868285543e2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:15:57 +0300 Subject: [PATCH 127/440] [#34] container: Import PlacementRule from netmap Replaces import of PlacementRule message from netmap repository with a message from the internal netmap package. Signed-off-by: Leonard Lyubich --- container/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/types.proto b/container/types.proto index d9160ae..5db48f0 100644 --- a/container/types.proto +++ b/container/types.proto @@ -4,7 +4,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; import "refs/types.proto"; -import "github.com/nspcc-dev/netmap/selector.proto"; +import "netmap/types.proto"; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes From 12dd5e07ba44fa35dd52fdb97666f258c6d51322 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:20:53 +0300 Subject: [PATCH 128/440] container: Tidy up the format Signed-off-by: Leonard Lyubich --- container/service.proto | 13 ++++++++++--- container/types.proto | 43 ++++++++++++++++++++++++----------------- proto-docs/container.md | 28 +++++++++++++-------------- 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/container/service.proto b/container/service.proto index 2ae4ced..450ccab 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package container; + option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; @@ -42,9 +44,11 @@ service Service { message PutRequest { // Container to create in NeoFS. container.Container Container = 1; + // PublicKey of container owner. It can be public key of the owner // or it can be public key that bound in neofs.id smart-contract. bytes PublicKey = 2; + // Signature of stable-marshalled container according to RFC-6979. bytes Signature = 3; } @@ -57,8 +61,9 @@ message PutResponse { message DeleteRequest { // ContainerID carries identifier of the container to delete from NeoFS. refs.ContainerID ContainerID = 1; + // Signature of container id according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } // DeleteResponse is empty because delete operation is asynchronous and done @@ -89,8 +94,9 @@ message ListResponse { message SetExtendedACLRequest { // EACL to set for the container. acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } message SetExtendedACLResponse {} @@ -103,6 +109,7 @@ message GetExtendedACLRequest { message GetExtendedACLResponse { // EACL that has been requested if it was set up. acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } diff --git a/container/types.proto b/container/types.proto index 5db48f0..c05fe7d 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package container; + option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; @@ -11,23 +13,28 @@ import "netmap/types.proto"; // and access control information. ID of the container is a 32 byte long // SHA256 hash of stable-marshalled container message. message Container { - // OwnerID carries identifier of the container owner. + // OwnerID carries identifier of the container owner. refs.OwnerID OwnerID = 1; - // Nonce is a 16 byte UUID, used to avoid collisions of container id. - bytes Nonce = 2; - // BasicACL contains access control rules for owner, system, others groups and - // permission bits for bearer token and Extended ACL. - uint32 BasicACL = 3; - // Attributes define any immutable characteristics of container. - repeated Attribute Attributes = 4; - // Rules define storage policy for the object inside the container. - netmap.PlacementRule Rules = 5; -} -// Attribute is a key-value pair of strings. -message Attribute { - // Key of immutable container attribute. - string Key = 1; - // Value of immutable container attribute. - string Value = 2; -} \ No newline at end of file + // Nonce is a 16 byte UUID, used to avoid collisions of container id. + bytes Nonce = 2; + + // BasicACL contains access control rules for owner, system, others groups and + // permission bits for bearer token and Extended ACL. + uint32 BasicACL = 3; + + // Attribute is a key-value pair of strings. + message Attribute { + // Key of immutable container attribute. + string Key = 1; + + // Value of immutable container attribute. + string Value = 2; + } + + // Attributes define any immutable characteristics of container. + repeated Attribute Attributes = 4; + + // Rules define storage policy for the object inside the container. + netmap.PlacementRule Rules = 5; +} diff --git a/proto-docs/container.md b/proto-docs/container.md index 1fb70bd..14bf6e7 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -25,8 +25,8 @@ - [container/types.proto](#container/types.proto) - Messages - - [Attribute](#container.Attribute) - [Container](#container.Container) + - [Container.Attribute](#container.Container.Attribute) - [Scalar Value Types](#scalar-value-types) @@ -256,18 +256,6 @@ via consensus in inner ring nodes - - -### Message Attribute -Attribute is a key-value pair of strings. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Key of immutable container attribute. | -| Value | [string](#string) | | Value of immutable container attribute. | - - ### Message Container @@ -282,9 +270,21 @@ SHA256 hash of stable-marshalled container message. | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | | Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | -| Attributes | [Attribute](#container.Attribute) | repeated | Attributes define any immutable characteristics of container. | +| Attributes | [Container.Attribute](#container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | | Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | + + + +### Message Container.Attribute +Attribute is a key-value pair of strings. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Key of immutable container attribute. | +| Value | [string](#string) | | Value of immutable container attribute. | + From 9fadf4cc84bf55e930bde68d218c988d4d678198 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:22:24 +0300 Subject: [PATCH 129/440] [#32] refs: 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 refs package. Signed-off-by: Leonard Lyubich --- refs/types.proto | 7 ------- 1 file changed, 7 deletions(-) diff --git a/refs/types.proto b/refs/types.proto index 2066a02..2fdaef4 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -3,13 +3,6 @@ package refs; option go_package = "github.com/nspcc-dev/neofs-api-go/refs"; option csharp_namespace = "NeoFS.API.Refs"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_stringer_all) = false; - // Address of object (container id + object id) message Address { // ObjectID carries object identifier. From 46fe7b93cd73faeb5d7d47760ec4800a774c4d0c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:23:57 +0300 Subject: [PATCH 130/440] refs: Tidy up the format Signed-off-by: Leonard Lyubich --- proto-docs/refs.md | 2 +- refs/types.proto | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index bf57211..99d2151 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -33,8 +33,8 @@ Address of object (container id + object id) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | | ContainerID | [ContainerID](#refs.ContainerID) | | ContainerID carries container identifier. | +| ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | diff --git a/refs/types.proto b/refs/types.proto index 2fdaef4..0dda985 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,14 +1,17 @@ syntax = "proto3"; + package refs; + option go_package = "github.com/nspcc-dev/neofs-api-go/refs"; option csharp_namespace = "NeoFS.API.Refs"; // Address of object (container id + object id) message Address { - // ObjectID carries object identifier. - ObjectID ObjectID = 1; // ContainerID carries container identifier. - ContainerID ContainerID = 2; + ContainerID ContainerID = 1; + + // ObjectID carries object identifier. + ObjectID ObjectID = 2; } // ObjectID groups information about the NeoFS object identifier. From a8beb62693e002faf9bb823c55cae4580455166c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:34:11 +0300 Subject: [PATCH 131/440] [#32] service: 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 service package. Signed-off-by: Leonard Lyubich --- service/meta.proto | 8 ++------ service/verify.proto | 15 ++++++--------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/service/meta.proto b/service/meta.proto index 8171980..34304ee 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -3,10 +3,6 @@ package service; option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - // RequestMetaHeader contains information about request meta headers // (should be embedded into message) message RequestMetaHeader { @@ -20,7 +16,7 @@ message RequestMetaHeader { // Raw determines whether the request is raw or not bool Raw = 4; // ExtendedHeader carries extended headers of the request - RequestExtendedHeader ExtendedHeader = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + RequestExtendedHeader ExtendedHeader = 5; } // ResponseMetaHeader contains meta information based on request processing by server @@ -45,5 +41,5 @@ message RequestExtendedHeader { } // Headers carries list of key-value headers - repeated KV Headers = 1 [(gogoproto.nullable) = false]; + repeated KV Headers = 1; } diff --git a/service/verify.proto b/service/verify.proto index 5206a33..9a91ced 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -4,9 +4,6 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; import "refs/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request // (should be embedded into message). @@ -32,7 +29,7 @@ message RequestVerificationHeader { message Token { message Info { // ID is a token identifier. valid UUIDv4 represented in bytes - bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; + bytes ID = 1; // OwnerID carries identifier of the manipulation object owner. refs.OwnerID OwnerID = 2; @@ -56,13 +53,13 @@ message Token { } // Verb is a type of request for which the token is issued - Verb verb = 3 [(gogoproto.customname) = "Verb"]; + Verb verb = 3; // Address is an object address for which token is issued - refs.Address Address = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; + refs.Address Address = 4; // Lifetime is a lifetime of the session - TokenLifetime Lifetime = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + TokenLifetime Lifetime = 5; // SessionKey is a public key of session key bytes SessionKey = 6; @@ -72,7 +69,7 @@ message Token { } // TokenInfo is a grouped information about token - Info TokenInfo = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Info TokenInfo = 1; // Signature is a signature of session token information bytes Signature = 8; @@ -109,7 +106,7 @@ message BearerTokenMsg { } // TokenInfo is a grouped information about token - Info TokenInfo = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + Info TokenInfo = 1; // OwnerKey is a public key of the token owner bytes OwnerKey = 2; From 58f34763c07e1cdb628600cb44dc3e8bf0125633 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:37:14 +0300 Subject: [PATCH 132/440] [#32] session: 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 session package. Signed-off-by: Leonard Lyubich --- session/service.proto | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/session/service.proto b/session/service.proto index 2f50f37..3619a22 100644 --- a/session/service.proto +++ b/session/service.proto @@ -6,10 +6,6 @@ option csharp_namespace = "NeoFS.API.Session"; import "service/meta.proto"; import "service/verify.proto"; import "refs/types.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; - service Session { // Create opens new session between the client and the server @@ -22,18 +18,18 @@ message CreateRequest { refs.OwnerID OwnerID = 1; // Lifetime carries a lifetime of the session - service.TokenLifetime Lifetime = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.TokenLifetime Lifetime = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } // CreateResponse carries an information about the opened session message CreateResponse { // ID carries an identifier of session token - bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; + bytes ID = 1; // SessionKey carries a session public key bytes SessionKey = 2; From 53299d7841ebd5c3487670f64983356c114f95e5 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:41:03 +0300 Subject: [PATCH 133/440] [#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 --- object/service.proto | 65 +++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/object/service.proto b/object/service.proto index 735bb39..d11d24a 100644 --- a/object/service.proto +++ b/object/service.proto @@ -7,9 +7,6 @@ import "refs/types.proto"; import "object/types.proto"; import "service/meta.proto"; import "service/verify.proto"; -import "github.com/gogo/protobuf/gogoproto/gogo.proto"; - -option (gogoproto.stable_marshaler_all) = true; // Object service provides API for manipulating with the object. service Service { @@ -56,11 +53,11 @@ service Service { message GetRequest { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false]; + refs.Address Address = 1; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message GetResponse { @@ -72,7 +69,7 @@ message GetResponse { } // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message PutRequest { @@ -91,50 +88,50 @@ message PutRequest { } // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message PutResponse { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false]; + refs.Address Address = 1; // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message DeleteRequest { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false]; + refs.Address Address = 1; // OwnerID carries identifier of the object owner. refs.OwnerID OwnerID = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } // DeleteResponse is empty because we cannot guarantee permanent object removal // in distributed system. message DeleteResponse { // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message HeadRequest { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; + refs.Address Address = 1; // FullHeaders can be set true for extended headers in the object bool FullHeaders = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message HeadResponse { // Object without payload Object Object = 1; // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message SearchRequest { @@ -163,16 +160,16 @@ message SearchRequest { Query query = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message SearchResponse { // Addresses of found objects - repeated refs.Address Addresses = 1 [(gogoproto.nullable) = false]; + repeated refs.Address Addresses = 1; // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message Range { @@ -184,39 +181,39 @@ message Range { message GetRangeRequest { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false]; + refs.Address Address = 1; // Range of object's payload to return - Range Range = 2 [(gogoproto.nullable) = false]; + Range Range = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message GetRangeResponse { // Fragment of object's payload bytes Fragment = 1; // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } message GetRangeHashRequest { // Address of object (container id + object id) - refs.Address Address = 1 [(gogoproto.nullable) = false]; + refs.Address Address = 1; // Ranges of object's payload to calculate homomorphic hash - repeated Range Ranges = 2 [(gogoproto.nullable) = false]; + repeated Range Ranges = 2; // Salt is used to XOR object's payload ranges before hashing, it can be nil bytes Salt = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.RequestVerificationHeader Verify = 99; } message GetRangeHashResponse { // Hashes is a homomorphic hashes of all ranges - repeated bytes Hashes = 1 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; + repeated bytes Hashes = 1; // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + service.ResponseMetaHeader Meta = 99; } From 3518fc42bdfc2f68c62e6f81bc10d978b5be33e9 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:55:40 +0300 Subject: [PATCH 134/440] 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 --- object/service.proto | 8 ++++++++ proto-docs/object.md | 2 ++ proto-docs/service.md | 1 - service/meta.proto | 2 -- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index d11d24a..573e068 100644 --- a/object/service.proto +++ b/object/service.proto @@ -54,6 +54,10 @@ service Service { message GetRequest { // Address of object (container id + object id) refs.Address Address = 1; + // Raw carries the raw option flag of the request. + // Raw request is sent to receive only the objects + // that are physically stored on the server. + bool Raw = 2; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) @@ -122,6 +126,10 @@ message HeadRequest { refs.Address Address = 1; // FullHeaders can be set true for extended headers in the object bool FullHeaders = 2; + // Raw carries the raw option flag of the request. + // Raw request is sent to receive only the headers of the objects + // that are physically stored on the server. + bool Raw = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) service.RequestMetaHeader Meta = 98; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) diff --git a/proto-docs/object.md b/proto-docs/object.md index d6c98b4..ce800fc 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -228,6 +228,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| Raw | [bool](#bool) | | Raw carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | @@ -255,6 +256,7 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | +| Raw | [bool](#bool) | | Raw carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | diff --git a/proto-docs/service.md b/proto-docs/service.md index 72043c5..961f38e 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -72,7 +72,6 @@ RequestMetaHeader contains information about request meta headers | TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | -| Raw | [bool](#bool) | | Raw determines whether the request is raw or not | | ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request | diff --git a/service/meta.proto b/service/meta.proto index 34304ee..768fc75 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -13,8 +13,6 @@ message RequestMetaHeader { // Version defines protocol version // TODO: not used for now, should be implemented in future uint32 Version = 3; - // Raw determines whether the request is raw or not - bool Raw = 4; // ExtendedHeader carries extended headers of the request RequestExtendedHeader ExtendedHeader = 5; } From 23f571f76fc2c91a3311eb360470fc4d0875247c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 02:09:44 +0300 Subject: [PATCH 135/440] 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 --- object/service.proto | 15 --------------- proto-docs/object.md | 10 ---------- proto-docs/service.md | 14 -------------- service/meta.proto | 10 ---------- 4 files changed, 49 deletions(-) diff --git a/object/service.proto b/object/service.proto index 573e068..bf369fa 100644 --- a/object/service.proto +++ b/object/service.proto @@ -71,9 +71,6 @@ message GetResponse { // Chunk of remaining payload bytes Chunk = 2; } - - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message PutRequest { @@ -100,8 +97,6 @@ message PutRequest { message PutResponse { // Address of object (container id + object id) refs.Address Address = 1; - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message DeleteRequest { // Address of object (container id + object id) @@ -117,8 +112,6 @@ message DeleteRequest { // DeleteResponse is empty because we cannot guarantee permanent object removal // in distributed system. message DeleteResponse { - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message HeadRequest { @@ -138,8 +131,6 @@ message HeadRequest { message HeadResponse { // Object without payload Object Object = 1; - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message SearchRequest { @@ -176,8 +167,6 @@ message SearchRequest { message SearchResponse { // Addresses of found objects repeated refs.Address Addresses = 1; - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message Range { @@ -201,8 +190,6 @@ message GetRangeRequest { message GetRangeResponse { // Fragment of object's payload bytes Fragment = 1; - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } message GetRangeHashRequest { @@ -221,7 +208,5 @@ message GetRangeHashRequest { message GetRangeHashResponse { // Hashes is a homomorphic hashes of all ranges repeated bytes Hashes = 1; - // ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) - service.ResponseMetaHeader Meta = 99; } diff --git a/proto-docs/object.md b/proto-docs/object.md index ce800fc..df6833a 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -161,10 +161,6 @@ DeleteResponse is empty because we cannot guarantee permanent object removal in distributed system. -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | - @@ -190,7 +186,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Hashes | [bytes](#bytes) | repeated | Hashes is a homomorphic hashes of all ranges | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -216,7 +211,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Fragment | [bytes](#bytes) | | Fragment of object's payload | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -243,7 +237,6 @@ in distributed system. | ----- | ---- | ----- | ----------- | | object | [Object](#object.Object) | | Object header and some payload | | Chunk | [bytes](#bytes) | | Chunk of remaining payload | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -270,7 +263,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Object | [Object](#object.Object) | | Object without payload | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -308,7 +300,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | @@ -371,7 +362,6 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | Addresses | [refs.Address](#refs.Address) | repeated | Addresses of found objects | -| Meta | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | ResponseMetaHeader contains meta information based on request processing by server (should be embedded into message) | diff --git a/proto-docs/service.md b/proto-docs/service.md index 961f38e..8cad084 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -9,7 +9,6 @@ - [RequestExtendedHeader](#service.RequestExtendedHeader) - [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) - [RequestMetaHeader](#service.RequestMetaHeader) - - [ResponseMetaHeader](#service.ResponseMetaHeader) - [service/verify.proto](#service/verify.proto) @@ -74,19 +73,6 @@ RequestMetaHeader contains information about request meta headers | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | | ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request | - - - -### Message ResponseMetaHeader -ResponseMetaHeader contains meta information based on request processing by server -(should be embedded into message) - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Current NeoFS epoch on server | -| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | - diff --git a/service/meta.proto b/service/meta.proto index 768fc75..41e3776 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -17,16 +17,6 @@ message RequestMetaHeader { RequestExtendedHeader ExtendedHeader = 5; } -// ResponseMetaHeader contains meta information based on request processing by server -// (should be embedded into message) -message ResponseMetaHeader { - // Current NeoFS epoch on server - uint64 Epoch = 1; - // Version defines protocol version - // TODO: not used for now, should be implemented in future - uint32 Version = 2; -} - // RequestExtendedHeader contains extended headers of request message RequestExtendedHeader { // KV contains string key-value pair From 0ca83fcef60aa39269dbc0d0a98d80d5c9faf466 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 02:25:50 +0300 Subject: [PATCH 136/440] service: Tidy up the format Signed-off-by: Leonard Lyubich --- object/service.proto | 1 - proto-docs/service.md | 52 +++++++++++++++---------------------------- service/meta.proto | 34 ++++++++++------------------ service/verify.proto | 20 ++++++----------- 4 files changed, 37 insertions(+), 70 deletions(-) diff --git a/object/service.proto b/object/service.proto index bf369fa..541d861 100644 --- a/object/service.proto +++ b/object/service.proto @@ -10,7 +10,6 @@ import "service/verify.proto"; // Object service provides API for manipulating with the object. service Service { - // Get the object from container. Response uses gRPC stream. First response // message carry object of requested address. Chunk messages are parts of // the object's payload if it is needed. All messages except first carry diff --git a/proto-docs/service.md b/proto-docs/service.md index 8cad084..fc0eb48 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,9 +6,8 @@ - [service/meta.proto](#service/meta.proto) - Messages - - [RequestExtendedHeader](#service.RequestExtendedHeader) - - [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) - [RequestMetaHeader](#service.RequestMetaHeader) + - [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) - [service/verify.proto](#service/verify.proto) @@ -36,42 +35,28 @@ - - -### Message RequestExtendedHeader -RequestExtendedHeader contains extended headers of request - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Headers | [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) | repeated | Headers carries list of key-value headers | - - - - -### Message RequestExtendedHeader.KV -KV contains string key-value pair - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| K | [string](#string) | | K carries extended header key | -| V | [string](#string) | | V carries extended header value | - - ### Message RequestMetaHeader -RequestMetaHeader contains information about request meta headers -(should be embedded into message) +RequestMetaHeader contains information about request meta headers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | -| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | -| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | -| ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request | +| TTL | [uint32](#uint32) | | Carries maximum number of nodes in the request route. | +| XHeaders | [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) | repeated | Carries request X-Headers. | + + + + +### Message RequestMetaHeader.XHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Key | [string](#string) | | Carries key to the X-Header. | +| Value | [string](#string) | | Carries value of the X-Header. | @@ -117,8 +102,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime ### Message RequestVerificationHeader -RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request -(should be embedded into message). +RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request. | Field | Type | Label | Description | @@ -136,8 +120,8 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| Key | [bytes](#bytes) | | Key is compressed public key used for signature. | | Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | -| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | diff --git a/service/meta.proto b/service/meta.proto index 41e3776..c2cb168 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -1,33 +1,23 @@ syntax = "proto3"; + package service; + option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; -// RequestMetaHeader contains information about request meta headers -// (should be embedded into message) +// RequestMetaHeader contains information about request meta headers. message RequestMetaHeader { - // TTL must be larger than zero, it decreased in every NeoFS Node - uint32 TTL = 1; - // Epoch for user can be empty, because node sets epoch to the actual value - uint64 Epoch = 2; - // Version defines protocol version - // TODO: not used for now, should be implemented in future - uint32 Version = 3; - // ExtendedHeader carries extended headers of the request - RequestExtendedHeader ExtendedHeader = 5; -} + // Carries maximum number of nodes in the request route. + uint32 TTL = 1; -// RequestExtendedHeader contains extended headers of request -message RequestExtendedHeader { - // KV contains string key-value pair - message KV { - // K carries extended header key - string K = 1; + message XHeader { + // Carries key to the X-Header. + string Key = 1; - // V carries extended header value - string V = 2; + // Carries value of the X-Header. + string Value = 2; } - // Headers carries list of key-value headers - repeated KV Headers = 1; + // Carries request X-Headers. + repeated XHeader XHeaders = 2; } diff --git a/service/verify.proto b/service/verify.proto index 9a91ced..76fd15e 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -1,18 +1,20 @@ syntax = "proto3"; + package service; + option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; import "refs/types.proto"; -// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request -// (should be embedded into message). +// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request. message RequestVerificationHeader { message Signature { + // Key is compressed public key used for signature. + bytes Key = 1; + // Sign is signature of the request or session key. - bytes Sign = 1; - // Peer is compressed public key used for signature. - bytes Peer = 2; + bytes Sign = 2; } // Signatures is a set of signatures of every passed NeoFS Node @@ -84,14 +86,6 @@ message TokenLifetime { uint64 ValidUntil = 2; } -// TODO: for variable token types and version redefine message -// Example: -// message Token { -// TokenType TokenType = 1; -// uint32 Version = 2; -// bytes Data = 3; -// } - // BearerTokenMsg carries information about request ACL rules with limited lifetime message BearerTokenMsg { message Info { From ad5126f53fcdc4d75312145c4fe9adddd77fa44e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 02:28:57 +0300 Subject: [PATCH 137/440] session: Tidy up the format Signed-off-by: Leonard Lyubich --- proto-docs/session.md | 18 +++++++++--------- session/service.proto | 27 ++++++++++++++++----------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/proto-docs/session.md b/proto-docs/session.md index 8ce09a0..0976757 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -36,7 +36,7 @@ rpc Create(CreateRequest) returns (CreateResponse); #### Method Create -Create opens new session between the client and the server +Create opens new session between the client and the server. | Name | Input | Output | | ---- | ----- | ------ | @@ -47,27 +47,27 @@ Create opens new session between the client and the server ### Message CreateRequest -CreateRequest carries an information necessary for opening a session +CreateRequest carries an information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries an identifier of a session initiator. | -| Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Lifetime carries a lifetime of the session | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | +| Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | ### Message CreateResponse -CreateResponse carries an information about the opened session +CreateResponse carries an information about the opened session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID carries an identifier of session token | -| SessionKey | [bytes](#bytes) | | SessionKey carries a session public key | +| ID | [bytes](#bytes) | | ID carries an identifier of session token. | +| SessionKey | [bytes](#bytes) | | SessionKey carries a session public key. | diff --git a/session/service.proto b/session/service.proto index 3619a22..cd11589 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package session; + option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; @@ -8,29 +10,32 @@ import "service/verify.proto"; import "refs/types.proto"; service Session { - // Create opens new session between the client and the server + // Create opens new session between the client and the server. rpc Create (CreateRequest) returns (CreateResponse); } -// CreateRequest carries an information necessary for opening a session +// CreateRequest carries an information necessary for opening a session. message CreateRequest { - // OwnerID carries an identifier of a session initiator. + // Carries an identifier of a session initiator. refs.OwnerID OwnerID = 1; - // Lifetime carries a lifetime of the session + // Carries a lifetime of the session. service.TokenLifetime Lifetime = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } -// CreateResponse carries an information about the opened session +// CreateResponse carries an information about the opened session. message CreateResponse { - // ID carries an identifier of session token + // ID carries an identifier of session token. bytes ID = 1; - // SessionKey carries a session public key + // SessionKey carries a session public key. bytes SessionKey = 2; } From 05a885e142b24a54b2b9228d5f19bcb745318c4b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 02:45:39 +0300 Subject: [PATCH 138/440] object: Tidy up the format Signed-off-by: Leonard Lyubich --- object/service.proto | 186 +++++++++++++++++++++++++++---------------- proto-docs/object.md | 90 ++++++++++----------- 2 files changed, 162 insertions(+), 114 deletions(-) diff --git a/object/service.proto b/object/service.proto index 541d861..b894187 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package object; + option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; @@ -51,61 +53,84 @@ service Service { } message GetRequest { - // Address of object (container id + object id) + // Carries the address of the requested object. refs.Address Address = 1; - // Raw carries the raw option flag of the request. + + // Carries the raw option flag of the request. // Raw request is sent to receive only the objects // that are physically stored on the server. bool Raw = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } message GetResponse { - oneof R { - // Object header and some payload - Object object = 1; - // Chunk of remaining payload - bytes Chunk = 2; + // Carries the single message of the response stream. + oneof ObjectPart { + // Carries the object header. + Header Header = 1; + + // Carries part of the object payload. + bytes Chunk = 2; } } message PutRequest { - message PutHeader { - // Object with at least container id and owner id fields - Object Object = 1; - // Number of the object copies to store within the RPC call (zero is processed according to the placement rules) + // Groups initialization parameters of object placement in NeoFS. + message Init { + // Carries the header of the object to save in the system. + Header Header = 1; + + // Carries the number of the object copies to store + // within the RPC call. Default zero value is processed according + // to the container placement rules. uint32 CopiesNumber = 2; } - oneof R { - // Header should be the first message in the stream - PutHeader Header = 1; - // Chunk should be a remaining message in stream should be chunks - bytes Chunk = 2; + // Carries the single part of the query stream. + oneof Part { + // Carries the initialization parameters of the object stream. + Init init = 1; + + // Carries part of the object payload. + bytes Chunk = 2; } - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } message PutResponse { - // Address of object (container id + object id) - refs.Address Address = 1; + // Carries identifier of the saved object. + // It is used to access an object in the container. + refs.ObjectID ObjectID = 1; } + message DeleteRequest { - // Address of object (container id + object id) + // Carries the address of the object to be deleted. refs.Address Address = 1; - // OwnerID carries identifier of the object owner. + + // Carries identifier the object owner. refs.OwnerID OwnerID = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } // DeleteResponse is empty because we cannot guarantee permanent object removal @@ -114,26 +139,33 @@ message DeleteResponse { } message HeadRequest { - // Address of object (container id + object id) + // Carries the address of the object with the requested header. refs.Address Address = 1; - // FullHeaders can be set true for extended headers in the object - bool FullHeaders = 2; - // Raw carries the raw option flag of the request. + + // Carries the option to crop header to main part. + bool MainOnly = 2; + + // Carries the raw option flag of the request. // Raw request is sent to receive only the headers of the objects // that are physically stored on the server. bool Raw = 3; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } + message HeadResponse { - // Object without payload - Object Object = 1; + // Carries the requested object header. + Header Header = 1; } message SearchRequest { - // ContainerID carries search container identifier. + // Carries search container identifier. refs.ContainerID ContainerID = 1; message Query { @@ -157,55 +189,71 @@ message SearchRequest { Query query = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } message SearchResponse { - // Addresses of found objects - repeated refs.Address Addresses = 1; + // Carries list of object identifiers that match the search query. + repeated refs.ObjectID IDList = 1; } +// Range groups the parameters of object payload range. message Range { - // Offset of the data range + // Carries the offset of the range from the object payload start. uint64 Offset = 1; - // Length of the data range + + // Carries the length of the object payload range. uint64 Length = 2; } message GetRangeRequest { - // Address of object (container id + object id) + // Address carries address of the object that contains the requested payload range. refs.Address Address = 1; - // Range of object's payload to return + + // Range carries the parameters of the requested payload range. Range Range = 2; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } message GetRangeResponse { - // Fragment of object's payload - bytes Fragment = 1; + // Carries part of the object payload. + bytes Chunk = 1; } message GetRangeHashRequest { - // Address of object (container id + object id) + // Carries address of the object that contains the requested payload range. refs.Address Address = 1; - // Ranges of object's payload to calculate homomorphic hash + + // Carries the list of object payload range to calculate homomorphic hash. repeated Range Ranges = 2; - // Salt is used to XOR object's payload ranges before hashing, it can be nil - bytes Salt = 3; - // RequestMetaHeader contains information about request meta headers (should be embedded into message) - service.RequestMetaHeader Meta = 98; - // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) - service.RequestVerificationHeader Verify = 99; + + // Carries binary salt to XOR object payload ranges before hash calculation. + bytes Salt = 3; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader MetaHeader = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader VerifyHeader = 99; } message GetRangeHashResponse { - // Hashes is a homomorphic hashes of all ranges - repeated bytes Hashes = 1; + // Carries list of homomorphic hashes in a binary format. + repeated bytes HashList = 1; } diff --git a/proto-docs/object.md b/proto-docs/object.md index df6833a..7f620ae 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -19,7 +19,7 @@ - [HeadRequest](#object.HeadRequest) - [HeadResponse](#object.HeadResponse) - [PutRequest](#object.PutRequest) - - [PutRequest.PutHeader](#object.PutRequest.PutHeader) + - [PutRequest.Init](#object.PutRequest.Init) - [PutResponse](#object.PutResponse) - [Range](#object.Range) - [SearchRequest](#object.SearchRequest) @@ -148,10 +148,10 @@ calculated for XORed data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | +| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -170,11 +170,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to calculate homomorphic hash | -| Salt | [bytes](#bytes) | | Salt is used to XOR object's payload ranges before hashing, it can be nil | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Address | [refs.Address](#refs.Address) | | Carries address of the object that contains the requested payload range. | +| Ranges | [Range](#object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | +| Salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -185,7 +185,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Hashes | [bytes](#bytes) | repeated | Hashes is a homomorphic hashes of all ranges | +| HashList | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | @@ -196,10 +196,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Range | [Range](#object.Range) | | Range of object's payload to return | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | +| Range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -210,7 +210,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Fragment | [bytes](#bytes) | | Fragment of object's payload | +| Chunk | [bytes](#bytes) | | Carries part of the object payload. | @@ -221,10 +221,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| Raw | [bool](#bool) | | Raw carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Address | [refs.Address](#refs.Address) | | Carries the address of the requested object. | +| Raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -235,8 +235,8 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object | [Object](#object.Object) | | Object header and some payload | -| Chunk | [bytes](#bytes) | | Chunk of remaining payload | +| Header | [Header](#object.Header) | | Carries the object header. | +| Chunk | [bytes](#bytes) | | Carries part of the object payload. | @@ -247,11 +247,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | -| Raw | [bool](#bool) | | Raw carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| Address | [refs.Address](#refs.Address) | | Carries the address of the object with the requested header. | +| MainOnly | [bool](#bool) | | Carries the option to crop header to main part. | +| Raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -262,7 +262,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Object | [Object](#object.Object) | | Object without payload | +| Header | [Header](#object.Header) | | Carries the requested object header. | @@ -273,22 +273,22 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Header | [PutRequest.PutHeader](#object.PutRequest.PutHeader) | | Header should be the first message in the stream | -| Chunk | [bytes](#bytes) | | Chunk should be a remaining message in stream should be chunks | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| init | [PutRequest.Init](#object.PutRequest.Init) | | Carries the initialization parameters of the object stream. | +| Chunk | [bytes](#bytes) | | Carries part of the object payload. | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - -### Message PutRequest.PutHeader + +### Message PutRequest.Init +Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Object | [Object](#object.Object) | | Object with at least container id and owner id fields | -| CopiesNumber | [uint32](#uint32) | | Number of the object copies to store within the RPC call (zero is processed according to the placement rules) | +| Header | [Header](#object.Header) | | Carries the header of the object to save in the system. | +| CopiesNumber | [uint32](#uint32) | | Carries the number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | @@ -299,19 +299,19 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | +| ObjectID | [refs.ObjectID](#refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | ### Message Range - +Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Offset | [uint64](#uint64) | | Offset of the data range | -| Length | [uint64](#uint64) | | Length of the data range | +| Offset | [uint64](#uint64) | | Carries the offset of the range from the object payload start. | +| Length | [uint64](#uint64) | | Carries the length of the object payload range. | @@ -322,10 +322,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries search container identifier. | +| ContainerID | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | | query | [SearchRequest.Query](#object.SearchRequest.Query) | | | -| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | -| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | +| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -361,7 +361,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Addresses | [refs.Address](#refs.Address) | repeated | Addresses of found objects | +| IDList | [refs.ObjectID](#refs.ObjectID) | repeated | Carries list of object identifiers that match the search query. | From 96ddb868bcb95c53c5b1e71b24800aaa5f177e87 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 12:28:13 +0300 Subject: [PATCH 139/440] [#31] service: Change BearerTokenMsg.Info.ACLRules field type It was originally planned to transport extended ACL table in binary form. However, from time on, it was decided to abandon this approach in favor of the declared message structure (acl.EACLTable). In this regard, this commit changes the type and name of the binary BearerTokenMsg.Info.ACLRules field to EACLTable. Signed-off-by: Leonard Lyubich --- proto-docs/service.md | 2 +- service/verify.proto | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index fc0eb48..2307191 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -94,7 +94,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ACLRules | [bytes](#bytes) | | ACLRules carries a binary representation of the table of extended ACL rules | +| EACLTable | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules. | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. | | ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | diff --git a/service/verify.proto b/service/verify.proto index 76fd15e..46a8fac 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -5,6 +5,7 @@ package service; option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; +import "acl/types.proto"; import "refs/types.proto"; // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request. @@ -89,8 +90,8 @@ message TokenLifetime { // BearerTokenMsg carries information about request ACL rules with limited lifetime message BearerTokenMsg { message Info { - // ACLRules carries a binary representation of the table of extended ACL rules - bytes ACLRules = 1; + // EACLTable carries table of extended ACL rules. + acl.EACLTable EACLTable = 1; // OwnerID carries identifier of the token owner. refs.OwnerID OwnerID = 2; From 5fe4c2734e0c5056dbec25ce37f960ae6f17f9e7 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 7 Aug 2020 09:48:09 +0300 Subject: [PATCH 140/440] [#33] Remove unused headers Remove MetaHeader and VerifyHeader from balance request as these fields are also removed from all container related requests. Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 8 -------- proto-docs/accounting.md | 2 -- 2 files changed, 10 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index f08a312..2dbfbc0 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -25,14 +25,6 @@ service Accounting { message BalanceRequest { // Carries user identifier in NeoFS system for which the balance is requested. refs.OwnerID OwnerID = 1; - - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; - - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; } // Decimal represents the decimal numbers. diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 14d9c7c..ffab500 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -60,8 +60,6 @@ to the requirements from the system specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | From e75ef537936a4d4b6f22cedce84f33c54db7ddff Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 7 Aug 2020 00:59:50 +0300 Subject: [PATCH 141/440] [#32] Rename fields according to Protobuf Style Guide Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 16 +++---- acl/types.proto | 58 ++++++++++++------------- container/service.proto | 47 ++++++++++---------- container/types.proto | 14 +++--- netmap/types.proto | 46 ++++++++++---------- object/service.proto | 92 ++++++++++++++++++++-------------------- object/types.proto | 78 +++++++++++++++++----------------- refs/types.proto | 20 ++++----- service/meta.proto | 8 ++-- service/verify.proto | 66 ++++++++++++++-------------- session/service.proto | 16 +++---- storagegroup/types.proto | 14 +++--- 12 files changed, 236 insertions(+), 239 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 2dbfbc0..cb36c85 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -5,8 +5,6 @@ package accounting; option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; -import "service/meta.proto"; -import "service/verify.proto"; import "refs/types.proto"; // The service provides methods for obtaining information @@ -18,22 +16,22 @@ service Accounting { // Message defines the request body of Balance method. // -// To indicate the account for which the balance is requested, its identifier is used. +// To indicate the account for which the balance is requested, it's identifier is used. // // To gain access to the requested information, the request body must be formed according // to the requirements from the system specification. message BalanceRequest { // Carries user identifier in NeoFS system for which the balance is requested. - refs.OwnerID OwnerID = 1; + refs.OwnerID owner_id = 1; } // Decimal represents the decimal numbers. message Decimal { - // Value carries number value. - int64 Value = 1; + // value carries number value. + int64 value = 1; - // Precision carries value precision. - uint32 Precision = 2; + // precision carries value precision. + uint32 precision = 2; } // Message defines the response body of Balance method. @@ -41,5 +39,5 @@ message Decimal { // The amount of funds is calculated in decimal numbers. message BalanceResponse { // Carries the amount of funds on the account. - Decimal Balance = 1; + Decimal balance = 1; } diff --git a/acl/types.proto b/acl/types.proto index c6225d8..d0975b0 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -10,17 +10,17 @@ import "refs/types.proto"; // Target of the access control rule in access control list. enum Target { // Unknown target, default value. - Unknown = 0; + UNKNOWN = 0; // User target rule is applied if sender is the owner of the container. - User = 1; + USER = 1; // System target rule is applied if sender is the storage node within the // container or inner ring node. - System = 2; + SYSTEM = 2; // Others target rule is applied if sender is not user or system target. - Others = 3; + OTHERS = 3; } // EACLRecord groups information about extended ACL rule. @@ -42,9 +42,9 @@ message EACLRecord { // Action is an enumeration of EACL actions. enum Action { - ActionUnknown = 0; - Allow = 1; - Deny = 2; + ACTION_UNKNOWN = 0; + ALLOW = 1; + DENY = 2; } // Action carries ACL target action. @@ -54,10 +54,10 @@ message EACLRecord { message FilterInfo { // Header is an enumeration of filtering header types. enum Header { - HeaderUnknown = 0; - Request = 1; - ObjectSystem = 2; - ObjectUser = 3; + HEADER_UNKNOWN = 0; + REQUEST = 1; + OBJECT_SYSTEM = 2; + OBJECT_USER = 3; } // Header carries type of header. @@ -65,42 +65,42 @@ message EACLRecord { // MatchType is an enumeration of match types. enum MatchType { - MatchUnknown = 0; - StringEqual = 1; - StringNotEqual = 2; + MATCH_UNKNOWN = 0; + STRING_EQUAL = 1; + STRING_NOT_EQUAL = 2; } // MatchType carries type of match. - MatchType matchType = 2 [json_name = "MatchType"]; + MatchType match_type = 2 [json_name = "MatchType"]; - // HeaderName carries name of filtering header. - string HeaderName = 3 [json_name="Name"]; + // header_name carries name of filtering header. + string header_name = 3 [json_name="Name"]; - // HeaderVal carries value of filtering header. - string HeaderVal = 4 [json_name="Value"]; + // header_val carries value of filtering header. + string header_val = 4 [json_name="Value"]; } - // Filters carries set of filters. - repeated FilterInfo Filters = 3 [json_name="Filters"]; + // filters carries set of filters. + repeated FilterInfo filters = 3 [json_name="Filters"]; // TargetInfo groups information about extended ACL target. message TargetInfo { - // Target carries target of ACL rule. - acl.Target Target = 1 [json_name="Role"]; + // target carries target of ACL rule. + acl.Target target = 1 [json_name="Role"]; - // KeyList carries public keys of ACL target. - repeated bytes KeyList = 2 [json_name="Keys"]; + // key_list carries public keys of ACL target. + repeated bytes key_list = 2 [json_name="Keys"]; } - // Targets carries information about extended ACL target list. - repeated TargetInfo Targets = 4 [json_name="Targets"]; + // targets carries information about extended ACL target list. + repeated TargetInfo targets = 4 [json_name="Targets"]; } // EACLRecord carries the information about extended ACL rules. message EACLTable { // Carries identifier of the container that should use given access control rules. - refs.ContainerID ContainerID = 1 [json_name="ContainerID"]; + refs.ContainerID container_id = 1 [json_name="ContainerID"]; // Records carries list of extended ACL rule records. - repeated EACLRecord Records = 2 [json_name="Records"]; + repeated EACLRecord records = 2 [json_name="Records"]; } diff --git a/container/service.proto b/container/service.proto index 450ccab..cf9b848 100644 --- a/container/service.proto +++ b/container/service.proto @@ -43,73 +43,72 @@ service Service { message PutRequest { // Container to create in NeoFS. - container.Container Container = 1; + container.Container container = 1; - // PublicKey of container owner. It can be public key of the owner + // Public Key of container owner. It can be public key of the owner // or it can be public key that bound in neofs.id smart-contract. - bytes PublicKey = 2; + bytes public_key = 2; // Signature of stable-marshalled container according to RFC-6979. - bytes Signature = 3; + bytes signature = 3; } message PutResponse { - // ContainerID carries identifier of the new container. - refs.ContainerID ContainerID = 1; + // container_id carries identifier of the new container. + refs.ContainerID container_id = 1; } message DeleteRequest { - // ContainerID carries identifier of the container to delete from NeoFS. - refs.ContainerID ContainerID = 1; + // container_id carries identifier of the container to delete from NeoFS. + refs.ContainerID container_id = 1; // Signature of container id according to RFC-6979. - bytes Signature = 2; + bytes signature = 2; } // DeleteResponse is empty because delete operation is asynchronous and done // via consensus in inner ring nodes message DeleteResponse {} - message GetRequest { - // ContainerID carries identifier of the container to get. - refs.ContainerID ContainerID = 1; + // container_id carries identifier of the container to get. + refs.ContainerID container_id = 1; } message GetResponse { // Container that has been requested. - container.Container Container = 1; + container.Container container = 1; } message ListRequest { - // OwnerID carries identifier of the container owner. - refs.OwnerID OwnerID = 1; + // owner_id carries identifier of the container owner. + refs.OwnerID owner_id = 1; } message ListResponse { // ContainerIDs carries list of identifiers of the containers that belong to the owner. - repeated refs.ContainerID ContainerIDs = 1; + repeated refs.ContainerID container_ids = 1; } message SetExtendedACLRequest { - // EACL to set for the container. - acl.EACLTable EACL = 1; + // Extended ACL to set for the container. + acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes signature = 2; } message SetExtendedACLResponse {} message GetExtendedACLRequest { - // ContainerID carries identifier of the container that has Extended ACL. - refs.ContainerID ContainerID = 1; + // container_id carries identifier of the container that has Extended ACL. + refs.ContainerID container_id = 1; } message GetExtendedACLResponse { - // EACL that has been requested if it was set up. - acl.EACLTable EACL = 1; + // Extended ACL that has been requested if it was set up. + acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes signature = 2; } diff --git a/container/types.proto b/container/types.proto index c05fe7d..66fa580 100644 --- a/container/types.proto +++ b/container/types.proto @@ -14,27 +14,27 @@ import "netmap/types.proto"; // SHA256 hash of stable-marshalled container message. message Container { // OwnerID carries identifier of the container owner. - refs.OwnerID OwnerID = 1; + refs.OwnerID owner_id = 1; // Nonce is a 16 byte UUID, used to avoid collisions of container id. - bytes Nonce = 2; + bytes nonce = 2; // BasicACL contains access control rules for owner, system, others groups and // permission bits for bearer token and Extended ACL. - uint32 BasicACL = 3; + uint32 basic_acl = 3; // Attribute is a key-value pair of strings. message Attribute { // Key of immutable container attribute. - string Key = 1; + string key = 1; // Value of immutable container attribute. - string Value = 2; + string value = 2; } // Attributes define any immutable characteristics of container. - repeated Attribute Attributes = 4; + repeated Attribute attributes = 4; // Rules define storage policy for the object inside the container. - netmap.PlacementRule Rules = 5; + netmap.PlacementRule rules = 5; } diff --git a/netmap/types.proto b/netmap/types.proto index 54ec189..ce367f3 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -6,14 +6,14 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/netmap"; option csharp_namespace = "NeoFS.API.Netmap"; message PlacementRule { - uint32 ReplFactor = 1; + uint32 repl_factor = 1; message SFGroup { message Filter { - string Key = 1; + string key = 1; message SimpleFilters { - repeated SimpleFilter Filters = 1; + repeated SimpleFilter filters = 1; } message SimpleFilter { @@ -29,62 +29,62 @@ message PlacementRule { AND = 8; } - Operation Op = 1; + Operation op = 1; oneof Args { - string Value = 2; - SimpleFilters FArgs = 3; + string value = 2; + SimpleFilters f_args = 3; } } - SimpleFilter F = 2; + SimpleFilter f = 2; } - repeated Filter Filters = 1; + repeated Filter filters = 1; message Selector { - uint32 Count = 1; - string Key = 2; + uint32 count = 1; + string key = 2; } - repeated Selector Selectors = 2; + repeated Selector selectors = 2; - repeated uint32 Exclude = 3; + repeated uint32 exclude = 3; } - repeated SFGroup SFGroups = 2; + repeated SFGroup sf_groups = 2; } // Groups the information about the NeoFS node. message NodeInfo { // Carries network address of the NeoFS node. - string Address = 1; + string address = 1; // Carries public key of the NeoFS node in a binary format. - bytes PublicKey = 2; + bytes public_key = 2; // Groups attributes of the NeoFS node. message Attribute { // Carries string key to the node attribute. - string Key = 1; + string key = 1; // Carries string value of the node attribute. - string Value = 2; + string value = 2; } - // // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute Attributes = 3; + // Carries list of the NeoFS node attributes in a string key-value format. + repeated Attribute attributes = 3; // Represents the enumeration of various states of the NeoFS node. enum State { // Undefined state. - Unknown = 0; + UNKNOWN = 0; - // Active state on the network. - Online = 1; + // Active state in the network. + ONLINE = 1; // Network unavailable state. - Offline = 2; + OFFLINE = 2; } // Carries state of the NeoFS node. diff --git a/object/service.proto b/object/service.proto index b894187..bf31173 100644 --- a/object/service.proto +++ b/object/service.proto @@ -54,30 +54,30 @@ service Service { message GetRequest { // Carries the address of the requested object. - refs.Address Address = 1; + refs.Address address = 1; // Carries the raw option flag of the request. // Raw request is sent to receive only the objects // that are physically stored on the server. - bool Raw = 2; + bool raw = 2; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message GetResponse { // Carries the single message of the response stream. oneof ObjectPart { // Carries the object header. - Header Header = 1; + Header header = 1; // Carries part of the object payload. - bytes Chunk = 2; + bytes chunk = 2; } } @@ -85,12 +85,12 @@ message PutRequest { // Groups initialization parameters of object placement in NeoFS. message Init { // Carries the header of the object to save in the system. - Header Header = 1; + Header header = 1; // Carries the number of the object copies to store // within the RPC call. Default zero value is processed according // to the container placement rules. - uint32 CopiesNumber = 2; + uint32 copies_number = 2; } // Carries the single part of the query stream. @@ -99,38 +99,38 @@ message PutRequest { Init init = 1; // Carries part of the object payload. - bytes Chunk = 2; + bytes chunk = 2; } // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message PutResponse { // Carries identifier of the saved object. // It is used to access an object in the container. - refs.ObjectID ObjectID = 1; + refs.ObjectID object_id = 1; } message DeleteRequest { // Carries the address of the object to be deleted. - refs.Address Address = 1; + refs.Address address = 1; // Carries identifier the object owner. - refs.OwnerID OwnerID = 2; + refs.OwnerID owner_id = 2; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } // DeleteResponse is empty because we cannot guarantee permanent object removal @@ -140,120 +140,120 @@ message DeleteResponse { message HeadRequest { // Carries the address of the object with the requested header. - refs.Address Address = 1; + refs.Address address = 1; // Carries the option to crop header to main part. - bool MainOnly = 2; + bool main_only = 2; // Carries the raw option flag of the request. // Raw request is sent to receive only the headers of the objects // that are physically stored on the server. - bool Raw = 3; + bool raw = 3; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message HeadResponse { // Carries the requested object header. - Header Header = 1; + Header header = 1; } message SearchRequest { // Carries search container identifier. - refs.ContainerID ContainerID = 1; + refs.ContainerID container_id = 1; message Query { - uint32 Version = 1; + uint32 version = 1; message Filter { enum MatchType { - MatchUnknown = 0; - StringEqual = 1; + MATCH_UNKNOWN = 0; + STRING_EQUAL = 1; } - MatchType matchType = 1; + MatchType match_type = 1; - string Name = 2; + string name = 2; - string Value = 3; + string value = 3; } - repeated Filter Filters = 2; + repeated Filter filters = 2; } Query query = 2; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message SearchResponse { // Carries list of object identifiers that match the search query. - repeated refs.ObjectID IDList = 1; + repeated refs.ObjectID id_list = 1; } // Range groups the parameters of object payload range. message Range { // Carries the offset of the range from the object payload start. - uint64 Offset = 1; + uint64 offset = 1; // Carries the length of the object payload range. - uint64 Length = 2; + uint64 length = 2; } message GetRangeRequest { // Address carries address of the object that contains the requested payload range. - refs.Address Address = 1; + refs.Address address = 1; // Range carries the parameters of the requested payload range. - Range Range = 2; + Range range = 2; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message GetRangeResponse { // Carries part of the object payload. - bytes Chunk = 1; + bytes chunk = 1; } message GetRangeHashRequest { // Carries address of the object that contains the requested payload range. - refs.Address Address = 1; + refs.Address address = 1; // Carries the list of object payload range to calculate homomorphic hash. - repeated Range Ranges = 2; + repeated Range ranges = 2; // Carries binary salt to XOR object payload ranges before hash calculation. - bytes Salt = 3; + bytes salt = 3; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } message GetRangeHashResponse { // Carries list of homomorphic hashes in a binary format. - repeated bytes HashList = 1; + repeated bytes hash_list = 1; } diff --git a/object/types.proto b/object/types.proto index 8589355..e7776af 100644 --- a/object/types.proto +++ b/object/types.proto @@ -13,14 +13,14 @@ message Header { // Main groups mandatory information about the object. // Message fields are presented in all NeoFS objects. message Main { - // PayloadLength carries length of the object payload. + // payload_length carries length of the object payload. // Each object has a fixed payload length since it's immutable. - uint64 PayloadLength = 1; - // Address carries object address in the NeoFS system. + uint64 payload_length = 1; + // address carries object address in the NeoFS system. // It encapsulates the object and the container identifiers. - refs.Address Address = 2; - // OwnerID carries identifier of the object owner. - refs.OwnerID OwnerID = 3; + refs.Address address = 2; + // owner_id carries identifier of the object owner. + refs.OwnerID owner_id = 3; } // Main carries the main part of the header. @@ -33,49 +33,49 @@ message Header { message Extended { // Integrity groups evidence of the integrity of an object's structure. message Integrity { - // PayloadChecksum carries the checksum of object payload bytes. + // payload_checksum carries the checksum of object payload bytes. // Changing any byte of the payload changes the checksum. // It is calculated as a SHA-256 hash over payload bytes. - bytes PayloadChecksum = 1; + bytes payload_checksum = 1; - // HeaderChecksum carries checksum of the object header structure. + // header_checksum carries checksum of the object header structure. // It covers all object attributes. Changing any field of the object except // CreatorKey and ChecksumSignature changes the checksum. - // PayloadChecksum and HeaderChecksum cannot be merged due to the need + // payload_checksum and header_checksum cannot be merged due to the need // to verify the header in the absence of a payload (e.g. in object.Head rpc). // It is calculated as a SHA-256 hash over marshaled object header - // with cut CreatorKey and ChecksumSignature. - bytes HeaderChecksum = 2; + // with cut creator_key and checksum_signature. + bytes header_checksum = 2; - // SessionToken carries token of the session within which the object was created. + // session_token carries token of the session within which the object was created. // If session token is presented in object, it acts as the user's proof of the - // correctness of the CreatorKey. - service.Token SessionToken = 3; + // correctness of the creator_key. + service.Token session_token = 3; - // CreatorKey carries public key of the object creator in a binary format. - bytes CreatorKey = 4; + // creator_key carries public key of the object creator in a binary format. + bytes creator_key = 4; - // ChecksumSignature carries signature of the structure checksum by the object creator. - bytes ChecksumSignature = 5; + // checksum_signature carries signature of the structure checksum by the object creator. + bytes checksum_signature = 5; } - // Integrity carries object integrity evidence. + // integrity carries object integrity evidence. Integrity integrity = 1; // Attribute groups the parameters of the object attributes. message Attribute { - // Key carries the string key to the object attribute. - string Key = 1; + // key carries the string key to the object attribute. + string key = 1; - // Value carries the string value of the object attribute. - string Value = 2; + // value carries the string value of the object attribute. + string value = 2; } - // Attributes carries list of the object attributes in a string key-value format. - repeated Attribute Attributes = 2; + // attributes carries list of the object attributes in a string key-value format. + repeated Attribute attributes = 2; - // CreationEpoch carries number of NeoFS epoch on which the object was created. - uint64 CreationEpoch = 3; + // creation_epoch carries number of NeoFS epoch on which the object was created. + uint64 creation_epoch = 3; // Tombstone groups the options for deleting an object. message Tombstone { @@ -84,32 +84,32 @@ message Header { // Tombstone marks the object to be deleted. Tombstone tombstone = 4; - // HomomorphicHash carries homomorphic hash of the object payload. - bytes HomomorphicHash = 5; + // homomorphic_hash carries homomorphic hash of the object payload. + bytes homomorphic_hash = 5; // StorageGroup groups meta information about a storage group. message StorageGroup { } // StorageGroup marks an object containing information about a storage group. - StorageGroup storageGroup = 6; + StorageGroup storage_group = 6; // Split groups information about spawning the object through a payload splitting. message Split { // Parent carries identifier of the origin object. - refs.ObjectID Parent = 1; + refs.ObjectID parent = 1; // Previous carries identifier of the left split neighbor. - refs.ObjectID Previous = 2; + refs.ObjectID previous = 2; - // Previous carries identifier of the right split neighbor. - refs.ObjectID Next = 3; + // Next carries identifier of the right split neighbor. + refs.ObjectID next = 3; // Children carries list of identifiers of the objects generated by splitting the current. - repeated refs.ObjectID Children = 4; + repeated refs.ObjectID children = 4; // Origin carries the header of the origin object. - Header Origin = 5; + Header origin = 5; } // Split carries the position of the object in the split hierarchy. @@ -124,8 +124,8 @@ message Header { // It consists of payload data with additional service information. message Object { // Header carries the object header. - Header Header = 1; + Header header = 1; // Payload carries the object payload bytes. - bytes Payload = 2; + bytes payload = 2; } diff --git a/refs/types.proto b/refs/types.proto index 0dda985..ba5ef25 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -7,27 +7,27 @@ option csharp_namespace = "NeoFS.API.Refs"; // Address of object (container id + object id) message Address { - // ContainerID carries container identifier. - ContainerID ContainerID = 1; + // container_id carries container identifier. + ContainerID container_id = 1; - // ObjectID carries object identifier. - ObjectID ObjectID = 2; + // object_id carries object identifier. + ObjectID object_id = 2; } // ObjectID groups information about the NeoFS object identifier. message ObjectID { - // Value carries the object identifier in a binary format. - bytes Value = 1; + // value carries the object identifier in a binary format. + bytes value = 1; } // ContainerID groups information about the NeoFS container identifier. message ContainerID { - // Value carries the container identifier in a binary format. - bytes Value = 1; + // value carries the container identifier in a binary format. + bytes value = 1; } // OwnerID group information about the owner of the NeoFS container. message OwnerID { - // Value carries the identifier of the container owner in a binary format. - bytes Value = 1; + // value carries the identifier of the container owner in a binary format. + bytes value = 1; } \ No newline at end of file diff --git a/service/meta.proto b/service/meta.proto index c2cb168..906e062 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -8,16 +8,16 @@ option csharp_namespace = "NeoFS.API.Service"; // RequestMetaHeader contains information about request meta headers. message RequestMetaHeader { // Carries maximum number of nodes in the request route. - uint32 TTL = 1; + uint32 ttl = 1; message XHeader { // Carries key to the X-Header. - string Key = 1; + string key = 1; // Carries value of the X-Header. - string Value = 2; + string value = 2; } // Carries request X-Headers. - repeated XHeader XHeaders = 2; + repeated XHeader x_headers = 2; } diff --git a/service/verify.proto b/service/verify.proto index 46a8fac..86262ec 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -12,100 +12,100 @@ import "refs/types.proto"; message RequestVerificationHeader { message Signature { // Key is compressed public key used for signature. - bytes Key = 1; + bytes key = 1; // Sign is signature of the request or session key. - bytes Sign = 2; + bytes sign = 2; } // Signatures is a set of signatures of every passed NeoFS Node - repeated Signature Signatures = 1; + repeated Signature signatures = 1; // Token is a token of the session within which the request is sent - Token Token = 2; + Token token = 2; // Bearer is a Bearer token of the request - BearerTokenMsg Bearer = 3; + BearerTokenMsg bearer = 3; } // User token granting rights for object manipulation message Token { message Info { // ID is a token identifier. valid UUIDv4 represented in bytes - bytes ID = 1; + bytes id = 1; // OwnerID carries identifier of the manipulation object owner. - refs.OwnerID OwnerID = 2; + refs.OwnerID owner_id = 2; // Verb is an enumeration of session request types enum Verb { // Put refers to object.Put RPC call - Put = 0; + PUT = 0; // Get refers to object.Get RPC call - Get = 1; + GET = 1; // Head refers to object.Head RPC call - Head = 2; + HEAD = 2; // Search refers to object.Search RPC call - Search = 3; + SEARCH = 3; // Delete refers to object.Delete RPC call - Delete = 4; + DELETE = 4; // Range refers to object.GetRange RPC call - Range = 5; + RANGE = 5; // RangeHash refers to object.GetRangeHash RPC call - RangeHash = 6; + RANGEHASH = 6; } // Verb is a type of request for which the token is issued Verb verb = 3; // Address is an object address for which token is issued - refs.Address Address = 4; + refs.Address address = 4; // Lifetime is a lifetime of the session - TokenLifetime Lifetime = 5; + TokenLifetime lifetime = 5; // SessionKey is a public key of session key - bytes SessionKey = 6; + bytes session_key = 6; // OwnerKey is a public key of the token owner - bytes OwnerKey = 7; + bytes owner_key = 7; } - // TokenInfo is a grouped information about token - Info TokenInfo = 1; + // token_info is a grouped information about token + Info token_info = 1; // Signature is a signature of session token information - bytes Signature = 8; + bytes signature = 8; } // TokenLifetime carries a group of lifetime parameters of the token message TokenLifetime { - // Created carries an initial epoch of token lifetime - uint64 Created = 1; + // created carries an initial epoch of token lifetime + uint64 created = 1; - // ValidUntil carries a last epoch of token lifetime - uint64 ValidUntil = 2; + // valid_until carries a last epoch of token lifetime + uint64 valid_until = 2; } // BearerTokenMsg carries information about request ACL rules with limited lifetime message BearerTokenMsg { message Info { // EACLTable carries table of extended ACL rules. - acl.EACLTable EACLTable = 1; + acl.EACLTable eacl_table = 1; // OwnerID carries identifier of the token owner. - refs.OwnerID OwnerID = 2; + refs.OwnerID owner_id = 2; // ValidUntil carries a last epoch of token lifetime - uint64 ValidUntil = 3; + uint64 valid_until = 3; } - // TokenInfo is a grouped information about token - Info TokenInfo = 1; + // token_info is a grouped information about token + Info token_info = 1; - // OwnerKey is a public key of the token owner - bytes OwnerKey = 2; + // owner_key is a public key of the token owner + bytes owner_key = 2; // Signature is a signature of token information - bytes Signature = 3; + bytes signature = 3; } diff --git a/session/service.proto b/session/service.proto index cd11589..d28ff60 100644 --- a/session/service.proto +++ b/session/service.proto @@ -17,25 +17,25 @@ service Session { // CreateRequest carries an information necessary for opening a session. message CreateRequest { // Carries an identifier of a session initiator. - refs.OwnerID OwnerID = 1; + refs.OwnerID owner_id = 1; // Carries a lifetime of the session. - service.TokenLifetime Lifetime = 2; + service.TokenLifetime lifetime = 2; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader MetaHeader = 98; + service.RequestMetaHeader meta_header = 98; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader VerifyHeader = 99; + service.RequestVerificationHeader verify_header = 99; } // CreateResponse carries an information about the opened session. message CreateResponse { - // ID carries an identifier of session token. - bytes ID = 1; + // id carries an identifier of session token. + bytes id = 1; - // SessionKey carries a session public key. - bytes SessionKey = 2; + // session_key carries a session public key. + bytes session_key = 2; } diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 894db2e..2eb4ec6 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -10,17 +10,17 @@ import "refs/types.proto"; // StorageGroup groups the information about the NeoFS storage group. // The storage group consists of objects from single container. message StorageGroup { - // ValidationDataSize carries the total size of the payloads of the storage group members. - uint64 ValidationDataSize = 1; + // validation_data_size carries the total size of the payloads of the storage group members. + uint64 validation_data_size = 1; - // ValidationHash carries homomorphic hash from the concatenation of the payloads of the storage group members. + // validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members. // The order of concatenation is the same as the order of the members in the Members field. - bytes ValidationHash = 2; + bytes validation_hash = 2; - // ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. - uint64 ExpirationEpoch = 3; + // expiration_epoch carries last NeoFS epoch number of the storage group lifetime. + uint64 expiration_epoch = 3; // Members carries the list of identifiers of the object storage group members. // The list is strictly ordered. - repeated refs.ObjectID Members = 4; + repeated refs.ObjectID members = 4; } From c65920d2ce0c77190a769d8d551639819345bc17 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 7 Aug 2020 10:53:45 +0300 Subject: [PATCH 142/440] [#32] docs: regenerate files Signed-off-by: Stanislav Bogatyrev --- proto-docs/accounting.md | 10 +-- proto-docs/acl.md | 46 ++++++------- proto-docs/container.md | 44 ++++++------ proto-docs/netmap.md | 42 ++++++------ proto-docs/object.md | 136 ++++++++++++++++++------------------- proto-docs/refs.md | 10 +-- proto-docs/service.md | 64 ++++++++--------- proto-docs/session.md | 12 ++-- proto-docs/storagegroup.md | 8 +-- 9 files changed, 186 insertions(+), 186 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index ffab500..ac05b5d 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -51,7 +51,7 @@ Returns the amount of funds for the requested NeoFS account. ### Message BalanceRequest Message defines the request body of Balance method. -To indicate the account for which the balance is requested, its identifier is used. +To indicate the account for which the balance is requested, it's identifier is used. To gain access to the requested information, the request body must be formed according to the requirements from the system specification. @@ -59,7 +59,7 @@ to the requirements from the system specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | @@ -72,7 +72,7 @@ The amount of funds is calculated in decimal numbers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Balance | [Decimal](#accounting.Decimal) | | Carries the amount of funds on the account. | +| balance | [Decimal](#accounting.Decimal) | | Carries the amount of funds on the account. | @@ -83,8 +83,8 @@ Decimal represents the decimal numbers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Value | [int64](#int64) | | Value carries number value. | -| Precision | [uint32](#uint32) | | Precision carries value precision. | +| value | [int64](#int64) | | value carries number value. | +| precision | [uint32](#uint32) | | precision carries value precision. | diff --git a/proto-docs/acl.md b/proto-docs/acl.md index d653214..cd671d9 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -35,8 +35,8 @@ EACLRecord groups information about extended ACL rule. | ----- | ---- | ----- | ----------- | | operation | [EACLRecord.Operation](#acl.EACLRecord.Operation) | | Operation carries type of operation. | | action | [EACLRecord.Action](#acl.EACLRecord.Action) | | Action carries ACL target action. | -| Filters | [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) | repeated | Filters carries set of filters. | -| Targets | [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) | repeated | Targets carries information about extended ACL target list. | +| filters | [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) | repeated | filters carries set of filters. | +| targets | [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) | repeated | targets carries information about extended ACL target list. | @@ -48,9 +48,9 @@ FilterInfo groups information about filter. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | header | [EACLRecord.FilterInfo.Header](#acl.EACLRecord.FilterInfo.Header) | | Header carries type of header. | -| matchType | [EACLRecord.FilterInfo.MatchType](#acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | -| HeaderName | [string](#string) | | HeaderName carries name of filtering header. | -| HeaderVal | [string](#string) | | HeaderVal carries value of filtering header. | +| match_type | [EACLRecord.FilterInfo.MatchType](#acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | +| header_name | [string](#string) | | header_name carries name of filtering header. | +| header_val | [string](#string) | | header_val carries value of filtering header. | @@ -61,8 +61,8 @@ TargetInfo groups information about extended ACL target. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Target | [Target](#acl.Target) | | Target carries target of ACL rule. | -| KeyList | [bytes](#bytes) | repeated | KeyList carries public keys of ACL target. | +| target | [Target](#acl.Target) | | target carries target of ACL rule. | +| key_list | [bytes](#bytes) | repeated | key_list carries public keys of ACL target. | @@ -73,8 +73,8 @@ EACLRecord carries the information about extended ACL rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | -| Records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | +| records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | @@ -86,9 +86,9 @@ Action is an enumeration of EACL actions. | Name | Number | Description | | ---- | ------ | ----------- | -| ActionUnknown | 0 | | -| Allow | 1 | | -| Deny | 2 | | +| ACTION_UNKNOWN | 0 | | +| ALLOW | 1 | | +| DENY | 2 | | @@ -99,10 +99,10 @@ Header is an enumeration of filtering header types. | Name | Number | Description | | ---- | ------ | ----------- | -| HeaderUnknown | 0 | | -| Request | 1 | | -| ObjectSystem | 2 | | -| ObjectUser | 3 | | +| HEADER_UNKNOWN | 0 | | +| REQUEST | 1 | | +| OBJECT_SYSTEM | 2 | | +| OBJECT_USER | 3 | | @@ -113,9 +113,9 @@ MatchType is an enumeration of match types. | Name | Number | Description | | ---- | ------ | ----------- | -| MatchUnknown | 0 | | -| StringEqual | 1 | | -| StringNotEqual | 2 | | +| MATCH_UNKNOWN | 0 | | +| STRING_EQUAL | 1 | | +| STRING_NOT_EQUAL | 2 | | @@ -144,10 +144,10 @@ Target of the access control rule in access control list. | Name | Number | Description | | ---- | ------ | ----------- | -| Unknown | 0 | Unknown target, default value. | -| User | 1 | User target rule is applied if sender is the owner of the container. | -| System | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | -| Others | 3 | Others target rule is applied if sender is not user or system target. | +| UNKNOWN | 0 | Unknown target, default value. | +| USER | 1 | User target rule is applied if sender is the owner of the container. | +| SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | +| OTHERS | 3 | Others target rule is applied if sender is not user or system target. | diff --git a/proto-docs/container.md b/proto-docs/container.md index 14bf6e7..55120a2 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -120,8 +120,8 @@ smart-contract storage. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to delete from NeoFS. | -| Signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | +| signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | @@ -140,7 +140,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container that has Extended ACL. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container that has Extended ACL. | @@ -151,8 +151,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| EACL | [acl.EACLTable](#acl.EACLTable) | | EACL that has been requested if it was set up. | -| Signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL that has been requested if it was set up. | +| signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -163,7 +163,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the container to get. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to get. | @@ -174,7 +174,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Container | [Container](#container.Container) | | Container that has been requested. | +| container | [Container](#container.Container) | | Container that has been requested. | @@ -185,7 +185,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | owner_id carries identifier of the container owner. | @@ -196,7 +196,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerIDs | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | +| container_ids | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | @@ -207,9 +207,9 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Container | [Container](#container.Container) | | Container to create in NeoFS. | -| PublicKey | [bytes](#bytes) | | PublicKey of container owner. It can be public key of the owner or it can be public key that bound in neofs.id smart-contract. | -| Signature | [bytes](#bytes) | | Signature of stable-marshalled container according to RFC-6979. | +| container | [Container](#container.Container) | | Container to create in NeoFS. | +| public_key | [bytes](#bytes) | | Public Key of container owner. It can be public key of the owner or it can be public key that bound in neofs.id smart-contract. | +| signature | [bytes](#bytes) | | Signature of stable-marshalled container according to RFC-6979. | @@ -220,7 +220,7 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | ContainerID carries identifier of the new container. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the new container. | @@ -231,8 +231,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| EACL | [acl.EACLTable](#acl.EACLTable) | | EACL to set for the container. | -| Signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL to set for the container. | +| signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -267,11 +267,11 @@ SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | -| Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | -| BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | -| Attributes | [Container.Attribute](#container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | -| Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | +| nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | +| basic_acl | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | +| attributes | [Container.Attribute](#container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | +| rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | @@ -282,8 +282,8 @@ Attribute is a key-value pair of strings. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Key of immutable container attribute. | -| Value | [string](#string) | | Value of immutable container attribute. | +| key | [string](#string) | | Key of immutable container attribute. | +| value | [string](#string) | | Value of immutable container attribute. | diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 4e25adb..459c42e 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -37,9 +37,9 @@ Groups the information about the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [string](#string) | | Carries network address of the NeoFS node. | -| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | -| Attributes | [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | +| address | [string](#string) | | Carries network address of the NeoFS node. | +| public_key | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | +| attributes | [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | | state | [NodeInfo.State](#netmap.NodeInfo.State) | | Carries state of the NeoFS node. | @@ -51,8 +51,8 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Carries string key to the node attribute. | -| Value | [string](#string) | | Carries string value of the node attribute. | +| key | [string](#string) | | Carries string key to the node attribute. | +| value | [string](#string) | | Carries string value of the node attribute. | @@ -63,8 +63,8 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ReplFactor | [uint32](#uint32) | | | -| SFGroups | [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) | repeated | | +| repl_factor | [uint32](#uint32) | | | +| sf_groups | [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) | repeated | | @@ -75,9 +75,9 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Filters | [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) | repeated | | -| Selectors | [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) | repeated | | -| Exclude | [uint32](#uint32) | repeated | | +| filters | [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) | repeated | | +| selectors | [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) | repeated | | +| exclude | [uint32](#uint32) | repeated | | @@ -88,8 +88,8 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | | -| F | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | | | +| key | [string](#string) | | | +| f | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | | | @@ -100,9 +100,9 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Op | [PlacementRule.SFGroup.Filter.SimpleFilter.Operation](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter.Operation) | | | -| Value | [string](#string) | | | -| FArgs | [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) | | | +| op | [PlacementRule.SFGroup.Filter.SimpleFilter.Operation](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter.Operation) | | | +| value | [string](#string) | | | +| f_args | [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) | | | @@ -113,7 +113,7 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Filters | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | repeated | | +| filters | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | repeated | | @@ -124,8 +124,8 @@ Groups attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Count | [uint32](#uint32) | | | -| Key | [string](#string) | | | +| count | [uint32](#uint32) | | | +| key | [string](#string) | | | @@ -137,9 +137,9 @@ Represents the enumeration of various states of the NeoFS node. | Name | Number | Description | | ---- | ------ | ----------- | -| Unknown | 0 | Undefined state. | -| Online | 1 | Active state on the network. | -| Offline | 2 | Network unavailable state. | +| UNKNOWN | 0 | Undefined state. | +| ONLINE | 1 | Active state in the network. | +| OFFLINE | 2 | Network unavailable state. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 7f620ae..7337452 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -148,10 +148,10 @@ calculated for XORed data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -170,11 +170,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Carries address of the object that contains the requested payload range. | -| Ranges | [Range](#object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | -| Salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| address | [refs.Address](#refs.Address) | | Carries address of the object that contains the requested payload range. | +| ranges | [Range](#object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | +| salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -185,7 +185,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| HashList | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | +| hash_list | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | @@ -196,10 +196,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | -| Range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | +| range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -210,7 +210,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Chunk | [bytes](#bytes) | | Carries part of the object payload. | +| chunk | [bytes](#bytes) | | Carries part of the object payload. | @@ -221,10 +221,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Carries the address of the requested object. | -| Raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| address | [refs.Address](#refs.Address) | | Carries the address of the requested object. | +| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -235,8 +235,8 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Header | [Header](#object.Header) | | Carries the object header. | -| Chunk | [bytes](#bytes) | | Carries part of the object payload. | +| header | [Header](#object.Header) | | Carries the object header. | +| chunk | [bytes](#bytes) | | Carries part of the object payload. | @@ -247,11 +247,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Address | [refs.Address](#refs.Address) | | Carries the address of the object with the requested header. | -| MainOnly | [bool](#bool) | | Carries the option to crop header to main part. | -| Raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| address | [refs.Address](#refs.Address) | | Carries the address of the object with the requested header. | +| main_only | [bool](#bool) | | Carries the option to crop header to main part. | +| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -262,7 +262,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Header | [Header](#object.Header) | | Carries the requested object header. | +| header | [Header](#object.Header) | | Carries the requested object header. | @@ -274,9 +274,9 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | init | [PutRequest.Init](#object.PutRequest.Init) | | Carries the initialization parameters of the object stream. | -| Chunk | [bytes](#bytes) | | Carries part of the object payload. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| chunk | [bytes](#bytes) | | Carries part of the object payload. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -287,8 +287,8 @@ Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Header | [Header](#object.Header) | | Carries the header of the object to save in the system. | -| CopiesNumber | [uint32](#uint32) | | Carries the number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | +| header | [Header](#object.Header) | | Carries the header of the object to save in the system. | +| copies_number | [uint32](#uint32) | | Carries the number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | @@ -299,7 +299,7 @@ Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ObjectID | [refs.ObjectID](#refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | +| object_id | [refs.ObjectID](#refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | @@ -310,8 +310,8 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Offset | [uint64](#uint64) | | Carries the offset of the range from the object payload start. | -| Length | [uint64](#uint64) | | Carries the length of the object payload range. | +| offset | [uint64](#uint64) | | Carries the offset of the range from the object payload start. | +| length | [uint64](#uint64) | | Carries the length of the object payload range. | @@ -322,10 +322,10 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | | query | [SearchRequest.Query](#object.SearchRequest.Query) | | | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -336,8 +336,8 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Version | [uint32](#uint32) | | | -| Filters | [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) | repeated | | +| version | [uint32](#uint32) | | | +| filters | [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) | repeated | | @@ -348,9 +348,9 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| matchType | [SearchRequest.Query.Filter.MatchType](#object.SearchRequest.Query.Filter.MatchType) | | | -| Name | [string](#string) | | | -| Value | [string](#string) | | | +| match_type | [SearchRequest.Query.Filter.MatchType](#object.SearchRequest.Query.Filter.MatchType) | | | +| name | [string](#string) | | | +| value | [string](#string) | | | @@ -361,7 +361,7 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| IDList | [refs.ObjectID](#refs.ObjectID) | repeated | Carries list of object identifiers that match the search query. | +| id_list | [refs.ObjectID](#refs.ObjectID) | repeated | Carries list of object identifiers that match the search query. | @@ -373,8 +373,8 @@ Range groups the parameters of object payload range. | Name | Number | Description | | ---- | ------ | ----------- | -| MatchUnknown | 0 | | -| StringEqual | 1 | | +| MATCH_UNKNOWN | 0 | | +| STRING_EQUAL | 1 | | @@ -412,12 +412,12 @@ the NeoFS sub-systems. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| integrity | [Header.Extended.Integrity](#object.Header.Extended.Integrity) | | Integrity carries object integrity evidence. | -| Attributes | [Header.Extended.Attribute](#object.Header.Extended.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. | -| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. | +| integrity | [Header.Extended.Integrity](#object.Header.Extended.Integrity) | | integrity carries object integrity evidence. | +| attributes | [Header.Extended.Attribute](#object.Header.Extended.Attribute) | repeated | attributes carries list of the object attributes in a string key-value format. | +| creation_epoch | [uint64](#uint64) | | creation_epoch carries number of NeoFS epoch on which the object was created. | | tombstone | [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) | | Tombstone marks the object to be deleted. | -| HomomorphicHash | [bytes](#bytes) | | HomomorphicHash carries homomorphic hash of the object payload. | -| storageGroup | [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) | | StorageGroup marks an object containing information about a storage group. | +| homomorphic_hash | [bytes](#bytes) | | homomorphic_hash carries homomorphic hash of the object payload. | +| storage_group | [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) | | StorageGroup marks an object containing information about a storage group. | | split | [Header.Extended.Split](#object.Header.Extended.Split) | | Split carries the position of the object in the split hierarchy. | @@ -429,8 +429,8 @@ Attribute groups the parameters of the object attributes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Key carries the string key to the object attribute. | -| Value | [string](#string) | | Value carries the string value of the object attribute. | +| key | [string](#string) | | key carries the string key to the object attribute. | +| value | [string](#string) | | value carries the string value of the object attribute. | @@ -441,11 +441,11 @@ Integrity groups evidence of the integrity of an object's structure. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| PayloadChecksum | [bytes](#bytes) | | PayloadChecksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | -| HeaderChecksum | [bytes](#bytes) | | HeaderChecksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. PayloadChecksum and HeaderChecksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut CreatorKey and ChecksumSignature. | -| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. | -| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. | -| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature carries signature of the structure checksum by the object creator. | +| payload_checksum | [bytes](#bytes) | | payload_checksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | +| header_checksum | [bytes](#bytes) | | header_checksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. payload_checksum and header_checksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut creator_key and checksum_signature. | +| session_token | [service.Token](#service.Token) | | session_token carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the creator_key. | +| creator_key | [bytes](#bytes) | | creator_key carries public key of the object creator in a binary format. | +| checksum_signature | [bytes](#bytes) | | checksum_signature carries signature of the structure checksum by the object creator. | @@ -456,11 +456,11 @@ Split groups information about spawning the object through a payload splitting. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | -| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | -| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. | -| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | -| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. | +| parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | +| previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | +| next | [refs.ObjectID](#refs.ObjectID) | | Next carries identifier of the right split neighbor. | +| children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | +| origin | [Header](#object.Header) | | Origin carries the header of the origin object. | @@ -486,9 +486,9 @@ Message fields are presented in all NeoFS objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| PayloadLength | [uint64](#uint64) | | PayloadLength carries length of the object payload. Each object has a fixed payload length since it's immutable. | -| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. | +| payload_length | [uint64](#uint64) | | payload_length carries length of the object payload. Each object has a fixed payload length since it's immutable. | +| address | [refs.Address](#refs.Address) | | address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | owner_id carries identifier of the object owner. | @@ -500,8 +500,8 @@ It consists of payload data with additional service information. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Header | [Header](#object.Header) | | Header carries the object header. | -| Payload | [bytes](#bytes) | | Payload carries the object payload bytes. | +| header | [Header](#object.Header) | | Header carries the object header. | +| payload | [bytes](#bytes) | | Payload carries the object payload bytes. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 99d2151..c5ac42c 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -33,8 +33,8 @@ Address of object (container id + object id) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ContainerID | [ContainerID](#refs.ContainerID) | | ContainerID carries container identifier. | -| ObjectID | [ObjectID](#refs.ObjectID) | | ObjectID carries object identifier. | +| container_id | [ContainerID](#refs.ContainerID) | | container_id carries container identifier. | +| object_id | [ObjectID](#refs.ObjectID) | | object_id carries object identifier. | @@ -45,7 +45,7 @@ ContainerID groups information about the NeoFS container identifier. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Value | [bytes](#bytes) | | Value carries the container identifier in a binary format. | +| value | [bytes](#bytes) | | value carries the container identifier in a binary format. | @@ -56,7 +56,7 @@ ObjectID groups information about the NeoFS object identifier. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Value | [bytes](#bytes) | | Value carries the object identifier in a binary format. | +| value | [bytes](#bytes) | | value carries the object identifier in a binary format. | @@ -67,7 +67,7 @@ OwnerID group information about the owner of the NeoFS container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Value | [bytes](#bytes) | | Value carries the identifier of the container owner in a binary format. | +| value | [bytes](#bytes) | | value carries the identifier of the container owner in a binary format. | diff --git a/proto-docs/service.md b/proto-docs/service.md index 2307191..0a515e9 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -43,8 +43,8 @@ RequestMetaHeader contains information about request meta headers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| TTL | [uint32](#uint32) | | Carries maximum number of nodes in the request route. | -| XHeaders | [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) | repeated | Carries request X-Headers. | +| ttl | [uint32](#uint32) | | Carries maximum number of nodes in the request route. | +| x_headers | [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) | repeated | Carries request X-Headers. | @@ -55,8 +55,8 @@ RequestMetaHeader contains information about request meta headers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Carries key to the X-Header. | -| Value | [string](#string) | | Carries value of the X-Header. | +| key | [string](#string) | | Carries key to the X-Header. | +| value | [string](#string) | | Carries value of the X-Header. | @@ -81,9 +81,9 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| TokenInfo | [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) | | TokenInfo is a grouped information about token | -| OwnerKey | [bytes](#bytes) | | OwnerKey is a public key of the token owner | -| Signature | [bytes](#bytes) | | Signature is a signature of token information | +| token_info | [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) | | token_info is a grouped information about token | +| owner_key | [bytes](#bytes) | | owner_key is a public key of the token owner | +| signature | [bytes](#bytes) | | Signature is a signature of token information | @@ -94,9 +94,9 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| EACLTable | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules. | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. | -| ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | +| eacl_table | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. | +| valid_until | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | @@ -107,9 +107,9 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | -| Token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | -| Bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | +| signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | +| token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | +| bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | @@ -120,8 +120,8 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Key | [bytes](#bytes) | | Key is compressed public key used for signature. | -| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | +| key | [bytes](#bytes) | | Key is compressed public key used for signature. | +| sign | [bytes](#bytes) | | Sign is signature of the request or session key. | @@ -132,8 +132,8 @@ User token granting rights for object manipulation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| TokenInfo | [Token.Info](#service.Token.Info) | | TokenInfo is a grouped information about token | -| Signature | [bytes](#bytes) | | Signature is a signature of session token information | +| token_info | [Token.Info](#service.Token.Info) | | token_info is a grouped information about token | +| signature | [bytes](#bytes) | | Signature is a signature of session token information | @@ -144,13 +144,13 @@ User token granting rights for object manipulation | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | +| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | -| Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | -| Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | -| SessionKey | [bytes](#bytes) | | SessionKey is a public key of session key | -| OwnerKey | [bytes](#bytes) | | OwnerKey is a public key of the token owner | +| address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | +| lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | +| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | +| owner_key | [bytes](#bytes) | | OwnerKey is a public key of the token owner | @@ -161,8 +161,8 @@ TokenLifetime carries a group of lifetime parameters of the token | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Created | [uint64](#uint64) | | Created carries an initial epoch of token lifetime | -| ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | +| created | [uint64](#uint64) | | created carries an initial epoch of token lifetime | +| valid_until | [uint64](#uint64) | | valid_until carries a last epoch of token lifetime | @@ -174,13 +174,13 @@ Verb is an enumeration of session request types | Name | Number | Description | | ---- | ------ | ----------- | -| Put | 0 | Put refers to object.Put RPC call | -| Get | 1 | Get refers to object.Get RPC call | -| Head | 2 | Head refers to object.Head RPC call | -| Search | 3 | Search refers to object.Search RPC call | -| Delete | 4 | Delete refers to object.Delete RPC call | -| Range | 5 | Range refers to object.GetRange RPC call | -| RangeHash | 6 | RangeHash refers to object.GetRangeHash RPC call | +| PUT | 0 | Put refers to object.Put RPC call | +| GET | 1 | Get refers to object.Get RPC call | +| HEAD | 2 | Head refers to object.Head RPC call | +| SEARCH | 3 | Search refers to object.Search RPC call | +| DELETE | 4 | Delete refers to object.Delete RPC call | +| RANGE | 5 | Range refers to object.GetRange RPC call | +| RANGEHASH | 6 | RangeHash refers to object.GetRangeHash RPC call | diff --git a/proto-docs/session.md b/proto-docs/session.md index 0976757..09843e2 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -52,10 +52,10 @@ CreateRequest carries an information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| OwnerID | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | -| Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | -| MetaHeader | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| VerifyHeader | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | +| lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -66,8 +66,8 @@ CreateResponse carries an information about the opened session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ID | [bytes](#bytes) | | ID carries an identifier of session token. | -| SessionKey | [bytes](#bytes) | | SessionKey carries a session public key. | +| id | [bytes](#bytes) | | id carries an identifier of session token. | +| session_key | [bytes](#bytes) | | session_key carries a session public key. | diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index c209b86..a1e2aca 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -31,10 +31,10 @@ The storage group consists of objects from single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ValidationDataSize | [uint64](#uint64) | | ValidationDataSize carries the total size of the payloads of the storage group members. | -| ValidationHash | [bytes](#bytes) | | ValidationHash carries homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the Members field. | -| ExpirationEpoch | [uint64](#uint64) | | ExpirationEpoch carries last NeoFS epoch number of the storage group lifetime. | -| Members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | +| validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | +| validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the Members field. | +| expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | +| members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | From 5809f0bfbfd6f0eea46171cb4217d67ceef113bc Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:11:23 +0300 Subject: [PATCH 143/440] [#40] service: Add session token context Replace object address field with the oneof-list of session contexts. Break the connection of the session with the object. Extend the ability to open sessions for other needs without losing backward compatibility. Signed-off-by: Leonard Lyubich --- proto-docs/service.md | 2 +- service/verify.proto | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 0a515e9..45af335 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -147,10 +147,10 @@ User token granting rights for object manipulation | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | | owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | -| address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | | lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | | owner_key | [bytes](#bytes) | | OwnerKey is a public key of the token owner | +| object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | diff --git a/service/verify.proto b/service/verify.proto index 86262ec..a40d1d0 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -58,17 +58,20 @@ message Token { // Verb is a type of request for which the token is issued Verb verb = 3; - // Address is an object address for which token is issued - refs.Address address = 4; - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 5; + TokenLifetime lifetime = 4; // SessionKey is a public key of session key - bytes session_key = 6; + bytes session_key = 5; // OwnerKey is a public key of the token owner - bytes owner_key = 7; + bytes owner_key = 6; + + // Carries context of the session. + oneof context { + // object_address represents the object session context. + refs.Address object_address = 7; + } } // token_info is a grouped information about token From e6b281064803503aba3da590dfa9a9f408442bfa Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:12:41 +0300 Subject: [PATCH 144/440] [#40] service: Change Token.signature field number Signed-off-by: Leonard Lyubich --- service/verify.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/verify.proto b/service/verify.proto index a40d1d0..af14134 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -78,7 +78,7 @@ message Token { Info token_info = 1; // Signature is a signature of session token information - bytes signature = 8; + bytes signature = 2; } // TokenLifetime carries a group of lifetime parameters of the token From fa7c269500c9b2a82a972f1d422b994211e6d6d2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:22:46 +0300 Subject: [PATCH 145/440] [#40] service: Change names of Token.Info.Verb enum Add the prefix Object to the session verb values to abstract the token from the object. Signed-off-by: Leonard Lyubich --- proto-docs/service.md | 14 +++++++------- service/verify.proto | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 45af335..bd976a2 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -174,13 +174,13 @@ Verb is an enumeration of session request types | Name | Number | Description | | ---- | ------ | ----------- | -| PUT | 0 | Put refers to object.Put RPC call | -| GET | 1 | Get refers to object.Get RPC call | -| HEAD | 2 | Head refers to object.Head RPC call | -| SEARCH | 3 | Search refers to object.Search RPC call | -| DELETE | 4 | Delete refers to object.Delete RPC call | -| RANGE | 5 | Range refers to object.GetRange RPC call | -| RANGEHASH | 6 | RangeHash refers to object.GetRangeHash RPC call | +| OBJECT_PUT | 0 | Refers to object.Put RPC call | +| OBJECT_GET | 1 | Refers to object.Get RPC call | +| OBJECT_HEAD | 2 | Refers to object.Head RPC call | +| OBJECT_SEARCH | 3 | Refers to object.Search RPC call | +| OBJECT_DELETE | 4 | Refers to object.Delete RPC call | +| OBJECT_RANGE | 5 | Refers to object.GetRange RPC call | +| OBJECT_RANGEHASH | 6 | Refers to object.GetRangeHash RPC call | diff --git a/service/verify.proto b/service/verify.proto index af14134..ea7a383 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -39,20 +39,20 @@ message Token { // Verb is an enumeration of session request types enum Verb { - // Put refers to object.Put RPC call - PUT = 0; - // Get refers to object.Get RPC call - GET = 1; - // Head refers to object.Head RPC call - HEAD = 2; - // Search refers to object.Search RPC call - SEARCH = 3; - // Delete refers to object.Delete RPC call - DELETE = 4; - // Range refers to object.GetRange RPC call - RANGE = 5; - // RangeHash refers to object.GetRangeHash RPC call - RANGEHASH = 6; + // Refers to object.Put RPC call + OBJECT_PUT = 0; + // Refers to object.Get RPC call + OBJECT_GET = 1; + // Refers to object.Head RPC call + OBJECT_HEAD = 2; + // Refers to object.Search RPC call + OBJECT_SEARCH = 3; + // Refers to object.Delete RPC call + OBJECT_DELETE = 4; + // Refers to object.GetRange RPC call + OBJECT_RANGE = 5; + // Refers to object.GetRangeHash RPC call + OBJECT_RANGEHASH = 6; } // Verb is a type of request for which the token is issued From b08839129481df21ad517ddd7717c69bca72bcba Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:40:09 +0300 Subject: [PATCH 146/440] [#40] service: Rename Token to SessionToken Rename Token message to SessionToken to clarify its purpose. Signed-off-by: Leonard Lyubich --- object/types.proto | 2 +- proto-docs/object.md | 2 +- proto-docs/service.md | 24 ++++++++++++------------ service/verify.proto | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/object/types.proto b/object/types.proto index e7776af..978dc83 100644 --- a/object/types.proto +++ b/object/types.proto @@ -50,7 +50,7 @@ message Header { // session_token carries token of the session within which the object was created. // If session token is presented in object, it acts as the user's proof of the // correctness of the creator_key. - service.Token session_token = 3; + service.SessionToken session_token = 3; // creator_key carries public key of the object creator in a binary format. bytes creator_key = 4; diff --git a/proto-docs/object.md b/proto-docs/object.md index 7337452..c23d8ab 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -443,7 +443,7 @@ Integrity groups evidence of the integrity of an object's structure. | ----- | ---- | ----- | ----------- | | payload_checksum | [bytes](#bytes) | | payload_checksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | | header_checksum | [bytes](#bytes) | | header_checksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. payload_checksum and header_checksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut creator_key and checksum_signature. | -| session_token | [service.Token](#service.Token) | | session_token carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the creator_key. | +| session_token | [service.SessionToken](#service.SessionToken) | | session_token carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the creator_key. | | creator_key | [bytes](#bytes) | | creator_key carries public key of the object creator in a binary format. | | checksum_signature | [bytes](#bytes) | | checksum_signature carries signature of the structure checksum by the object creator. | diff --git a/proto-docs/service.md b/proto-docs/service.md index bd976a2..30e3275 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -17,8 +17,8 @@ - [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) - [RequestVerificationHeader](#service.RequestVerificationHeader) - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) - - [Token](#service.Token) - - [Token.Info](#service.Token.Info) + - [SessionToken](#service.SessionToken) + - [SessionToken.Info](#service.SessionToken.Info) - [TokenLifetime](#service.TokenLifetime) @@ -108,7 +108,7 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | -| token | [Token](#service.Token) | | Token is a token of the session within which the request is sent | +| token | [SessionToken](#service.SessionToken) | | Token is a token of the session within which the request is sent | | bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | @@ -124,21 +124,21 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces | sign | [bytes](#bytes) | | Sign is signature of the request or session key. | - + -### Message Token -User token granting rights for object manipulation +### Message SessionToken +Represents the NeoFS session token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| token_info | [Token.Info](#service.Token.Info) | | token_info is a grouped information about token | +| token_info | [SessionToken.Info](#service.SessionToken.Info) | | token_info is a grouped information about token | | signature | [bytes](#bytes) | | Signature is a signature of session token information | - + -### Message Token.Info +### Message SessionToken.Info @@ -146,7 +146,7 @@ User token granting rights for object manipulation | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | | owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | -| verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | +| verb | [SessionToken.Info.Verb](#service.SessionToken.Info.Verb) | | Verb is a type of request for which the token is issued | | lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | | owner_key | [bytes](#bytes) | | OwnerKey is a public key of the token owner | @@ -167,9 +167,9 @@ TokenLifetime carries a group of lifetime parameters of the token - + -### Token.Info.Verb +### SessionToken.Info.Verb Verb is an enumeration of session request types | Name | Number | Description | diff --git a/service/verify.proto b/service/verify.proto index ea7a383..dd7348e 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -22,14 +22,14 @@ message RequestVerificationHeader { repeated Signature signatures = 1; // Token is a token of the session within which the request is sent - Token token = 2; + SessionToken token = 2; // Bearer is a Bearer token of the request BearerTokenMsg bearer = 3; } -// User token granting rights for object manipulation -message Token { +// Represents the NeoFS session token. +message SessionToken { message Info { // ID is a token identifier. valid UUIDv4 represented in bytes bytes id = 1; From 35774d4ef760037c79e0225f0d2f9fa809581fc6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 11 Aug 2020 11:42:12 +0300 Subject: [PATCH 147/440] [#40] service: Correct Token.Info.owner_id field description Remove mention of an object from the session token field. Signed-off-by: Leonard Lyubich --- proto-docs/service.md | 2 +- service/verify.proto | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 30e3275..a997f49 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -145,7 +145,7 @@ Represents the NeoFS session token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session author. | | verb | [SessionToken.Info.Verb](#service.SessionToken.Info.Verb) | | Verb is a type of request for which the token is issued | | lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | diff --git a/service/verify.proto b/service/verify.proto index dd7348e..9e52a5d 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -34,7 +34,7 @@ message SessionToken { // ID is a token identifier. valid UUIDv4 represented in bytes bytes id = 1; - // OwnerID carries identifier of the manipulation object owner. + // OwnerID carries identifier of the session initiator. refs.OwnerID owner_id = 2; // Verb is an enumeration of session request types From 327c476ecfaaf62cce05c28e5b280e1b807b4898 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 12:03:50 +0300 Subject: [PATCH 148/440] [#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 --- accounting/service.proto | 27 ++-- acl/types.proto | 143 +++++++++--------- container/service.proto | 107 +++++++------- container/types.proto | 32 ++-- netmap/types.proto | 122 +++++++-------- object/service.proto | 312 +++++++++++++++++++-------------------- object/types.proto | 214 ++++++++++++++------------- refs/types.proto | 20 +-- service/meta.proto | 20 +-- service/verify.proto | 151 +++++++++---------- session/service.proto | 32 ++-- storagegroup/types.proto | 24 +-- 12 files changed, 607 insertions(+), 597 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index cb36c85..7062b53 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -10,34 +10,35 @@ import "refs/types.proto"; // The service provides methods for obtaining information // about the account balance in NeoFS system. service Accounting { - // Returns the amount of funds for the requested NeoFS account. - rpc Balance (BalanceRequest) returns (BalanceResponse); + // Returns the amount of funds for the requested NeoFS account. + rpc Balance (BalanceRequest) returns (BalanceResponse); } // Message defines the request body of Balance method. // -// To indicate the account for which the balance is requested, it's identifier is used. +// To indicate the account for which the balance is requested, it's identifier +// is used. // -// To gain access to the requested information, the request body must be formed according -// to the requirements from the system specification. +// To gain access to the requested information, the request body must be formed +// according to the requirements from the system specification. message BalanceRequest { - // Carries user identifier in NeoFS system for which the balance is requested. - refs.OwnerID owner_id = 1; + // Carries user identifier in NeoFS system for which the balance is requested. + refs.OwnerID owner_id = 1; } // Decimal represents the decimal numbers. message Decimal { - // value carries number value. - int64 value = 1; + // value carries number value. + int64 value = 1; - // precision carries value precision. - uint32 precision = 2; + // precision carries value precision. + uint32 precision = 2; } // Message defines the response body of Balance method. // // The amount of funds is calculated in decimal numbers. message BalanceResponse { - // Carries the amount of funds on the account. - Decimal balance = 1; + // Carries the amount of funds on the account. + Decimal balance = 1; } diff --git a/acl/types.proto b/acl/types.proto index d0975b0..cd673b4 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -9,98 +9,99 @@ import "refs/types.proto"; // Target of the access control rule in access control list. enum Target { - // Unknown target, default value. - UNKNOWN = 0; + // Unknown target, default value. + UNKNOWN = 0; - // User target rule is applied if sender is the owner of the container. - USER = 1; + // User target rule is applied if sender is the owner of the container. + USER = 1; - // System target rule is applied if sender is the storage node within the - // container or inner ring node. - SYSTEM = 2; + // System target rule is applied if sender is the storage node within the + // container or inner ring node. + SYSTEM = 2; - // Others target rule is applied if sender is not user or system target. - OTHERS = 3; + // Others target rule is applied if sender is not user or system target. + OTHERS = 3; } // EACLRecord groups information about extended ACL rule. message EACLRecord { - // Operation is an enumeration of operation types. - enum Operation { - OPERATION_UNKNOWN = 0; - GET = 1; - HEAD = 2; - PUT = 3; - DELETE = 4; - SEARCH = 5; - GETRANGE = 6; - GETRANGEHASH = 7; + // Operation is an enumeration of operation types. + enum Operation { + OPERATION_UNKNOWN = 0; + GET = 1; + HEAD = 2; + PUT = 3; + DELETE = 4; + SEARCH = 5; + GETRANGE = 6; + GETRANGEHASH = 7; + } + + // Operation carries type of operation. + Operation operation = 1 [json_name = "Operation"]; + + // Action is an enumeration of EACL actions. + enum Action { + ACTION_UNKNOWN = 0; + ALLOW = 1; + DENY = 2; + } + + // Action carries ACL target action. + Action action = 2 [json_name = "Action"]; + + // FilterInfo groups information about filter. + message FilterInfo { + // Header is an enumeration of filtering header types. + enum Header { + HEADER_UNKNOWN = 0; + REQUEST = 1; + OBJECT_SYSTEM = 2; + OBJECT_USER = 3; } - // Operation carries type of operation. - Operation operation = 1 [json_name = "Operation"]; + // Header carries type of header. + Header header = 1 [json_name = "HeaderType"]; - // Action is an enumeration of EACL actions. - enum Action { - ACTION_UNKNOWN = 0; - ALLOW = 1; - DENY = 2; + // MatchType is an enumeration of match types. + enum MatchType { + MATCH_UNKNOWN = 0; + STRING_EQUAL = 1; + STRING_NOT_EQUAL = 2; } - // Action carries ACL target action. - Action action = 2 [json_name = "Action"]; + // MatchType carries type of match. + MatchType match_type = 2 [json_name = "MatchType"]; - // FilterInfo groups information about filter. - message FilterInfo { - // Header is an enumeration of filtering header types. - enum Header { - HEADER_UNKNOWN = 0; - REQUEST = 1; - OBJECT_SYSTEM = 2; - OBJECT_USER = 3; - } + // header_name carries name of filtering header. + string header_name = 3 [json_name="Name"]; - // Header carries type of header. - Header header = 1 [json_name = "HeaderType"]; + // header_val carries value of filtering header. + string header_val = 4 [json_name="Value"]; + } - // MatchType is an enumeration of match types. - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; - STRING_NOT_EQUAL = 2; - } + // filters carries set of filters. + repeated FilterInfo filters = 3 [json_name="Filters"]; - // MatchType carries type of match. - MatchType match_type = 2 [json_name = "MatchType"]; + // TargetInfo groups information about extended ACL target. + message TargetInfo { + // target carries target of ACL rule. + acl.Target target = 1 [json_name="Role"]; - // header_name carries name of filtering header. - string header_name = 3 [json_name="Name"]; + // key_list carries public keys of ACL target. + repeated bytes key_list = 2 [json_name="Keys"]; + } - // header_val carries value of filtering header. - string header_val = 4 [json_name="Value"]; - } - - // filters carries set of filters. - repeated FilterInfo filters = 3 [json_name="Filters"]; - - // TargetInfo groups information about extended ACL target. - message TargetInfo { - // target carries target of ACL rule. - acl.Target target = 1 [json_name="Role"]; - - // key_list carries public keys of ACL target. - repeated bytes key_list = 2 [json_name="Keys"]; - } - - // targets carries information about extended ACL target list. - repeated TargetInfo targets = 4 [json_name="Targets"]; + // targets carries information about extended ACL target list. + repeated TargetInfo targets = 4 [json_name="Targets"]; } // EACLRecord carries the information about extended ACL rules. message EACLTable { - // Carries identifier of the container that should use given access control rules. - refs.ContainerID container_id = 1 [json_name="ContainerID"]; + // Carries identifier of the container that should use given + // access control rules. + refs.ContainerID container_id = 1 [json_name="ContainerID"]; - // Records carries list of extended ACL rule records. - repeated EACLRecord records = 2 [json_name="Records"]; + // Records carries list of extended ACL rule records. + repeated EACLRecord records = 2 [json_name="Records"]; } diff --git a/container/service.proto b/container/service.proto index cf9b848..485c872 100644 --- a/container/service.proto +++ b/container/service.proto @@ -12,58 +12,58 @@ import "refs/types.proto"; // Service provides API to access container smart-contract in morph chain // via NeoFS node. service Service { - // Put invokes 'Put' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // added into smart-contract storage. - rpc Put(PutRequest) returns (PutResponse); + // Put invokes 'Put' method in container smart-contract and returns + // response immediately. After new block in morph chain, request is verified + // by inner ring nodes. After one more block in morph chain, container + // added into smart-contract storage. + rpc Put(PutRequest) returns (PutResponse); - // Delete invokes 'Delete' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // removed from smart-contract storage. - rpc Delete(DeleteRequest) returns (DeleteResponse); + // Delete invokes 'Delete' method in container smart-contract and returns + // response immediately. After new block in morph chain, request is verified + // by inner ring nodes. After one more block in morph chain, container + // removed from smart-contract storage. + rpc Delete(DeleteRequest) returns (DeleteResponse); - // Get returns container from container smart-contract storage. - rpc Get(GetRequest) returns (GetResponse); + // Get returns container from container smart-contract storage. + rpc Get(GetRequest) returns (GetResponse); - // List returns all owner's containers from container smart-contract - // storage. - rpc List(ListRequest) returns (ListResponse); + // List returns all owner's containers from container smart-contract + // storage. + rpc List(ListRequest) returns (ListResponse); - // SetExtendedACL invokes 'SetEACL' method in container smart-contract and - // returns response immediately. After new block in morph chain, - // Extended ACL added into smart-contract storage. - rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); + // SetExtendedACL invokes 'SetEACL' method in container smart-contract and + // returns response immediately. After new block in morph chain, + // Extended ACL added into smart-contract storage. + rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); - // GetExtendedACL returns Extended ACL table and signature from container - // smart-contract storage. - rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); + // GetExtendedACL returns Extended ACL table and signature from container + // smart-contract storage. + rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } message PutRequest { - // Container to create in NeoFS. - container.Container container = 1; + // Container to create in NeoFS. + container.Container container = 1; - // Public Key of container owner. It can be public key of the owner - // or it can be public key that bound in neofs.id smart-contract. - bytes public_key = 2; + // Public Key of container owner. It can be public key of the owner + // or it can be public key that bound in neofs.id smart-contract. + bytes public_key = 2; - // Signature of stable-marshalled container according to RFC-6979. - bytes signature = 3; + // Signature of stable-marshalled container according to RFC-6979. + bytes signature = 3; } message PutResponse { - // container_id carries identifier of the new container. - refs.ContainerID container_id = 1; + // container_id carries identifier of the new container. + refs.ContainerID container_id = 1; } message DeleteRequest { - // container_id carries identifier of the container to delete from NeoFS. - refs.ContainerID container_id = 1; + // container_id carries identifier of the container to delete from NeoFS. + refs.ContainerID container_id = 1; - // Signature of container id according to RFC-6979. - bytes signature = 2; + // Signature of container id according to RFC-6979. + bytes signature = 2; } // DeleteResponse is empty because delete operation is asynchronous and done @@ -71,44 +71,45 @@ message DeleteRequest { message DeleteResponse {} message GetRequest { - // container_id carries identifier of the container to get. - refs.ContainerID container_id = 1; + // container_id carries identifier of the container to get. + refs.ContainerID container_id = 1; } message GetResponse { - // Container that has been requested. - container.Container container = 1; + // Container that has been requested. + container.Container container = 1; } message ListRequest { - // owner_id carries identifier of the container owner. - refs.OwnerID owner_id = 1; + // owner_id carries identifier of the container owner. + refs.OwnerID owner_id = 1; } message ListResponse { - // ContainerIDs carries list of identifiers of the containers that belong to the owner. - repeated refs.ContainerID container_ids = 1; + // ContainerIDs carries list of identifiers of the containers that belong + // to the owner. + repeated refs.ContainerID container_ids = 1; } message SetExtendedACLRequest { - // Extended ACL to set for the container. - acl.EACLTable eacl = 1; + // Extended ACL to set for the container. + acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes signature = 2; } message SetExtendedACLResponse {} message GetExtendedACLRequest { - // container_id carries identifier of the container that has Extended ACL. - refs.ContainerID container_id = 1; + // container_id carries identifier of the container that has Extended ACL. + refs.ContainerID container_id = 1; } message GetExtendedACLResponse { - // Extended ACL that has been requested if it was set up. - acl.EACLTable eacl = 1; + // Extended ACL that has been requested if it was set up. + acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes signature = 2; } diff --git a/container/types.proto b/container/types.proto index 66fa580..1b6041d 100644 --- a/container/types.proto +++ b/container/types.proto @@ -13,28 +13,28 @@ import "netmap/types.proto"; // and access control information. ID of the container is a 32 byte long // SHA256 hash of stable-marshalled container message. message Container { - // OwnerID carries identifier of the container owner. + // OwnerID carries identifier of the container owner. refs.OwnerID owner_id = 1; - // Nonce is a 16 byte UUID, used to avoid collisions of container id. - bytes nonce = 2; + // Nonce is a 16 byte UUID, used to avoid collisions of container id. + bytes nonce = 2; - // BasicACL contains access control rules for owner, system, others groups and - // permission bits for bearer token and Extended ACL. - uint32 basic_acl = 3; + // BasicACL contains access control rules for owner, system, others groups and + // permission bits for bearer token and Extended ACL. + uint32 basic_acl = 3; - // Attribute is a key-value pair of strings. - message Attribute { - // Key of immutable container attribute. - string key = 1; + // Attribute is a key-value pair of strings. + message Attribute { + // Key of immutable container attribute. + string key = 1; - // Value of immutable container attribute. - string value = 2; - } + // Value of immutable container attribute. + string value = 2; + } - // Attributes define any immutable characteristics of container. + // Attributes define any immutable characteristics of container. repeated Attribute attributes = 4; - // Rules define storage policy for the object inside the container. - netmap.PlacementRule rules = 5; + // Rules define storage policy for the object inside the container. + netmap.PlacementRule rules = 5; } diff --git a/netmap/types.proto b/netmap/types.proto index ce367f3..da825b2 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -6,87 +6,87 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/netmap"; option csharp_namespace = "NeoFS.API.Netmap"; message PlacementRule { - uint32 repl_factor = 1; + uint32 repl_factor = 1; - message SFGroup { - message Filter { - string key = 1; + message SFGroup { + message Filter { + string key = 1; - message SimpleFilters { - repeated SimpleFilter filters = 1; - } + message SimpleFilters { + repeated SimpleFilter filters = 1; + } - message SimpleFilter { - enum Operation { - NP = 0; - EQ = 1; - NE = 2; - GT = 3; - GE = 4; - LT = 5; - LE = 6; - OR = 7; - AND = 8; - } - - Operation op = 1; - - oneof Args { - string value = 2; - SimpleFilters f_args = 3; - } - } - - SimpleFilter f = 2; + message SimpleFilter { + enum Operation { + NP = 0; + EQ = 1; + NE = 2; + GT = 3; + GE = 4; + LT = 5; + LE = 6; + OR = 7; + AND = 8; } - repeated Filter filters = 1; + Operation op = 1; - message Selector { - uint32 count = 1; - string key = 2; + oneof Args { + string value = 2; + SimpleFilters f_args = 3; } + } - repeated Selector selectors = 2; - - repeated uint32 exclude = 3; + SimpleFilter f = 2; } - repeated SFGroup sf_groups = 2; + repeated Filter filters = 1; + + message Selector { + uint32 count = 1; + string key = 2; + } + + repeated Selector selectors = 2; + + repeated uint32 exclude = 3; + } + + repeated SFGroup sf_groups = 2; } // Groups the information about the NeoFS node. message NodeInfo { - // Carries network address of the NeoFS node. - string address = 1; + // Carries network address of the NeoFS node. + string address = 1; - // Carries public key of the NeoFS node in a binary format. - bytes public_key = 2; + // Carries public key of the NeoFS node in a binary format. + bytes public_key = 2; - // Groups attributes of the NeoFS node. - message Attribute { - // Carries string key to the node attribute. - string key = 1; + // Groups attributes of the NeoFS node. + message Attribute { + // Carries string key to the node attribute. + string key = 1; - // Carries string value of the node attribute. - string value = 2; - } + // Carries string value of the node attribute. + string value = 2; + } - // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute attributes = 3; + // Carries list of the NeoFS node attributes in a string key-value format. + repeated Attribute attributes = 3; - // Represents the enumeration of various states of the NeoFS node. - enum State { - // Undefined state. - UNKNOWN = 0; + // Represents the enumeration of various states of the NeoFS node. + enum State { + // Undefined state. + UNKNOWN = 0; - // Active state in the network. - ONLINE = 1; + // Active state in the network. + ONLINE = 1; - // Network unavailable state. - OFFLINE = 2; - } + // Network unavailable state. + OFFLINE = 2; + } - // Carries state of the NeoFS node. - State state = 4; + // Carries state of the NeoFS node. + State state = 4; } \ No newline at end of file diff --git a/object/service.proto b/object/service.proto index bf31173..311eb26 100644 --- a/object/service.proto +++ b/object/service.proto @@ -12,125 +12,125 @@ import "service/verify.proto"; // Object service provides API for manipulating with the object. service Service { - // Get the object from container. Response uses gRPC stream. First response - // message carry object of requested address. Chunk messages are parts of - // the object's payload if it is needed. All messages except first carry - // chunks. Requested object can be restored by concatenation of object - // message payload and all chunks keeping receiving order. - rpc Get(GetRequest) returns (stream GetResponse); + // Get the object from container. Response uses gRPC stream. First response + // message carry object of requested address. Chunk messages are parts of + // the object's payload if it is needed. All messages except first carry + // chunks. Requested object can be restored by concatenation of object + // message payload and all chunks keeping receiving order. + rpc Get(GetRequest) returns (stream GetResponse); - // Put the object into container. Request uses gRPC stream. First message - // SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD - // BE set. Session token SHOULD BE obtained before put operation (see - // session package). Chunk messages considered by server as part of object - // payload. All messages except first SHOULD BE chunks. Chunk messages - // SHOULD BE sent in direct order of fragmentation. - rpc Put(stream PutRequest) returns (PutResponse); + // Put the object into container. Request uses gRPC stream. First message + // SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD + // BE set. Session token SHOULD BE obtained before put operation (see + // session package). Chunk messages considered by server as part of object + // payload. All messages except first SHOULD BE chunks. Chunk messages + // SHOULD BE sent in direct order of fragmentation. + rpc Put(stream PutRequest) returns (PutResponse); - // Delete the object from a container - rpc Delete(DeleteRequest) returns (DeleteResponse); + // Delete the object from a container + rpc Delete(DeleteRequest) returns (DeleteResponse); - // Head returns the object without data payload. Object in the - // response has system header only. If full headers flag is set, extended - // headers are also present. - rpc Head(HeadRequest) returns (HeadResponse); + // Head returns the object without data payload. Object in the + // response has system header only. If full headers flag is set, extended + // headers are also present. + rpc Head(HeadRequest) returns (HeadResponse); - // Search objects in container. Version of query language format SHOULD BE - // set to 1. Search query represented in serialized format (see query - // package). - rpc Search(SearchRequest) returns (stream SearchResponse); + // Search objects in container. Version of query language format SHOULD BE + // set to 1. Search query represented in serialized format (see query + // package). + rpc Search(SearchRequest) returns (stream SearchResponse); - // GetRange of data payload. Range is a pair (offset, length). - // Requested range can be restored by concatenation of all chunks - // keeping receiving order. - rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); + // GetRange of data payload. Range is a pair (offset, length). + // Requested range can be restored by concatenation of all chunks + // keeping receiving order. + rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); - // GetRangeHash returns homomorphic hash of object payload range after XOR - // operation. Ranges are set of pairs (offset, length). Hashes order in - // response corresponds to ranges order in request. Homomorphic hash is - // calculated for XORed data. - rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); + // GetRangeHash returns homomorphic hash of object payload range after XOR + // operation. Ranges are set of pairs (offset, length). Hashes order in + // response corresponds to ranges order in request. Homomorphic hash is + // calculated for XORed data. + rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } message GetRequest { - // Carries the address of the requested object. - refs.Address address = 1; + // Carries the address of the requested object. + refs.Address address = 1; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the objects - // that are physically stored on the server. - bool raw = 2; + // Carries the raw option flag of the request. + // Raw request is sent to receive only the objects + // that are physically stored on the server. + bool raw = 2; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message GetResponse { - // Carries the single message of the response stream. - oneof ObjectPart { - // Carries the object header. - Header header = 1; + // Carries the single message of the response stream. + oneof ObjectPart { + // Carries the object header. + Header header = 1; - // Carries part of the object payload. - bytes chunk = 2; - } + // Carries part of the object payload. + bytes chunk = 2; + } } message PutRequest { - // Groups initialization parameters of object placement in NeoFS. - message Init { - // Carries the header of the object to save in the system. - Header header = 1; + // Groups initialization parameters of object placement in NeoFS. + message Init { + // Carries the header of the object to save in the system. + Header header = 1; - // Carries the number of the object copies to store - // within the RPC call. Default zero value is processed according - // to the container placement rules. - uint32 copies_number = 2; - } + // Carries the number of the object copies to store + // within the RPC call. Default zero value is processed according + // to the container placement rules. + uint32 copies_number = 2; + } - // Carries the single part of the query stream. - oneof Part { - // Carries the initialization parameters of the object stream. - Init init = 1; + // Carries the single part of the query stream. + oneof Part { + // Carries the initialization parameters of the object stream. + Init init = 1; - // Carries part of the object payload. - bytes chunk = 2; - } + // Carries part of the object payload. + bytes chunk = 2; + } - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message PutResponse { - // Carries identifier of the saved object. - // It is used to access an object in the container. - refs.ObjectID object_id = 1; + // Carries identifier of the saved object. + // It is used to access an object in the container. + refs.ObjectID object_id = 1; } message DeleteRequest { - // Carries the address of the object to be deleted. - refs.Address address = 1; + // Carries the address of the object to be deleted. + refs.Address address = 1; - // Carries identifier the object owner. - refs.OwnerID owner_id = 2; + // Carries identifier the object owner. + refs.OwnerID owner_id = 2; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } // DeleteResponse is empty because we cannot guarantee permanent object removal @@ -139,121 +139,121 @@ message DeleteResponse { } message HeadRequest { - // Carries the address of the object with the requested header. - refs.Address address = 1; + // Carries the address of the object with the requested header. + refs.Address address = 1; - // Carries the option to crop header to main part. - bool main_only = 2; + // Carries the option to crop header to main part. + bool main_only = 2; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the headers of the objects - // that are physically stored on the server. - bool raw = 3; + // Carries the raw option flag of the request. + // Raw request is sent to receive only the headers of the objects + // that are physically stored on the server. + bool raw = 3; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message HeadResponse { - // Carries the requested object header. - Header header = 1; + // Carries the requested object header. + Header header = 1; } message SearchRequest { - // Carries search container identifier. - refs.ContainerID container_id = 1; + // Carries search container identifier. + refs.ContainerID container_id = 1; - message Query { - uint32 version = 1; + message Query { + uint32 version = 1; - message Filter { - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; - } + message Filter { + enum MatchType { + MATCH_UNKNOWN = 0; + STRING_EQUAL = 1; + } - MatchType match_type = 1; + MatchType match_type = 1; - string name = 2; + string name = 2; - string value = 3; - } - - repeated Filter filters = 2; + string value = 3; } - Query query = 2; + repeated Filter filters = 2; + } - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + Query query = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; + + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message SearchResponse { - // Carries list of object identifiers that match the search query. - repeated refs.ObjectID id_list = 1; + // Carries list of object identifiers that match the search query. + repeated refs.ObjectID id_list = 1; } // Range groups the parameters of object payload range. message Range { - // Carries the offset of the range from the object payload start. - uint64 offset = 1; + // Carries the offset of the range from the object payload start. + uint64 offset = 1; - // Carries the length of the object payload range. - uint64 length = 2; + // Carries the length of the object payload range. + uint64 length = 2; } message GetRangeRequest { - // Address carries address of the object that contains the requested payload range. - refs.Address address = 1; + // Address carries address of the object that contains the requested payload range. + refs.Address address = 1; - // Range carries the parameters of the requested payload range. - Range range = 2; + // Range carries the parameters of the requested payload range. + Range range = 2; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message GetRangeResponse { - // Carries part of the object payload. - bytes chunk = 1; + // Carries part of the object payload. + bytes chunk = 1; } message GetRangeHashRequest { - // Carries address of the object that contains the requested payload range. - refs.Address address = 1; + // Carries address of the object that contains the requested payload range. + refs.Address address = 1; - // Carries the list of object payload range to calculate homomorphic hash. - repeated Range ranges = 2; + // Carries the list of object payload range to calculate homomorphic hash. + repeated Range ranges = 2; - // Carries binary salt to XOR object payload ranges before hash calculation. - bytes salt = 3; + // Carries binary salt to XOR object payload ranges before hash calculation. + bytes salt = 3; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } message GetRangeHashResponse { - // Carries list of homomorphic hashes in a binary format. - repeated bytes hash_list = 1; + // Carries list of homomorphic hashes in a binary format. + repeated bytes hash_list = 1; } diff --git a/object/types.proto b/object/types.proto index 978dc83..45d10b3 100644 --- a/object/types.proto +++ b/object/types.proto @@ -10,122 +10,124 @@ import "service/verify.proto"; // Header groups the information about the NeoFS object. message Header { - // Main groups mandatory information about the object. - // Message fields are presented in all NeoFS objects. - message Main { - // payload_length carries length of the object payload. - // Each object has a fixed payload length since it's immutable. - uint64 payload_length = 1; - // address carries object address in the NeoFS system. - // It encapsulates the object and the container identifiers. - refs.Address address = 2; - // owner_id carries identifier of the object owner. - refs.OwnerID owner_id = 3; + // Main groups mandatory information about the object. + // Message fields are presented in all NeoFS objects. + message Main { + // payload_length carries length of the object payload. + // Each object has a fixed payload length since it's immutable. + uint64 payload_length = 1; + // address carries object address in the NeoFS system. + // It encapsulates the object and the container identifiers. + refs.Address address = 2; + // owner_id carries identifier of the object owner. + refs.OwnerID owner_id = 3; + } + + // Main carries the main part of the header. + // Main MUST NOT be NULL. + Main main = 1; + + // Extended groups additional information about the object. + // It encapsulates both user and system attributes needed to regulate + // the NeoFS sub-systems. + message Extended { + // Integrity groups evidence of the integrity of an object's structure. + message Integrity { + // payload_checksum carries the checksum of object payload bytes. + // Changing any byte of the payload changes the checksum. + // It is calculated as a SHA-256 hash over payload bytes. + bytes payload_checksum = 1; + + // header_checksum carries checksum of the object header structure. + // It covers all object attributes. Changing any field of the object except + // CreatorKey and ChecksumSignature changes the checksum. + // payload_checksum and header_checksum cannot be merged due to the need + // to verify the header in the absence of a payload (e.g. in object.Head rpc). + // It is calculated as a SHA-256 hash over marshaled object header + // with cut creator_key and checksum_signature. + bytes header_checksum = 2; + + // session_token carries token of the session within which the object was created. + // If session token is presented in object, it acts as the user's proof of the + // correctness of the creator_key. + service.SessionToken session_token = 3; + + // creator_key carries public key of the object creator in a binary format. + bytes creator_key = 4; + + // checksum_signature carries signature of the structure checksum by the object creator. + bytes checksum_signature = 5; } - // Main carries the main part of the header. - // Main MUST NOT be NULL. - Main main = 1; + // integrity carries object integrity evidence. + Integrity integrity = 1; - // Extended groups additional information about the object. - // It encapsulates both user and system attributes needed to regulate - // the NeoFS sub-systems. - message Extended { - // Integrity groups evidence of the integrity of an object's structure. - message Integrity { - // payload_checksum carries the checksum of object payload bytes. - // Changing any byte of the payload changes the checksum. - // It is calculated as a SHA-256 hash over payload bytes. - bytes payload_checksum = 1; + // Attribute groups the parameters of the object attributes. + message Attribute { + // key carries the string key to the object attribute. + string key = 1; - // header_checksum carries checksum of the object header structure. - // It covers all object attributes. Changing any field of the object except - // CreatorKey and ChecksumSignature changes the checksum. - // payload_checksum and header_checksum cannot be merged due to the need - // to verify the header in the absence of a payload (e.g. in object.Head rpc). - // It is calculated as a SHA-256 hash over marshaled object header - // with cut creator_key and checksum_signature. - bytes header_checksum = 2; - - // session_token carries token of the session within which the object was created. - // If session token is presented in object, it acts as the user's proof of the - // correctness of the creator_key. - service.SessionToken session_token = 3; - - // creator_key carries public key of the object creator in a binary format. - bytes creator_key = 4; - - // checksum_signature carries signature of the structure checksum by the object creator. - bytes checksum_signature = 5; - } - - // integrity carries object integrity evidence. - Integrity integrity = 1; - - // Attribute groups the parameters of the object attributes. - message Attribute { - // key carries the string key to the object attribute. - string key = 1; - - // value carries the string value of the object attribute. - string value = 2; - } - - // attributes carries list of the object attributes in a string key-value format. - repeated Attribute attributes = 2; - - // creation_epoch carries number of NeoFS epoch on which the object was created. - uint64 creation_epoch = 3; - - // Tombstone groups the options for deleting an object. - message Tombstone { - } - - // Tombstone marks the object to be deleted. - Tombstone tombstone = 4; - - // homomorphic_hash carries homomorphic hash of the object payload. - bytes homomorphic_hash = 5; - - // StorageGroup groups meta information about a storage group. - message StorageGroup { - } - - // StorageGroup marks an object containing information about a storage group. - StorageGroup storage_group = 6; - - // Split groups information about spawning the object through a payload splitting. - message Split { - // Parent carries identifier of the origin object. - refs.ObjectID parent = 1; - - // Previous carries identifier of the left split neighbor. - refs.ObjectID previous = 2; - - // Next carries identifier of the right split neighbor. - refs.ObjectID next = 3; - - // Children carries list of identifiers of the objects generated by splitting the current. - repeated refs.ObjectID children = 4; - - // Origin carries the header of the origin object. - Header origin = 5; - } - - // Split carries the position of the object in the split hierarchy. - Split split = 7; + // value carries the string value of the object attribute. + string value = 2; } - // Extended carries the additional part of the header. - Extended extended = 2; + // attributes carries list of the object attributes in a string key-value format. + repeated Attribute attributes = 2; + + // creation_epoch carries number of NeoFS epoch on which the object was created. + uint64 creation_epoch = 3; + + // Tombstone groups the options for deleting an object. + message Tombstone { + } + + // Tombstone marks the object to be deleted. + Tombstone tombstone = 4; + + // homomorphic_hash carries homomorphic hash of the object payload. + bytes homomorphic_hash = 5; + + // StorageGroup groups meta information about a storage group. + message StorageGroup { + } + + // StorageGroup marks an object containing information about a storage group. + StorageGroup storage_group = 6; + + // Split groups information about spawning the object through a payload + // splitting. + message Split { + // Parent carries identifier of the origin object. + refs.ObjectID parent = 1; + + // Previous carries identifier of the left split neighbor. + refs.ObjectID previous = 2; + + // Next carries identifier of the right split neighbor. + refs.ObjectID next = 3; + + // Children carries list of identifiers of the objects generated by + // splitting the current. + repeated refs.ObjectID children = 4; + + // Origin carries the header of the origin object. + Header origin = 5; + } + + // Split carries the position of the object in the split hierarchy. + Split split = 7; + } + + // Extended carries the additional part of the header. + Extended extended = 2; } // Object groups the information about the NeoFS object. // It consists of payload data with additional service information. message Object { - // Header carries the object header. - Header header = 1; + // Header carries the object header. + Header header = 1; - // Payload carries the object payload bytes. - bytes payload = 2; + // Payload carries the object payload bytes. + bytes payload = 2; } diff --git a/refs/types.proto b/refs/types.proto index ba5ef25..e23aa4e 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -7,27 +7,27 @@ option csharp_namespace = "NeoFS.API.Refs"; // Address of object (container id + object id) message Address { - // container_id carries container identifier. - ContainerID container_id = 1; + // container_id carries container identifier. + ContainerID container_id = 1; - // object_id carries object identifier. - ObjectID object_id = 2; + // object_id carries object identifier. + ObjectID object_id = 2; } // ObjectID groups information about the NeoFS object identifier. message ObjectID { - // value carries the object identifier in a binary format. - bytes value = 1; + // value carries the object identifier in a binary format. + bytes value = 1; } // ContainerID groups information about the NeoFS container identifier. message ContainerID { - // value carries the container identifier in a binary format. - bytes value = 1; + // value carries the container identifier in a binary format. + bytes value = 1; } // OwnerID group information about the owner of the NeoFS container. message OwnerID { - // value carries the identifier of the container owner in a binary format. - bytes value = 1; + // value carries the identifier of the container owner in a binary format. + bytes value = 1; } \ No newline at end of file diff --git a/service/meta.proto b/service/meta.proto index 906e062..4c18181 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -7,17 +7,17 @@ option csharp_namespace = "NeoFS.API.Service"; // RequestMetaHeader contains information about request meta headers. message RequestMetaHeader { - // Carries maximum number of nodes in the request route. - uint32 ttl = 1; + // Carries maximum number of nodes in the request route. + uint32 ttl = 1; - message XHeader { - // Carries key to the X-Header. - string key = 1; + message XHeader { + // Carries key to the X-Header. + string key = 1; - // Carries value of the X-Header. - string value = 2; - } + // Carries value of the X-Header. + string value = 2; + } - // Carries request X-Headers. - repeated XHeader x_headers = 2; + // Carries request X-Headers. + repeated XHeader x_headers = 2; } diff --git a/service/verify.proto b/service/verify.proto index 9e52a5d..ba11abb 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -8,107 +8,108 @@ option csharp_namespace = "NeoFS.API.Service"; import "acl/types.proto"; import "refs/types.proto"; -// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request. +// RequestVerificationHeader is a set of signatures of every NeoFS Node that +// processed request. message RequestVerificationHeader { - message Signature { - // Key is compressed public key used for signature. - bytes key = 1; + message Signature { + // Key is compressed public key used for signature. + bytes key = 1; - // Sign is signature of the request or session key. - bytes sign = 2; - } + // Sign is signature of the request or session key. + bytes sign = 2; + } - // Signatures is a set of signatures of every passed NeoFS Node - repeated Signature signatures = 1; + // Signatures is a set of signatures of every passed NeoFS Node + repeated Signature signatures = 1; - // Token is a token of the session within which the request is sent - SessionToken token = 2; + // Token is a token of the session within which the request is sent + SessionToken token = 2; - // Bearer is a Bearer token of the request - BearerTokenMsg bearer = 3; + // Bearer is a Bearer token of the request + BearerTokenMsg bearer = 3; } // Represents the NeoFS session token. message SessionToken { - message Info { - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes id = 1; + message Info { + // ID is a token identifier. valid UUIDv4 represented in bytes + bytes id = 1; - // OwnerID carries identifier of the session initiator. - refs.OwnerID owner_id = 2; + // OwnerID carries identifier of the session initiator. + refs.OwnerID owner_id = 2; - // Verb is an enumeration of session request types - enum Verb { - // Refers to object.Put RPC call - OBJECT_PUT = 0; - // Refers to object.Get RPC call - OBJECT_GET = 1; - // Refers to object.Head RPC call - OBJECT_HEAD = 2; - // Refers to object.Search RPC call - OBJECT_SEARCH = 3; - // Refers to object.Delete RPC call - OBJECT_DELETE = 4; - // Refers to object.GetRange RPC call - OBJECT_RANGE = 5; - // Refers to object.GetRangeHash RPC call - OBJECT_RANGEHASH = 6; - } - - // Verb is a type of request for which the token is issued - Verb verb = 3; - - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 4; - - // SessionKey is a public key of session key - bytes session_key = 5; - - // OwnerKey is a public key of the token owner - bytes owner_key = 6; - - // Carries context of the session. - oneof context { - // object_address represents the object session context. - refs.Address object_address = 7; - } + // Verb is an enumeration of session request types + enum Verb { + // Refers to object.Put RPC call + OBJECT_PUT = 0; + // Refers to object.Get RPC call + OBJECT_GET = 1; + // Refers to object.Head RPC call + OBJECT_HEAD = 2; + // Refers to object.Search RPC call + OBJECT_SEARCH = 3; + // Refers to object.Delete RPC call + OBJECT_DELETE = 4; + // Refers to object.GetRange RPC call + OBJECT_RANGE = 5; + // Refers to object.GetRangeHash RPC call + OBJECT_RANGEHASH = 6; } - // token_info is a grouped information about token - Info token_info = 1; + // Verb is a type of request for which the token is issued + Verb verb = 3; - // Signature is a signature of session token information - bytes signature = 2; + // Lifetime is a lifetime of the session + TokenLifetime lifetime = 4; + + // SessionKey is a public key of session key + bytes session_key = 5; + + // OwnerKey is a public key of the token owner + bytes owner_key = 6; + + // Carries context of the session. + oneof context { + // object_address represents the object session context. + refs.Address object_address = 7; + } + } + + // token_info is a grouped information about token + Info token_info = 1; + + // Signature is a signature of session token information + bytes signature = 2; } // TokenLifetime carries a group of lifetime parameters of the token message TokenLifetime { - // created carries an initial epoch of token lifetime - uint64 created = 1; + // created carries an initial epoch of token lifetime + uint64 created = 1; - // valid_until carries a last epoch of token lifetime - uint64 valid_until = 2; + // valid_until carries a last epoch of token lifetime + uint64 valid_until = 2; } // BearerTokenMsg carries information about request ACL rules with limited lifetime message BearerTokenMsg { - message Info { - // EACLTable carries table of extended ACL rules. - acl.EACLTable eacl_table = 1; + message Info { + // EACLTable carries table of extended ACL rules. + acl.EACLTable eacl_table = 1; - // OwnerID carries identifier of the token owner. - refs.OwnerID owner_id = 2; + // OwnerID carries identifier of the token owner. + refs.OwnerID owner_id = 2; - // ValidUntil carries a last epoch of token lifetime - uint64 valid_until = 3; - } + // ValidUntil carries a last epoch of token lifetime + uint64 valid_until = 3; + } - // token_info is a grouped information about token - Info token_info = 1; + // token_info is a grouped information about token + Info token_info = 1; - // owner_key is a public key of the token owner - bytes owner_key = 2; + // owner_key is a public key of the token owner + bytes owner_key = 2; - // Signature is a signature of token information - bytes signature = 3; + // Signature is a signature of token information + bytes signature = 3; } diff --git a/session/service.proto b/session/service.proto index d28ff60..d4f940c 100644 --- a/session/service.proto +++ b/session/service.proto @@ -10,32 +10,32 @@ import "service/verify.proto"; import "refs/types.proto"; service Session { - // Create opens new session between the client and the server. - rpc Create (CreateRequest) returns (CreateResponse); + // Create opens new session between the client and the server. + rpc Create (CreateRequest) returns (CreateResponse); } // CreateRequest carries an information necessary for opening a session. message CreateRequest { - // Carries an identifier of a session initiator. - refs.OwnerID owner_id = 1; + // Carries an identifier of a session initiator. + refs.OwnerID owner_id = 1; - // Carries a lifetime of the session. - service.TokenLifetime lifetime = 2; + // Carries a lifetime of the session. + service.TokenLifetime lifetime = 2; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 98; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + // Carries request verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + service.RequestVerificationHeader verify_header = 99; } // CreateResponse carries an information about the opened session. message CreateResponse { - // id carries an identifier of session token. - bytes id = 1; + // id carries an identifier of session token. + bytes id = 1; - // session_key carries a session public key. - bytes session_key = 2; + // session_key carries a session public key. + bytes session_key = 2; } diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 2eb4ec6..20b5425 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -10,17 +10,21 @@ import "refs/types.proto"; // StorageGroup groups the information about the NeoFS storage group. // The storage group consists of objects from single container. message StorageGroup { - // validation_data_size carries the total size of the payloads of the storage group members. - uint64 validation_data_size = 1; + // validation_data_size carries the total size of the payloads of the storage + // group members. + uint64 validation_data_size = 1; - // validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members. - // The order of concatenation is the same as the order of the members in the Members field. - bytes validation_hash = 2; + // validation_hash carries homomorphic hash from the concatenation of the + // payloads of the storage group members + // The order of concatenation is the same as the order of the members in the + // Members field. + bytes validation_hash = 2; - // expiration_epoch carries last NeoFS epoch number of the storage group lifetime. - uint64 expiration_epoch = 3; + // expiration_epoch carries last NeoFS epoch number of the storage group + // lifetime. + uint64 expiration_epoch = 3; - // Members carries the list of identifiers of the object storage group members. - // The list is strictly ordered. - repeated refs.ObjectID members = 4; + // Members carries the list of identifiers of the object storage group members. + // The list is strictly ordered. + repeated refs.ObjectID members = 4; } From d22c2557cb471a114d014a62941a1611a96043a0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 11 Aug 2020 11:12:37 +0300 Subject: [PATCH 149/440] [#37] Add body message to balance requests Signed-off-by: Alex Vanin --- accounting/service.proto | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 7062b53..b276fdc 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -6,6 +6,8 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; option csharp_namespace = "NeoFS.API.Accounting"; import "refs/types.proto"; +import "service/meta.proto"; +import "service/verify.proto"; // The service provides methods for obtaining information // about the account balance in NeoFS system. @@ -22,8 +24,23 @@ service Accounting { // To gain access to the requested information, the request body must be formed // according to the requirements from the system specification. message BalanceRequest { - // Carries user identifier in NeoFS system for which the balance is requested. - refs.OwnerID owner_id = 1; + message Body { + // Carries user identifier in NeoFS system for which the balance + // is requested. + refs.OwnerID owner_id = 1; + } + + // Body of the balance request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } // Decimal represents the decimal numbers. @@ -39,6 +56,20 @@ message Decimal { // // The amount of funds is calculated in decimal numbers. message BalanceResponse { - // Carries the amount of funds on the account. - Decimal balance = 1; + message Body { + // Carries the amount of funds on the account. + Decimal balance = 1; + } + + // Body of the balance response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } From 7447bdceee4b985e638f6fa6225a22457580089b Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 11 Aug 2020 11:47:04 +0300 Subject: [PATCH 150/440] [#37] Add body message to container requests Signed-off-by: Alex Vanin --- container/service.proto | 238 ++++++++++++++++++++++++++++++++++------ 1 file changed, 204 insertions(+), 34 deletions(-) diff --git a/container/service.proto b/container/service.proto index 485c872..dddb38c 100644 --- a/container/service.proto +++ b/container/service.proto @@ -8,6 +8,8 @@ option csharp_namespace = "NeoFS.API.Container"; import "acl/types.proto"; import "container/types.proto"; import "refs/types.proto"; +import "service/meta.proto"; +import "service/verify.proto"; // Service provides API to access container smart-contract in morph chain // via NeoFS node. @@ -42,74 +44,242 @@ service Service { } message PutRequest { - // Container to create in NeoFS. - container.Container container = 1; + message Body { + // Container to create in NeoFS. + container.Container container = 1; - // Public Key of container owner. It can be public key of the owner - // or it can be public key that bound in neofs.id smart-contract. - bytes public_key = 2; + // Public Key of container owner. It can be public key of the owner + // or it can be public key that bound in neofs.id smart-contract. + bytes public_key = 2; - // Signature of stable-marshalled container according to RFC-6979. - bytes signature = 3; + // Signature of stable-marshalled container according to RFC-6979. + bytes signature = 3; + } + + // Body of container put request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } message PutResponse { - // container_id carries identifier of the new container. - refs.ContainerID container_id = 1; + message Body { + // container_id carries identifier of the new container. + refs.ContainerID container_id = 1; + } + + // Body of container put response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message DeleteRequest { - // container_id carries identifier of the container to delete from NeoFS. - refs.ContainerID container_id = 1; + message Body { + // container_id carries identifier of the container to delete + // from NeoFS. + refs.ContainerID container_id = 1; - // Signature of container id according to RFC-6979. - bytes signature = 2; + // Signature of container id according to RFC-6979. + bytes signature = 2; + } + + // Body of container delete request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because delete operation is asynchronous and done // via consensus in inner ring nodes -message DeleteResponse {} +message DeleteResponse { + message Body {} + + // Body of container delete response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; +} message GetRequest { - // container_id carries identifier of the container to get. - refs.ContainerID container_id = 1; + message Body { + // container_id carries identifier of the container to get. + refs.ContainerID container_id = 1; + } + + // Body of container get request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } message GetResponse { - // Container that has been requested. - container.Container container = 1; + message Body { + // Container that has been requested. + container.Container container = 1; + } + + // Body of container get response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message ListRequest { - // owner_id carries identifier of the container owner. - refs.OwnerID owner_id = 1; + message Body { + // owner_id carries identifier of the container owner. + refs.OwnerID owner_id = 1; + } + + // Body of list containers request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } message ListResponse { - // ContainerIDs carries list of identifiers of the containers that belong - // to the owner. - repeated refs.ContainerID container_ids = 1; + message Body { + // ContainerIDs carries list of identifiers of the containers that belong to the owner. + repeated refs.ContainerID container_ids = 1; + } + + // Body of list containers response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message SetExtendedACLRequest { - // Extended ACL to set for the container. - acl.EACLTable eacl = 1; + message Body { + // Extended ACL to set for the container. + acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes signature = 2; + } + + // Body of set extended acl request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } -message SetExtendedACLResponse {} +message SetExtendedACLResponse { + message Body { } + + // Body of set extended acl response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; +} message GetExtendedACLRequest { - // container_id carries identifier of the container that has Extended ACL. - refs.ContainerID container_id = 1; + message Body { + // container_id carries identifier of the container that has Extended ACL. + refs.ContainerID container_id = 1; + } + + // Body of get extended acl request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.RequestVerificationHeader verify_header = 3; } message GetExtendedACLResponse { - // Extended ACL that has been requested if it was set up. - acl.EACLTable eacl = 1; + message Body { + // Extended ACL that has been requested if it was set up. + acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + // Signature of stable-marshalled Extended ACL according to RFC-6979. + bytes signature = 2; + } + + // Body of get extended acl response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } From 60690a0f0b86b8e240fc9dc8afa60d9f5c303029 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 11 Aug 2020 11:59:36 +0300 Subject: [PATCH 151/440] [#37] Add body message to object requests Signed-off-by: Alex Vanin --- object/service.proto | 314 ++++++++++++++++++++++++++++++------------- 1 file changed, 223 insertions(+), 91 deletions(-) diff --git a/object/service.proto b/object/service.proto index 311eb26..613b61d 100644 --- a/object/service.proto +++ b/object/service.proto @@ -5,8 +5,8 @@ package object; option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; -import "refs/types.proto"; import "object/types.proto"; +import "refs/types.proto"; import "service/meta.proto"; import "service/verify.proto"; @@ -53,154 +53,248 @@ service Service { } message GetRequest { - // Carries the address of the requested object. - refs.Address address = 1; + message Body { + // Carries the address of the requested object. + refs.Address address = 1; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the objects - // that are physically stored on the server. - bool raw = 2; + // Carries the raw option flag of the request. + // Raw request is sent to receive only the objects + // that are physically stored on the server. + bool raw = 2; + } + + // Body of get object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message GetResponse { - // Carries the single message of the response stream. - oneof ObjectPart { - // Carries the object header. - Header header = 1; + message Body { + // Carries the single message of the response stream. + oneof ObjectPart { + // Carries the object header. + Header header = 1; - // Carries part of the object payload. - bytes chunk = 2; + // Carries part of the object payload. + bytes chunk = 2; + } } + + // Body of get object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message PutRequest { - // Groups initialization parameters of object placement in NeoFS. - message Init { - // Carries the header of the object to save in the system. - Header header = 1; + message Body { + // Groups initialization parameters of object placement in NeoFS. + message Init { + // Carries the header of the object to save in the system. + Header header = 1; - // Carries the number of the object copies to store - // within the RPC call. Default zero value is processed according - // to the container placement rules. - uint32 copies_number = 2; + // Carries the number of the object copies to store + // within the RPC call. Default zero value is processed according + // to the container placement rules. + uint32 copies_number = 2; + } + + // Carries the single part of the query stream. + oneof Part { + // Carries the initialization parameters of the object stream. + Init init = 1; + + // Carries part of the object payload. + bytes chunk = 2; + } } - // Carries the single part of the query stream. - oneof Part { - // Carries the initialization parameters of the object stream. - Init init = 1; - - // Carries part of the object payload. - bytes chunk = 2; - } + // Body of put object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message PutResponse { - // Carries identifier of the saved object. - // It is used to access an object in the container. - refs.ObjectID object_id = 1; + message Body { + // Carries identifier of the saved object. + // It is used to access an object in the container. + refs.ObjectID object_id = 1; + } + + // Body of put object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message DeleteRequest { - // Carries the address of the object to be deleted. - refs.Address address = 1; + message Body { + // Carries the address of the object to be deleted. + refs.Address address = 1; - // Carries identifier the object owner. - refs.OwnerID owner_id = 2; + // Carries identifier the object owner. + refs.OwnerID owner_id = 2; + } + + // Body of delete object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because we cannot guarantee permanent object removal // in distributed system. message DeleteResponse { + message Body { } + + // Body of delete object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message HeadRequest { - // Carries the address of the object with the requested header. - refs.Address address = 1; + message Body { + // Carries the address of the object with the requested header. + refs.Address address = 1; - // Carries the option to crop header to main part. - bool main_only = 2; + // Carries the option to crop header to main part. + bool main_only = 2; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the headers of the objects - // that are physically stored on the server. - bool raw = 3; + // Carries the raw option flag of the request. + // Raw request is sent to receive only the headers of the objects + // that are physically stored on the server. + bool raw = 3; + } + + // Body of head object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message HeadResponse { - // Carries the requested object header. - Header header = 1; + message Body { + // Carries the requested object header. + Header header = 1; + } + + // Body of head object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message SearchRequest { - // Carries search container identifier. - refs.ContainerID container_id = 1; + message Body { + // Carries search container identifier. + refs.ContainerID container_id = 1; - message Query { - uint32 version = 1; + message Query { + uint32 version = 1; - message Filter { - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; + message Filter { + enum MatchType { + MATCH_UNKNOWN = 0; + STRING_EQUAL = 1; + } + + MatchType match_type = 1; + + string name = 2; + + string value = 3; } - MatchType match_type = 1; - - string name = 2; - - string value = 3; + repeated Filter filters = 2; } - repeated Filter filters = 2; + Query query = 2; } - Query query = 2; + // Body of search object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message SearchResponse { - // Carries list of object identifiers that match the search query. - repeated refs.ObjectID id_list = 1; + message Body { + // Carries list of object identifiers that match the search query. + repeated refs.ObjectID id_list = 1; + } + + // Body of search object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } // Range groups the parameters of object payload range. @@ -213,47 +307,85 @@ message Range { } message GetRangeRequest { - // Address carries address of the object that contains the requested payload range. - refs.Address address = 1; + message Body { + // Address carries address of the object that contains the requested payload range. + refs.Address address = 1; - // Range carries the parameters of the requested payload range. - Range range = 2; + // Range carries the parameters of the requested payload range. + Range range = 2; + } + + // Body of get range object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message GetRangeResponse { - // Carries part of the object payload. - bytes chunk = 1; + message Body { + // Carries part of the object payload. + bytes chunk = 1; + } + + // Body of get range object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } message GetRangeHashRequest { - // Carries address of the object that contains the requested payload range. - refs.Address address = 1; + message Body { + // Carries address of the object that contains the requested payload range. + refs.Address address = 1; - // Carries the list of object payload range to calculate homomorphic hash. - repeated Range ranges = 2; + // Carries the list of object payload range to calculate homomorphic hash. + repeated Range ranges = 2; - // Carries binary salt to XOR object payload ranges before hash calculation. - bytes salt = 3; + // Carries binary salt to XOR object payload ranges before hash calculation. + bytes salt = 3; + } + + // Body of get range hash object request message. + Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } message GetRangeHashResponse { - // Carries list of homomorphic hashes in a binary format. - repeated bytes hash_list = 1; + message Body { + // Carries list of homomorphic hashes in a binary format. + repeated bytes hash_list = 1; + } + + // Body of get range hash object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } From 66c58e45e899c356baebe04fcd5e67260800e22c Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 11 Aug 2020 12:02:10 +0300 Subject: [PATCH 152/440] [#37] Add body message to session token requests Signed-off-by: Alex Vanin --- session/service.proto | 45 ++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/session/service.proto b/session/service.proto index d4f940c..6227800 100644 --- a/session/service.proto +++ b/session/service.proto @@ -5,9 +5,9 @@ package session; option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option csharp_namespace = "NeoFS.API.Session"; +import "refs/types.proto"; import "service/meta.proto"; import "service/verify.proto"; -import "refs/types.proto"; service Session { // Create opens new session between the client and the server. @@ -16,26 +16,45 @@ service Session { // CreateRequest carries an information necessary for opening a session. message CreateRequest { - // Carries an identifier of a session initiator. - refs.OwnerID owner_id = 1; + message Body { + // Carries an identifier of a session initiator. + refs.OwnerID owner_id = 1; - // Carries a lifetime of the session. - service.TokenLifetime lifetime = 2; + // Carries a lifetime of the session. + service.TokenLifetime lifetime = 2; + } - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 98; + // Body of create session token request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate message + // transport and does not affect request execution. + service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 99; + service.RequestVerificationHeader verify_header = 3; } // CreateResponse carries an information about the opened session. message CreateResponse { - // id carries an identifier of session token. - bytes id = 1; + message Body { + // id carries an identifier of session token. + bytes id = 1; - // session_key carries a session public key. - bytes session_key = 2; + // session_key carries a session public key. + bytes session_key = 2; + } + + // Body of create session token response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + service.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + service.ResponseVerificationHeader verify_header = 3; } From 818ec7f0dc9436c3c689ce59df8e5cb0491c4536 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 13:54:58 +0300 Subject: [PATCH 153/440] [#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 --- acl/types.proto | 3 +- container/types.proto | 2 +- object/service.proto | 72 ++++++++++------- object/types.proto | 182 ++++++++++++++++-------------------------- refs/types.proto | 5 +- service/meta.proto | 8 ++ service/verify.proto | 15 ++-- 7 files changed, 130 insertions(+), 157 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index cd673b4..31731fd 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -56,8 +56,7 @@ message EACLRecord { enum Header { HEADER_UNKNOWN = 0; REQUEST = 1; - OBJECT_SYSTEM = 2; - OBJECT_USER = 3; + OBJECT = 2; } // Header carries type of header. diff --git a/container/types.proto b/container/types.proto index 1b6041d..572c141 100644 --- a/container/types.proto +++ b/container/types.proto @@ -5,8 +5,8 @@ package container; option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; -import "refs/types.proto"; import "netmap/types.proto"; +import "refs/types.proto"; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes diff --git a/object/service.proto b/object/service.proto index 613b61d..88c3805 100644 --- a/object/service.proto +++ b/object/service.proto @@ -54,7 +54,7 @@ service Service { message GetRequest { message Body { - // Carries the address of the requested object. + // Address of the requested object. refs.Address address = 1; // Carries the raw option flag of the request. @@ -62,7 +62,6 @@ message GetRequest { // that are physically stored on the server. bool raw = 2; } - // Body of get object request message. Body body = 1; @@ -77,16 +76,23 @@ message GetRequest { message GetResponse { message Body { + // Initialization parameters of the object got from NeoFS. + message Init { + // Object ID + refs.ObjectID object_id = 1; + // Object signature + service.Signature signature =2; + // Object header. + Header header = 3; + } // Carries the single message of the response stream. oneof ObjectPart { - // Carries the object header. - Header header = 1; - - // Carries part of the object payload. + // Initialization parameters of the object stream. + Init init =1; + // Part of the object payload. bytes chunk = 2; } } - // Body of get object response message. Body body = 1; @@ -104,25 +110,26 @@ message PutRequest { message Body { // Groups initialization parameters of object placement in NeoFS. message Init { - // Carries the header of the object to save in the system. - Header header = 1; - - // Carries the number of the object copies to store - // within the RPC call. Default zero value is processed according - // to the container placement rules. - uint32 copies_number = 2; + // Object ID, where available + refs.ObjectID object_id = 1; + // Object signature, were available + service.Signature signature =2; + // Header of the object to save in the system. + Header header = 3; + // Number of the object copies to store within the RPC call. + // Default zero value is processed according to the + // container placement rules. + uint32 copies_number = 4; } // Carries the single part of the query stream. - oneof Part { + oneof ObjectPart { // Carries the initialization parameters of the object stream. Init init = 1; - // Carries part of the object payload. bytes chunk = 2; } } - // Body of put object request message. Body body = 1; @@ -141,7 +148,6 @@ message PutResponse { // It is used to access an object in the container. refs.ObjectID object_id = 1; } - // Body of put object response message. Body body = 1; @@ -159,11 +165,9 @@ message DeleteRequest { message Body { // Carries the address of the object to be deleted. refs.Address address = 1; - // Carries identifier the object owner. refs.OwnerID owner_id = 2; } - // Body of delete object request message. Body body = 1; @@ -196,18 +200,15 @@ message DeleteResponse { message HeadRequest { message Body { - // Carries the address of the object with the requested header. + // Address of the object with the requested header. refs.Address address = 1; - - // Carries the option to crop header to main part. + // Return only minimal header subset bool main_only = 2; - // Carries the raw option flag of the request. // Raw request is sent to receive only the headers of the objects // that are physically stored on the server. bool raw = 3; } - // Body of head object request message. Body body = 1; @@ -222,10 +223,25 @@ message HeadRequest { message HeadResponse { message Body { - // Carries the requested object header. - Header header = 1; + message ShortHeader { + // Object format version. + service.Version version = 1; + // Epoch when the object was created + uint64 creation_epoch = 2; + // Object's owner + refs.OwnerID owner_id = 3; + // Type of the object payload content + ObjectType object_type = 4; + // Size of payload in bytes. + // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown + uint64 payload_length = 5; + } + // Carries the requested object header or it's part + oneof Head{ + Header header = 1; + ShortHeader short_header = 2; + } } - // Body of head object response message. Body body = 1; diff --git a/object/types.proto b/object/types.proto index 45d10b3..3ec02cb 100644 --- a/object/types.proto +++ b/object/types.proto @@ -6,128 +6,80 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/object"; option csharp_namespace = "NeoFS.API.Object"; import "refs/types.proto"; +import "service/meta.proto"; import "service/verify.proto"; -// Header groups the information about the NeoFS object. +// Type of the object payload content +enum ObjectType { + // Just a normal object + REGULAR = 0; + // Used internally to identify deleted objects + TOMBSTONE = 1; + // Identifies that the object holds StorageGroup information + STORAGE_GROUP = 2; +} + message Header { - // Main groups mandatory information about the object. - // Message fields are presented in all NeoFS objects. - message Main { - // payload_length carries length of the object payload. - // Each object has a fixed payload length since it's immutable. - uint64 payload_length = 1; - // address carries object address in the NeoFS system. - // It encapsulates the object and the container identifiers. - refs.Address address = 2; - // owner_id carries identifier of the object owner. - refs.OwnerID owner_id = 3; + // Object's container + refs.ContainerID container_id = 1; + // Object's owner + refs.OwnerID owner_id = 2; + // Epoch when the object was created + uint64 creation_epoch = 3; + // Object format version. + // Effectively the version of API library used to create particular object + service.Version version = 4; + // Size of payload in bytes. + // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown + uint64 payload_length = 5; + // Hash of payload bytes + bytes payload_hash = 6; + ObjectType object_type = 7; + // Homomorphic hash of the object payload. + bytes homomorphic_hash = 8; + // Session token, if it was used during Object creation. + // Need it to verify integrity and authenticity out of Request scope. + service.SessionToken session_token = 9; + + // Attribute groups the user-defined Key-Value pairs attached to the object + message Attribute { + // string key to the object attribute + string key = 1; + // string value of the object attribute + string value = 2; } + repeated Attribute attributes = 10; - // Main carries the main part of the header. - // Main MUST NOT be NULL. - Main main = 1; - - // Extended groups additional information about the object. - // It encapsulates both user and system attributes needed to regulate - // the NeoFS sub-systems. - message Extended { - // Integrity groups evidence of the integrity of an object's structure. - message Integrity { - // payload_checksum carries the checksum of object payload bytes. - // Changing any byte of the payload changes the checksum. - // It is calculated as a SHA-256 hash over payload bytes. - bytes payload_checksum = 1; - - // header_checksum carries checksum of the object header structure. - // It covers all object attributes. Changing any field of the object except - // CreatorKey and ChecksumSignature changes the checksum. - // payload_checksum and header_checksum cannot be merged due to the need - // to verify the header in the absence of a payload (e.g. in object.Head rpc). - // It is calculated as a SHA-256 hash over marshaled object header - // with cut creator_key and checksum_signature. - bytes header_checksum = 2; - - // session_token carries token of the session within which the object was created. - // If session token is presented in object, it acts as the user's proof of the - // correctness of the creator_key. - service.SessionToken session_token = 3; - - // creator_key carries public key of the object creator in a binary format. - bytes creator_key = 4; - - // checksum_signature carries signature of the structure checksum by the object creator. - bytes checksum_signature = 5; - } - - // integrity carries object integrity evidence. - Integrity integrity = 1; - - // Attribute groups the parameters of the object attributes. - message Attribute { - // key carries the string key to the object attribute. - string key = 1; - - // value carries the string value of the object attribute. - string value = 2; - } - - // attributes carries list of the object attributes in a string key-value format. - repeated Attribute attributes = 2; - - // creation_epoch carries number of NeoFS epoch on which the object was created. - uint64 creation_epoch = 3; - - // Tombstone groups the options for deleting an object. - message Tombstone { - } - - // Tombstone marks the object to be deleted. - Tombstone tombstone = 4; - - // homomorphic_hash carries homomorphic hash of the object payload. - bytes homomorphic_hash = 5; - - // StorageGroup groups meta information about a storage group. - message StorageGroup { - } - - // StorageGroup marks an object containing information about a storage group. - StorageGroup storage_group = 6; - - // Split groups information about spawning the object through a payload - // splitting. - message Split { - // Parent carries identifier of the origin object. - refs.ObjectID parent = 1; - - // Previous carries identifier of the left split neighbor. - refs.ObjectID previous = 2; - - // Next carries identifier of the right split neighbor. - refs.ObjectID next = 3; - - // Children carries list of identifiers of the objects generated by - // splitting the current. - repeated refs.ObjectID children = 4; - - // Origin carries the header of the origin object. - Header origin = 5; - } - - // Split carries the position of the object in the split hierarchy. - Split split = 7; + // Information about spawning the objects through a payload splitting. + message Split { + // Identifier of the origin object. + // Parent and children objects must be within the same container. + // Parent object_id is known only to the minor child. + refs.ObjectID parent = 1; + // Previous carries identifier of the left split neighbor. + refs.ObjectID previous = 2; + // `signature` field of the parent object. Used to reconstruct parent. + service.Signature parent_signature = 3; + // `header` field of the parent object. Used to reconstruct parent. + Header parent_header = 4; + // Children carries list of identifiers of the objects generated by splitting the current. + repeated refs.ObjectID children = 5; } - - // Extended carries the additional part of the header. - Extended extended = 2; + // Position of the object in the split hierarchy. + Split split = 11; } -// Object groups the information about the NeoFS object. -// It consists of payload data with additional service information. +// Object structure. message Object { - // Header carries the object header. - Header header = 1; - - // Payload carries the object payload bytes. - bytes payload = 2; + // Object's unique identifier. + // Object is content-addressed. It means id will change if header or payload + // changes. It's calculated as a hash of header field, which contains hash of + // object's payload + refs.ObjectID object_id = 1; + // Signed object_id + service.Signature signature = 2; + // Object metadata headers + Header header = 3; + // Payload bytes. + bytes payload = 4; } diff --git a/refs/types.proto b/refs/types.proto index e23aa4e..0b5fcff 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -9,18 +9,17 @@ option csharp_namespace = "NeoFS.API.Refs"; message Address { // container_id carries container identifier. ContainerID container_id = 1; - // object_id carries object identifier. ObjectID object_id = 2; } -// ObjectID groups information about the NeoFS object identifier. +// NeoFS object identifier. message ObjectID { // value carries the object identifier in a binary format. bytes value = 1; } -// ContainerID groups information about the NeoFS container identifier. +// NeoFS container identifier. message ContainerID { // value carries the container identifier in a binary format. bytes value = 1; diff --git a/service/meta.proto b/service/meta.proto index 4c18181..ff5ceac 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -5,6 +5,14 @@ package service; option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; +// Represents API version used by node. +message Version { + // Major API version. + uint32 major = 1; + // Minor API version. + uint32 minor = 2; +} + // RequestMetaHeader contains information about request meta headers. message RequestMetaHeader { // Carries maximum number of nodes in the request route. diff --git a/service/verify.proto b/service/verify.proto index ba11abb..4ae10a9 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -8,17 +8,16 @@ option csharp_namespace = "NeoFS.API.Service"; import "acl/types.proto"; import "refs/types.proto"; +message Signature { + // Public key used for signing. + bytes key = 1; + // Signature + bytes sign = 2; +} + // RequestVerificationHeader is a set of signatures of every NeoFS Node that // processed request. message RequestVerificationHeader { - message Signature { - // Key is compressed public key used for signature. - bytes key = 1; - - // Sign is signature of the request or session key. - bytes sign = 2; - } - // Signatures is a set of signatures of every passed NeoFS Node repeated Signature signatures = 1; From 658bc45fb9023d1a4d9ae9b64eafd19c1b219173 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 16:04:54 +0300 Subject: [PATCH 154/440] [#38] docs: update docs after object type changes Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 3 +-- proto-docs/refs.md | 4 ++-- proto-docs/service.md | 46 +++++++++++++++++++++++++------------- proto-docs/storagegroup.md | 2 +- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index cd671d9..c550c30 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -101,8 +101,7 @@ Header is an enumeration of filtering header types. | ---- | ------ | ----------- | | HEADER_UNKNOWN | 0 | | | REQUEST | 1 | | -| OBJECT_SYSTEM | 2 | | -| OBJECT_USER | 3 | | +| OBJECT | 2 | | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index c5ac42c..1b87449 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -40,7 +40,7 @@ Address of object (container id + object id) ### Message ContainerID -ContainerID groups information about the NeoFS container identifier. +NeoFS container identifier. | Field | Type | Label | Description | @@ -51,7 +51,7 @@ ContainerID groups information about the NeoFS container identifier. ### Message ObjectID -ObjectID groups information about the NeoFS object identifier. +NeoFS object identifier. | Field | Type | Label | Description | diff --git a/proto-docs/service.md b/proto-docs/service.md index a997f49..723102f 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -8,6 +8,7 @@ - Messages - [RequestMetaHeader](#service.RequestMetaHeader) - [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) + - [Version](#service.Version) - [service/verify.proto](#service/verify.proto) @@ -16,9 +17,9 @@ - [BearerTokenMsg](#service.BearerTokenMsg) - [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) - [RequestVerificationHeader](#service.RequestVerificationHeader) - - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) - [SessionToken](#service.SessionToken) - [SessionToken.Info](#service.SessionToken.Info) + - [Signature](#service.Signature) - [TokenLifetime](#service.TokenLifetime) @@ -58,6 +59,18 @@ RequestMetaHeader contains information about request meta headers. | key | [string](#string) | | Carries key to the X-Header. | | value | [string](#string) | | Carries value of the X-Header. | + + + +### Message Version +Represents API version used by node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| major | [uint32](#uint32) | | Major API version. | +| minor | [uint32](#uint32) | | Minor API version. | + @@ -102,28 +115,17 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime ### Message RequestVerificationHeader -RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request. +RequestVerificationHeader is a set of signatures of every NeoFS Node that +processed request. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | +| signatures | [Signature](#service.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | | token | [SessionToken](#service.SessionToken) | | Token is a token of the session within which the request is sent | | bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | - - -### Message RequestVerificationHeader.Signature - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | Key is compressed public key used for signature. | -| sign | [bytes](#bytes) | | Sign is signature of the request or session key. | - - ### Message SessionToken @@ -145,7 +147,7 @@ Represents the NeoFS session token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session author. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session initiator. | | verb | [SessionToken.Info.Verb](#service.SessionToken.Info.Verb) | | Verb is a type of request for which the token is issued | | lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | @@ -153,6 +155,18 @@ Represents the NeoFS session token. | object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | + + +### Message Signature + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | Public key used for signing. | +| sign | [bytes](#bytes) | | Signature | + + ### Message TokenLifetime diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index a1e2aca..ca75ee1 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -32,7 +32,7 @@ The storage group consists of objects from single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | -| validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the Members field. | +| validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | | expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | | members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | From 4b1eb63b59b9ca92e9d90bdcf7c0d3692c1a0082 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 17:49:31 +0300 Subject: [PATCH 155/440] [#37] Add matryoska-style meta and verification headers Signed-off-by: Stanislav Bogatyrev --- service/meta.proto | 49 ++++++++++++++++++++++++++++++++------------ service/verify.proto | 22 +++++++++++++------- 2 files changed, 51 insertions(+), 20 deletions(-) diff --git a/service/meta.proto b/service/meta.proto index ff5ceac..77e5793 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -5,6 +5,16 @@ package service; option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; +import "acl/types.proto"; +import "service/verify.proto"; + +message XHeader { + // Key of the X-Header. + string key = 1; + // Value of the X-Header. + string value = 2; +} + // Represents API version used by node. message Version { // Major API version. @@ -13,19 +23,32 @@ message Version { uint32 minor = 2; } -// RequestMetaHeader contains information about request meta headers. +// Information about the request message RequestMetaHeader { - // Carries maximum number of nodes in the request route. - uint32 ttl = 1; + // Client API version. + Version version = 1; + // Client local epoch number. Set to 0 if unknown. + uint64 epoch = 2; + // Maximum number of nodes in the request route. + uint32 ttl = 3; + // Request X-Headers. + repeated XHeader x_headers = 4; - message XHeader { - // Carries key to the X-Header. - string key = 1; - - // Carries value of the X-Header. - string value = 2; - } - - // Carries request X-Headers. - repeated XHeader x_headers = 2; + // RequestMetaHeader of the origin request. + RequestMetaHeader origin = 98; +} + +// Information about the response +message ResponseMetaHeader { + // Server API version. + Version version = 1; + // Server local epoch number. + uint64 epoch = 2; + // Maximum number of nodes in the response route. + uint32 ttl = 3; + // Response X-Headers. + repeated XHeader x_headers = 4; + + // Carries response meta header of the origin response. + ResponseMetaHeader origin = 98; } diff --git a/service/verify.proto b/service/verify.proto index 4ae10a9..a1deab8 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -15,17 +15,17 @@ message Signature { bytes sign = 2; } -// RequestVerificationHeader is a set of signatures of every NeoFS Node that -// processed request. +// Verification info for request signed by all intermediate nodes message RequestVerificationHeader { - // Signatures is a set of signatures of every passed NeoFS Node - repeated Signature signatures = 1; + Signature body_signature = 1; + Signature meta_signature = 2; // Token is a token of the session within which the request is sent - SessionToken token = 2; - + SessionToken token = 3; // Bearer is a Bearer token of the request - BearerTokenMsg bearer = 3; + BearerTokenMsg bearer = 4; + + RequestVerificationHeader origin = 5; } // Represents the NeoFS session token. @@ -112,3 +112,11 @@ message BearerTokenMsg { // Signature is a signature of token information bytes signature = 3; } + +// Verification info for response signed by all intermediate nodes +message ResponseVerificationHeader { + Signature body_signature = 1; + Signature meta_signature = 2; + + ResponseVerificationHeader origin = 3; +} From f236f6bc5969ce7b5292a4d17dee95b86a3ca881 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 18:21:45 +0300 Subject: [PATCH 156/440] [#37] Move Bearer and Session Tokens to -Meta headers It may be more convenient to have tokens in request Meta headers. Mostly to simplify handling of verification headers. Signed-off-by: Stanislav Bogatyrev --- service/meta.proto | 79 +++++++++++++++++++++++++++++++- service/verify.proto | 105 ++++++------------------------------------- 2 files changed, 90 insertions(+), 94 deletions(-) diff --git a/service/meta.proto b/service/meta.proto index 77e5793..2e51d92 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -6,6 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option csharp_namespace = "NeoFS.API.Service"; import "acl/types.proto"; +import "refs/types.proto"; import "service/verify.proto"; message XHeader { @@ -23,6 +24,76 @@ message Version { uint32 minor = 2; } +// Lifetime parameters of the token. Filed names taken from rfc7519. +message TokenLifetime { + // Expiration Epoch + uint64 exp = 1; + // Not valid before Epoch + uint64 nbf = 2; + // Issued at Epoch + uint64 iat = 3; +} + +// NeoFS session token. +message SessionToken { + message Body { + // ID is a token identifier. valid UUIDv4 represented in bytes + bytes id = 1; + // OwnerID carries identifier of the session initiator. + refs.OwnerID owner_id = 2; + // Verb is an enumeration of session request types + enum Verb { + // Refers to object.Put RPC call + OBJECT_PUT = 0; + // Refers to object.Get RPC call + OBJECT_GET = 1; + // Refers to object.Head RPC call + OBJECT_HEAD = 2; + // Refers to object.Search RPC call + OBJECT_SEARCH = 3; + // Refers to object.Delete RPC call + OBJECT_DELETE = 4; + // Refers to object.GetRange RPC call + OBJECT_RANGE = 5; + // Refers to object.GetRangeHash RPC call + OBJECT_RANGEHASH = 6; + } + // Verb is a type of request for which the token is issued + Verb verb = 3; + // Lifetime is a lifetime of the session + TokenLifetime lifetime = 4; + // SessionKey is a public key of session key + bytes session_key = 5; + // Carries context of the session. + oneof context { + // object_address represents the object session context. + refs.Address object_address = 6; + } + } + // Session Token body + Body token = 1; + + // Signature is a signature of session token information + Signature signature = 2; +} + +// BearerToken has information about request ACL rules with limited lifetime +message BearerToken { + message Body { + // EACLTable carries table of extended ACL rules + acl.EACLTable eacl_table = 1; + // OwnerID carries identifier of the token owner + refs.OwnerID owner_id = 2; + // Token expiration and valid time period parameters + TokenLifetime lifetime = 3; + } + // Bearer Token body + Body token = 1; + + // Signature of BearerToken body + Signature signature = 2; +} + // Information about the request message RequestMetaHeader { // Client API version. @@ -33,9 +104,13 @@ message RequestMetaHeader { uint32 ttl = 3; // Request X-Headers. repeated XHeader x_headers = 4; + // Token is a token of the session within which the request is sent + SessionToken token = 5; + // Bearer is a Bearer token of the request + BearerToken bearer = 6; // RequestMetaHeader of the origin request. - RequestMetaHeader origin = 98; + RequestMetaHeader origin = 7; } // Information about the response @@ -50,5 +125,5 @@ message ResponseMetaHeader { repeated XHeader x_headers = 4; // Carries response meta header of the origin response. - ResponseMetaHeader origin = 98; + ResponseMetaHeader origin = 5; } diff --git a/service/verify.proto b/service/verify.proto index a1deab8..0c8e39f 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -8,6 +8,7 @@ option csharp_namespace = "NeoFS.API.Service"; import "acl/types.proto"; import "refs/types.proto"; +// Signature of something in NeoFS message Signature { // Public key used for signing. bytes key = 1; @@ -17,106 +18,26 @@ message Signature { // Verification info for request signed by all intermediate nodes message RequestVerificationHeader { + // Request Body signature. Should be generated once by request initiator. Signature body_signature = 1; + // Request Meta signature is added and signed by any intermediate node Signature meta_signature = 2; + // Sign previous hops + Signature origin_signature = 3; - // Token is a token of the session within which the request is sent - SessionToken token = 3; - // Bearer is a Bearer token of the request - BearerTokenMsg bearer = 4; - - RequestVerificationHeader origin = 5; -} - -// Represents the NeoFS session token. -message SessionToken { - message Info { - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes id = 1; - - // OwnerID carries identifier of the session initiator. - refs.OwnerID owner_id = 2; - - // Verb is an enumeration of session request types - enum Verb { - // Refers to object.Put RPC call - OBJECT_PUT = 0; - // Refers to object.Get RPC call - OBJECT_GET = 1; - // Refers to object.Head RPC call - OBJECT_HEAD = 2; - // Refers to object.Search RPC call - OBJECT_SEARCH = 3; - // Refers to object.Delete RPC call - OBJECT_DELETE = 4; - // Refers to object.GetRange RPC call - OBJECT_RANGE = 5; - // Refers to object.GetRangeHash RPC call - OBJECT_RANGEHASH = 6; - } - - // Verb is a type of request for which the token is issued - Verb verb = 3; - - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 4; - - // SessionKey is a public key of session key - bytes session_key = 5; - - // OwnerKey is a public key of the token owner - bytes owner_key = 6; - - // Carries context of the session. - oneof context { - // object_address represents the object session context. - refs.Address object_address = 7; - } - } - - // token_info is a grouped information about token - Info token_info = 1; - - // Signature is a signature of session token information - bytes signature = 2; -} - -// TokenLifetime carries a group of lifetime parameters of the token -message TokenLifetime { - // created carries an initial epoch of token lifetime - uint64 created = 1; - - // valid_until carries a last epoch of token lifetime - uint64 valid_until = 2; -} - -// BearerTokenMsg carries information about request ACL rules with limited lifetime -message BearerTokenMsg { - message Info { - // EACLTable carries table of extended ACL rules. - acl.EACLTable eacl_table = 1; - - // OwnerID carries identifier of the token owner. - refs.OwnerID owner_id = 2; - - // ValidUntil carries a last epoch of token lifetime - uint64 valid_until = 3; - } - - // token_info is a grouped information about token - Info token_info = 1; - - // owner_key is a public key of the token owner - bytes owner_key = 2; - - // Signature is a signature of token information - bytes signature = 3; + // Chain of previous hops signatures + RequestVerificationHeader origin = 4; } // Verification info for response signed by all intermediate nodes message ResponseVerificationHeader { + // Response Body signature. Should be generated once by answering node. Signature body_signature = 1; + // Response Meta signature is added and signed by any intermediate node Signature meta_signature = 2; + // Sign previous hops + Signature origin_signature = 3; - ResponseVerificationHeader origin = 3; + // Chain of previous hops signatures + ResponseVerificationHeader origin = 4; } From cfd24944a49274e39dba77797cb78e5fc4b7eed6 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 18:39:34 +0300 Subject: [PATCH 157/440] [#38] Typo fixes Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 2 +- object/service.proto | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index da825b2..44866d2 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -31,7 +31,7 @@ message PlacementRule { Operation op = 1; - oneof Args { + oneof args { string value = 2; SimpleFilters f_args = 3; } diff --git a/object/service.proto b/object/service.proto index 88c3805..df5d6ab 100644 --- a/object/service.proto +++ b/object/service.proto @@ -86,7 +86,7 @@ message GetResponse { Header header = 3; } // Carries the single message of the response stream. - oneof ObjectPart { + oneof object_part { // Initialization parameters of the object stream. Init init =1; // Part of the object payload. @@ -123,7 +123,7 @@ message PutRequest { } // Carries the single part of the query stream. - oneof ObjectPart { + oneof object_part { // Carries the initialization parameters of the object stream. Init init = 1; // Carries part of the object payload. @@ -237,7 +237,7 @@ message HeadResponse { uint64 payload_length = 5; } // Carries the requested object header or it's part - oneof Head{ + oneof head{ Header header = 1; ShortHeader short_header = 2; } From a77480582d1014cde3a9ffc88a42a67471af4e22 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 11 Aug 2020 18:49:56 +0300 Subject: [PATCH 158/440] [#37] docs: Regenerate markdown docs Signed-off-by: Stanislav Bogatyrev --- proto-docs/accounting.md | 35 +++- proto-docs/container.md | 168 ++++++++++++++++ proto-docs/object.md | 411 +++++++++++++++++++++++++++------------ proto-docs/service.md | 227 ++++++++++++--------- proto-docs/session.md | 30 ++- 5 files changed, 650 insertions(+), 221 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index ac05b5d..3184254 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -9,7 +9,9 @@ - Messages - [BalanceRequest](#accounting.BalanceRequest) + - [BalanceRequest.Body](#accounting.BalanceRequest.Body) - [BalanceResponse](#accounting.BalanceResponse) + - [BalanceResponse.Body](#accounting.BalanceResponse.Body) - [Decimal](#accounting.Decimal) @@ -51,10 +53,24 @@ Returns the amount of funds for the requested NeoFS account. ### Message BalanceRequest Message defines the request body of Balance method. -To indicate the account for which the balance is requested, it's identifier is used. +To indicate the account for which the balance is requested, it's identifier +is used. + +To gain access to the requested information, the request body must be formed +according to the requirements from the system specification. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [BalanceRequest.Body](#accounting.BalanceRequest.Body) | | Body of the balance request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message BalanceRequest.Body -To gain access to the requested information, the request body must be formed according -to the requirements from the system specification. | Field | Type | Label | Description | @@ -70,6 +86,19 @@ Message defines the response body of Balance method. The amount of funds is calculated in decimal numbers. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [BalanceResponse.Body](#accounting.BalanceResponse.Body) | | Body of the balance response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message BalanceResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | balance | [Decimal](#accounting.Decimal) | | Carries the amount of funds on the account. | diff --git a/proto-docs/container.md b/proto-docs/container.md index 55120a2..ff5e3c5 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -9,17 +9,29 @@ - Messages - [DeleteRequest](#container.DeleteRequest) + - [DeleteRequest.Body](#container.DeleteRequest.Body) - [DeleteResponse](#container.DeleteResponse) + - [DeleteResponse.Body](#container.DeleteResponse.Body) - [GetExtendedACLRequest](#container.GetExtendedACLRequest) + - [GetExtendedACLRequest.Body](#container.GetExtendedACLRequest.Body) - [GetExtendedACLResponse](#container.GetExtendedACLResponse) + - [GetExtendedACLResponse.Body](#container.GetExtendedACLResponse.Body) - [GetRequest](#container.GetRequest) + - [GetRequest.Body](#container.GetRequest.Body) - [GetResponse](#container.GetResponse) + - [GetResponse.Body](#container.GetResponse.Body) - [ListRequest](#container.ListRequest) + - [ListRequest.Body](#container.ListRequest.Body) - [ListResponse](#container.ListResponse) + - [ListResponse.Body](#container.ListResponse.Body) - [PutRequest](#container.PutRequest) + - [PutRequest.Body](#container.PutRequest.Body) - [PutResponse](#container.PutResponse) + - [PutResponse.Body](#container.PutResponse.Body) - [SetExtendedACLRequest](#container.SetExtendedACLRequest) + - [SetExtendedACLRequest.Body](#container.SetExtendedACLRequest.Body) - [SetExtendedACLResponse](#container.SetExtendedACLResponse) + - [SetExtendedACLResponse.Body](#container.SetExtendedACLResponse.Body) - [container/types.proto](#container/types.proto) @@ -118,6 +130,19 @@ smart-contract storage. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [DeleteRequest.Body](#container.DeleteRequest.Body) | | Body of container delete request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message DeleteRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | @@ -131,6 +156,19 @@ DeleteResponse is empty because delete operation is asynchronous and done via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [DeleteResponse.Body](#container.DeleteResponse.Body) | | Body of container delete response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message DeleteResponse.Body + + + @@ -138,6 +176,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetExtendedACLRequest.Body](#container.GetExtendedACLRequest.Body) | | Body of get extended acl request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetExtendedACLRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container that has Extended ACL. | @@ -149,6 +200,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetExtendedACLResponse.Body](#container.GetExtendedACLResponse.Body) | | Body of get extended acl response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetExtendedACLResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL that has been requested if it was set up. | @@ -161,6 +225,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetRequest.Body](#container.GetRequest.Body) | | Body of container get request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to get. | @@ -172,6 +249,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetResponse.Body](#container.GetResponse.Body) | | Body of container get response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#container.Container) | | Container that has been requested. | @@ -183,6 +273,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListRequest.Body](#container.ListRequest.Body) | | Body of list containers request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | owner_id | [refs.OwnerID](#refs.OwnerID) | | owner_id carries identifier of the container owner. | @@ -194,6 +297,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListResponse.Body](#container.ListResponse.Body) | | Body of list containers response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_ids | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | @@ -205,6 +321,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PutRequest.Body](#container.PutRequest.Body) | | Body of container put request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PutRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#container.Container) | | Container to create in NeoFS. | @@ -218,6 +347,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PutResponse.Body](#container.PutResponse.Body) | | Body of container put response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PutResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the new container. | @@ -229,6 +371,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [SetExtendedACLRequest.Body](#container.SetExtendedACLRequest.Body) | | Body of set extended acl request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message SetExtendedACLRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL to set for the container. | @@ -241,6 +396,19 @@ via consensus in inner ring nodes +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [SetExtendedACLResponse.Body](#container.SetExtendedACLResponse.Body) | | Body of set extended acl response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message SetExtendedACLResponse.Body + + + diff --git a/proto-docs/object.md b/proto-docs/object.md index c23d8ab..0e0633e 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -9,36 +9,47 @@ - Messages - [DeleteRequest](#object.DeleteRequest) + - [DeleteRequest.Body](#object.DeleteRequest.Body) - [DeleteResponse](#object.DeleteResponse) + - [DeleteResponse.Body](#object.DeleteResponse.Body) - [GetRangeHashRequest](#object.GetRangeHashRequest) + - [GetRangeHashRequest.Body](#object.GetRangeHashRequest.Body) - [GetRangeHashResponse](#object.GetRangeHashResponse) + - [GetRangeHashResponse.Body](#object.GetRangeHashResponse.Body) - [GetRangeRequest](#object.GetRangeRequest) + - [GetRangeRequest.Body](#object.GetRangeRequest.Body) - [GetRangeResponse](#object.GetRangeResponse) + - [GetRangeResponse.Body](#object.GetRangeResponse.Body) - [GetRequest](#object.GetRequest) + - [GetRequest.Body](#object.GetRequest.Body) - [GetResponse](#object.GetResponse) + - [GetResponse.Body](#object.GetResponse.Body) + - [GetResponse.Body.Init](#object.GetResponse.Body.Init) - [HeadRequest](#object.HeadRequest) + - [HeadRequest.Body](#object.HeadRequest.Body) - [HeadResponse](#object.HeadResponse) + - [HeadResponse.Body](#object.HeadResponse.Body) + - [HeadResponse.Body.ShortHeader](#object.HeadResponse.Body.ShortHeader) - [PutRequest](#object.PutRequest) - - [PutRequest.Init](#object.PutRequest.Init) + - [PutRequest.Body](#object.PutRequest.Body) + - [PutRequest.Body.Init](#object.PutRequest.Body.Init) - [PutResponse](#object.PutResponse) + - [PutResponse.Body](#object.PutResponse.Body) - [Range](#object.Range) - [SearchRequest](#object.SearchRequest) - - [SearchRequest.Query](#object.SearchRequest.Query) - - [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) + - [SearchRequest.Body](#object.SearchRequest.Body) + - [SearchRequest.Body.Query](#object.SearchRequest.Body.Query) + - [SearchRequest.Body.Query.Filter](#object.SearchRequest.Body.Query.Filter) - [SearchResponse](#object.SearchResponse) + - [SearchResponse.Body](#object.SearchResponse.Body) - [object/types.proto](#object/types.proto) - Messages - [Header](#object.Header) - - [Header.Extended](#object.Header.Extended) - - [Header.Extended.Attribute](#object.Header.Extended.Attribute) - - [Header.Extended.Integrity](#object.Header.Extended.Integrity) - - [Header.Extended.Split](#object.Header.Extended.Split) - - [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) - - [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) - - [Header.Main](#object.Header.Main) + - [Header.Attribute](#object.Header.Attribute) + - [Header.Split](#object.Header.Split) - [Object](#object.Object) @@ -148,12 +159,23 @@ calculated for XORed data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | +| body | [DeleteRequest.Body](#object.DeleteRequest.Body) | | Body of delete object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + +### Message DeleteRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | + + ### Message DeleteResponse @@ -161,6 +183,19 @@ DeleteResponse is empty because we cannot guarantee permanent object removal in distributed system. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [DeleteResponse.Body](#object.DeleteResponse.Body) | | Body of delete object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message DeleteResponse.Body + + + @@ -168,13 +203,24 @@ in distributed system. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetRangeHashRequest.Body](#object.GetRangeHashRequest.Body) | | Body of get range hash object request message. | +| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetRangeHashRequest.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | address | [refs.Address](#refs.Address) | | Carries address of the object that contains the requested payload range. | | ranges | [Range](#object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | | salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -183,6 +229,19 @@ in distributed system. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetRangeHashResponse.Body](#object.GetRangeHashResponse.Body) | | Body of get range hash object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetRangeHashResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | hash_list | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | @@ -196,18 +255,42 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | -| range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | +| body | [GetRangeRequest.Body](#object.GetRangeRequest.Body) | | Body of get range object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + +### Message GetRangeRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | +| range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | + + ### Message GetRangeResponse +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [GetRangeResponse.Body](#object.GetRangeResponse.Body) | | Body of get range object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetRangeResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | chunk | [bytes](#bytes) | | Carries part of the object payload. | @@ -221,12 +304,23 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Carries the address of the requested object. | -| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | +| body | [GetRequest.Body](#object.GetRequest.Body) | | Body of get object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + +### Message GetRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [refs.Address](#refs.Address) | | Address of the requested object. | +| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | + + ### Message GetResponse @@ -235,8 +329,34 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#object.Header) | | Carries the object header. | -| chunk | [bytes](#bytes) | | Carries part of the object payload. | +| body | [GetResponse.Body](#object.GetResponse.Body) | | Body of get object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message GetResponse.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| init | [GetResponse.Body.Init](#object.GetResponse.Body.Init) | | Initialization parameters of the object stream. | +| chunk | [bytes](#bytes) | | Part of the object payload. | + + + + +### Message GetResponse.Body.Init +Initialization parameters of the object got from NeoFS. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| object_id | [refs.ObjectID](#refs.ObjectID) | | Object ID | +| signature | [service.Signature](#service.Signature) | | Object signature | +| header | [Header](#object.Header) | | Object header. | @@ -247,13 +367,24 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Carries the address of the object with the requested header. | -| main_only | [bool](#bool) | | Carries the option to crop header to main part. | -| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | +| body | [HeadRequest.Body](#object.HeadRequest.Body) | | Body of head object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + +### Message HeadRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [refs.Address](#refs.Address) | | Address of the object with the requested header. | +| main_only | [bool](#bool) | | Return only minimal header subset | +| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | + + ### Message HeadResponse @@ -262,7 +393,36 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#object.Header) | | Carries the requested object header. | +| body | [HeadResponse.Body](#object.HeadResponse.Body) | | Body of head object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message HeadResponse.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| header | [Header](#object.Header) | | | +| short_header | [HeadResponse.Body.ShortHeader](#object.HeadResponse.Body.ShortHeader) | | | + + + + +### Message HeadResponse.Body.ShortHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [service.Version](#service.Version) | | Object format version. | +| creation_epoch | [uint64](#uint64) | | Epoch when the object was created | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Object's owner | +| object_type | [ObjectType](#object.ObjectType) | | Type of the object payload content | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | @@ -273,22 +433,35 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| init | [PutRequest.Init](#object.PutRequest.Init) | | Carries the initialization parameters of the object stream. | -| chunk | [bytes](#bytes) | | Carries part of the object payload. | +| body | [PutRequest.Body](#object.PutRequest.Body) | | Body of put object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + -### Message PutRequest.Init +### Message PutRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| init | [PutRequest.Body.Init](#object.PutRequest.Body.Init) | | Carries the initialization parameters of the object stream. | +| chunk | [bytes](#bytes) | | Carries part of the object payload. | + + + + +### Message PutRequest.Body.Init Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#object.Header) | | Carries the header of the object to save in the system. | -| copies_number | [uint32](#uint32) | | Carries the number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | +| object_id | [refs.ObjectID](#refs.ObjectID) | | Object ID, where available | +| signature | [service.Signature](#service.Signature) | | Object signature, were available | +| header | [Header](#object.Header) | | Header of the object to save in the system. | +| copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | @@ -297,6 +470,19 @@ Groups initialization parameters of object placement in NeoFS. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PutResponse.Body](#object.PutResponse.Body) | | Body of put object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PutResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | object_id | [refs.ObjectID](#refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | @@ -322,33 +508,44 @@ Range groups the parameters of object payload range. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | -| query | [SearchRequest.Query](#object.SearchRequest.Query) | | | +| body | [SearchRequest.Body](#object.SearchRequest.Body) | | Body of search object request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + -### Message SearchRequest.Query +### Message SearchRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | +| query | [SearchRequest.Body.Query](#object.SearchRequest.Body.Query) | | | + + + + +### Message SearchRequest.Body.Query | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | version | [uint32](#uint32) | | | -| filters | [SearchRequest.Query.Filter](#object.SearchRequest.Query.Filter) | repeated | | +| filters | [SearchRequest.Body.Query.Filter](#object.SearchRequest.Body.Query.Filter) | repeated | | - + -### Message SearchRequest.Query.Filter +### Message SearchRequest.Body.Query.Filter | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| match_type | [SearchRequest.Query.Filter.MatchType](#object.SearchRequest.Query.Filter.MatchType) | | | +| match_type | [SearchRequest.Body.Query.Filter.MatchType](#object.SearchRequest.Body.Query.Filter.MatchType) | | | | name | [string](#string) | | | | value | [string](#string) | | | @@ -359,6 +556,19 @@ Range groups the parameters of object payload range. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [SearchResponse.Body](#object.SearchResponse.Body) | | Body of search object response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message SearchResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id_list | [refs.ObjectID](#refs.ObjectID) | repeated | Carries list of object identifiers that match the search query. | @@ -366,9 +576,9 @@ Range groups the parameters of object payload range. - + -### SearchRequest.Query.Filter.MatchType +### SearchRequest.Body.Query.Filter.MatchType | Name | Number | Description | @@ -393,118 +603,79 @@ Range groups the parameters of object payload range. ### Message Header -Header groups the information about the NeoFS object. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| main | [Header.Main](#object.Header.Main) | | Main carries the main part of the header. Main MUST NOT be NULL. | -| extended | [Header.Extended](#object.Header.Extended) | | Extended carries the additional part of the header. | +| container_id | [refs.ContainerID](#refs.ContainerID) | | Object's container | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Object's owner | +| creation_epoch | [uint64](#uint64) | | Epoch when the object was created | +| version | [service.Version](#service.Version) | | Object format version. Effectively the version of API library used to create particular object | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | +| payload_hash | [bytes](#bytes) | | Hash of payload bytes | +| object_type | [ObjectType](#object.ObjectType) | | | +| homomorphic_hash | [bytes](#bytes) | | Homomorphic hash of the object payload. | +| session_token | [service.SessionToken](#service.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | +| attributes | [Header.Attribute](#object.Header.Attribute) | repeated | | +| split | [Header.Split](#object.Header.Split) | | Position of the object in the split hierarchy. | - + -### Message Header.Extended -Extended groups additional information about the object. -It encapsulates both user and system attributes needed to regulate -the NeoFS sub-systems. +### Message Header.Attribute +Attribute groups the user-defined Key-Value pairs attached to the object | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| integrity | [Header.Extended.Integrity](#object.Header.Extended.Integrity) | | integrity carries object integrity evidence. | -| attributes | [Header.Extended.Attribute](#object.Header.Extended.Attribute) | repeated | attributes carries list of the object attributes in a string key-value format. | -| creation_epoch | [uint64](#uint64) | | creation_epoch carries number of NeoFS epoch on which the object was created. | -| tombstone | [Header.Extended.Tombstone](#object.Header.Extended.Tombstone) | | Tombstone marks the object to be deleted. | -| homomorphic_hash | [bytes](#bytes) | | homomorphic_hash carries homomorphic hash of the object payload. | -| storage_group | [Header.Extended.StorageGroup](#object.Header.Extended.StorageGroup) | | StorageGroup marks an object containing information about a storage group. | -| split | [Header.Extended.Split](#object.Header.Extended.Split) | | Split carries the position of the object in the split hierarchy. | +| key | [string](#string) | | string key to the object attribute | +| value | [string](#string) | | string value of the object attribute | - + -### Message Header.Extended.Attribute -Attribute groups the parameters of the object attributes. +### Message Header.Split +Information about spawning the objects through a payload splitting. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | key carries the string key to the object attribute. | -| value | [string](#string) | | value carries the string value of the object attribute. | - - - - -### Message Header.Extended.Integrity -Integrity groups evidence of the integrity of an object's structure. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| payload_checksum | [bytes](#bytes) | | payload_checksum carries the checksum of object payload bytes. Changing any byte of the payload changes the checksum. It is calculated as a SHA-256 hash over payload bytes. | -| header_checksum | [bytes](#bytes) | | header_checksum carries checksum of the object header structure. It covers all object attributes. Changing any field of the object except CreatorKey and ChecksumSignature changes the checksum. payload_checksum and header_checksum cannot be merged due to the need to verify the header in the absence of a payload (e.g. in object.Head rpc). It is calculated as a SHA-256 hash over marshaled object header with cut creator_key and checksum_signature. | -| session_token | [service.SessionToken](#service.SessionToken) | | session_token carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the creator_key. | -| creator_key | [bytes](#bytes) | | creator_key carries public key of the object creator in a binary format. | -| checksum_signature | [bytes](#bytes) | | checksum_signature carries signature of the structure checksum by the object creator. | - - - - -### Message Header.Extended.Split -Split groups information about spawning the object through a payload splitting. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. | +| parent | [refs.ObjectID](#refs.ObjectID) | | Identifier of the origin object. Parent and children objects must be within the same container. Parent object_id is known only to the minor child. | | previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | -| next | [refs.ObjectID](#refs.ObjectID) | | Next carries identifier of the right split neighbor. | +| parent_signature | [service.Signature](#service.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | +| parent_header | [Header](#object.Header) | | `header` field of the parent object. Used to reconstruct parent. | | children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | -| origin | [Header](#object.Header) | | Origin carries the header of the origin object. | - - - - -### Message Header.Extended.StorageGroup -StorageGroup groups meta information about a storage group. - - - - - -### Message Header.Extended.Tombstone -Tombstone groups the options for deleting an object. - - - - - -### Message Header.Main -Main groups mandatory information about the object. -Message fields are presented in all NeoFS objects. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| payload_length | [uint64](#uint64) | | payload_length carries length of the object payload. Each object has a fixed payload length since it's immutable. | -| address | [refs.Address](#refs.Address) | | address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | owner_id carries identifier of the object owner. | ### Message Object -Object groups the information about the NeoFS object. -It consists of payload data with additional service information. +Object structure. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#object.Header) | | Header carries the object header. | -| payload | [bytes](#bytes) | | Payload carries the object payload bytes. | +| object_id | [refs.ObjectID](#refs.ObjectID) | | Object's unique identifier. Object is content-addressed. It means id will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload | +| signature | [service.Signature](#service.Signature) | | Signed object_id | +| header | [Header](#object.Header) | | Object metadata headers | +| payload | [bytes](#bytes) | | Payload bytes. | + + + +### ObjectType +Type of the object payload content + +| Name | Number | Description | +| ---- | ------ | ----------- | +| REGULAR | 0 | Just a normal object | +| TOMBSTONE | 1 | Used internally to identify deleted objects | +| STORAGE_GROUP | 2 | Identifies that the object holds StorageGroup information | + + diff --git a/proto-docs/service.md b/proto-docs/service.md index 723102f..6f9c9e8 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,21 +6,23 @@ - [service/meta.proto](#service/meta.proto) - Messages + - [BearerToken](#service.BearerToken) + - [BearerToken.Body](#service.BearerToken.Body) - [RequestMetaHeader](#service.RequestMetaHeader) - - [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) + - [ResponseMetaHeader](#service.ResponseMetaHeader) + - [SessionToken](#service.SessionToken) + - [SessionToken.Body](#service.SessionToken.Body) + - [TokenLifetime](#service.TokenLifetime) - [Version](#service.Version) + - [XHeader](#service.XHeader) - [service/verify.proto](#service/verify.proto) - Messages - - [BearerTokenMsg](#service.BearerTokenMsg) - - [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) - [RequestVerificationHeader](#service.RequestVerificationHeader) - - [SessionToken](#service.SessionToken) - - [SessionToken.Info](#service.SessionToken.Info) + - [ResponseVerificationHeader](#service.ResponseVerificationHeader) - [Signature](#service.Signature) - - [TokenLifetime](#service.TokenLifetime) - [Scalar Value Types](#scalar-value-types) @@ -36,28 +38,102 @@ + + +### Message BearerToken +BearerToken has information about request ACL rules with limited lifetime + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| token | [BearerToken.Body](#service.BearerToken.Body) | | Bearer Token body | +| signature | [Signature](#service.Signature) | | Signature of BearerToken body | + + + + +### Message BearerToken.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| eacl_table | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner | +| lifetime | [TokenLifetime](#service.TokenLifetime) | | Token expiration and valid time period parameters | + + ### Message RequestMetaHeader -RequestMetaHeader contains information about request meta headers. +Information about the request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ttl | [uint32](#uint32) | | Carries maximum number of nodes in the request route. | -| x_headers | [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) | repeated | Carries request X-Headers. | +| version | [Version](#service.Version) | | Client API version. | +| epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | +| ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | +| x_headers | [XHeader](#service.XHeader) | repeated | Request X-Headers. | +| token | [SessionToken](#service.SessionToken) | | Token is a token of the session within which the request is sent | +| bearer | [BearerToken](#service.BearerToken) | | Bearer is a Bearer token of the request | +| origin | [RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | - + -### Message RequestMetaHeader.XHeader +### Message ResponseMetaHeader +Information about the response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [Version](#service.Version) | | Server API version. | +| epoch | [uint64](#uint64) | | Server local epoch number. | +| ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | +| x_headers | [XHeader](#service.XHeader) | repeated | Response X-Headers. | +| origin | [ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta header of the origin response. | + + + + +### Message SessionToken +NeoFS session token. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| token | [SessionToken.Body](#service.SessionToken.Body) | | Session Token body | +| signature | [Signature](#service.Signature) | | Signature is a signature of session token information | + + + + +### Message SessionToken.Body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Carries key to the X-Header. | -| value | [string](#string) | | Carries value of the X-Header. | +| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session initiator. | +| verb | [SessionToken.Body.Verb](#service.SessionToken.Body.Verb) | | Verb is a type of request for which the token is issued | +| lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | +| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | +| object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | + + + + +### Message TokenLifetime +Lifetime parameters of the token. Filed names taken from rfc7519. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| exp | [uint64](#uint64) | | Expiration Epoch | +| nbf | [uint64](#uint64) | | Not valid before Epoch | +| iat | [uint64](#uint64) | | Issued at Epoch | @@ -71,8 +147,37 @@ Represents API version used by node. | major | [uint32](#uint32) | | Major API version. | | minor | [uint32](#uint32) | | Minor API version. | + + + +### Message XHeader + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | | Key of the X-Header. | +| value | [string](#string) | | Value of the X-Header. | + + + + +### SessionToken.Body.Verb +Verb is an enumeration of session request types + +| Name | Number | Description | +| ---- | ------ | ----------- | +| OBJECT_PUT | 0 | Refers to object.Put RPC call | +| OBJECT_GET | 1 | Refers to object.Get RPC call | +| OBJECT_HEAD | 2 | Refers to object.Head RPC call | +| OBJECT_SEARCH | 3 | Refers to object.Search RPC call | +| OBJECT_DELETE | 4 | Refers to object.Delete RPC call | +| OBJECT_RANGE | 5 | Refers to object.GetRange RPC call | +| OBJECT_RANGEHASH | 6 | Refers to object.GetRangeHash RPC call | + + @@ -86,79 +191,38 @@ Represents API version used by node. - - -### Message BearerTokenMsg -BearerTokenMsg carries information about request ACL rules with limited lifetime - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| token_info | [BearerTokenMsg.Info](#service.BearerTokenMsg.Info) | | token_info is a grouped information about token | -| owner_key | [bytes](#bytes) | | owner_key is a public key of the token owner | -| signature | [bytes](#bytes) | | Signature is a signature of token information | - - - - -### Message BearerTokenMsg.Info - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| eacl_table | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules. | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. | -| valid_until | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | - - ### Message RequestVerificationHeader -RequestVerificationHeader is a set of signatures of every NeoFS Node that -processed request. +Verification info for request signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| signatures | [Signature](#service.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | -| token | [SessionToken](#service.SessionToken) | | Token is a token of the session within which the request is sent | -| bearer | [BearerTokenMsg](#service.BearerTokenMsg) | | Bearer is a Bearer token of the request | +| body_signature | [Signature](#service.Signature) | | Request Body signature. Should be generated once by request initiator. | +| meta_signature | [Signature](#service.Signature) | | Request Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#service.Signature) | | Sign previous hops | +| origin | [RequestVerificationHeader](#service.RequestVerificationHeader) | | Chain of previous hops signatures | - + -### Message SessionToken -Represents the NeoFS session token. +### Message ResponseVerificationHeader +Verification info for response signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| token_info | [SessionToken.Info](#service.SessionToken.Info) | | token_info is a grouped information about token | -| signature | [bytes](#bytes) | | Signature is a signature of session token information | - - - - -### Message SessionToken.Info - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session initiator. | -| verb | [SessionToken.Info.Verb](#service.SessionToken.Info.Verb) | | Verb is a type of request for which the token is issued | -| lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | -| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| owner_key | [bytes](#bytes) | | OwnerKey is a public key of the token owner | -| object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | +| body_signature | [Signature](#service.Signature) | | Response Body signature. Should be generated once by answering node. | +| meta_signature | [Signature](#service.Signature) | | Response Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#service.Signature) | | Sign previous hops | +| origin | [ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Chain of previous hops signatures | ### Message Signature - +Signature of something in NeoFS | Field | Type | Label | Description | @@ -166,37 +230,8 @@ Represents the NeoFS session token. | key | [bytes](#bytes) | | Public key used for signing. | | sign | [bytes](#bytes) | | Signature | - - - -### Message TokenLifetime -TokenLifetime carries a group of lifetime parameters of the token - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| created | [uint64](#uint64) | | created carries an initial epoch of token lifetime | -| valid_until | [uint64](#uint64) | | valid_until carries a last epoch of token lifetime | - - - - -### SessionToken.Info.Verb -Verb is an enumeration of session request types - -| Name | Number | Description | -| ---- | ------ | ----------- | -| OBJECT_PUT | 0 | Refers to object.Put RPC call | -| OBJECT_GET | 1 | Refers to object.Get RPC call | -| OBJECT_HEAD | 2 | Refers to object.Head RPC call | -| OBJECT_SEARCH | 3 | Refers to object.Search RPC call | -| OBJECT_DELETE | 4 | Refers to object.Delete RPC call | -| OBJECT_RANGE | 5 | Refers to object.GetRange RPC call | -| OBJECT_RANGEHASH | 6 | Refers to object.GetRangeHash RPC call | - - diff --git a/proto-docs/session.md b/proto-docs/session.md index 09843e2..d1f6d6f 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -9,7 +9,9 @@ - Messages - [CreateRequest](#session.CreateRequest) + - [CreateRequest.Body](#session.CreateRequest.Body) - [CreateResponse](#session.CreateResponse) + - [CreateResponse.Body](#session.CreateResponse.Body) - [Scalar Value Types](#scalar-value-types) @@ -52,18 +54,42 @@ CreateRequest carries an information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | -| lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | +| body | [CreateRequest.Body](#session.CreateRequest.Body) | | Body of create session token request message. | | meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + +### Message CreateRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | +| lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | + + ### Message CreateResponse CreateResponse carries an information about the opened session. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [CreateResponse.Body](#session.CreateResponse.Body) | | Body of create session token response message. | +| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message CreateResponse.Body + + + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | id carries an identifier of session token. | From 35d1d34ee03015f0423c2a2df24bc82543f187a8 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 12 Aug 2020 19:04:15 +0300 Subject: [PATCH 159/440] [#45] Add buf linter call Signed-off-by: Stanislav Bogatyrev --- .gitignore | 4 ++-- Makefile | 39 ++++++++++++--------------------------- buf.yaml | 10 ++++++++++ 3 files changed, 24 insertions(+), 29 deletions(-) create mode 100644 buf.yaml diff --git a/.gitignore b/.gitignore index 1df644c..c6ef218 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -vendor -**/*.pb.go +.idea + diff --git a/Makefile b/Makefile index 6e78b17..76ee25b 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,21 @@ -NETMAP_VERSION=v1.7.0 -GOGOPROTO_VERSION=v1.3.1 +#!/usr/bin/make -f +SHELL=bash -NETMAP_URL=https://github.com/nspcc-dev/netmap/archive/$(NETMAP_VERSION).tar.gz -GOGOPROTO_URL=https://github.com/gogo/protobuf/archive/$(GOGOPROTO_VERSION).tar.gz +# BRanch to match for BRaking changes +BRBR?=master -.PHONY: deps docgen - -deps: - @echo "⇒ Prepare" - @rm -rf ./vendor/github.com/gogo/protobuf - @rm -rf ./vendor/github.com/nspcc-dev/netmap - @mkdir -p ./vendor/github.com/gogo/protobuf - @mkdir -p ./vendor/github.com/nspcc-dev/netmap - - @echo "⇒ Download" - @curl -sL -o ./vendor/gogo.tar.gz $(GOGOPROTO_URL) - @curl -sL -o ./vendor/netmap.tar.gz $(NETMAP_URL) - - @echo "⇒ Vendoring" - @tar -xzf ./vendor/gogo.tar.gz --strip-components 1 -C ./vendor/github.com/gogo/protobuf - @tar -xzf ./vendor/netmap.tar.gz --strip-components 1 -C ./vendor/github.com/nspcc-dev/netmap - - @echo "⇒ Cleanup" - @rm ./vendor/gogo.tar.gz - @rm ./vendor/netmap.tar.gz +.PHONY: lint +lint: + buf check lint + buf check breaking --against-input '.git#branch=$(BRBR)' +.PHONY: doc # Regenerate documentation for protot files: -docgen: deps - @for f in `find . -type f -name '*.proto' -not -path './vendor/*' -exec dirname {} \; | sort -u `; do \ +doc: + @for f in `find . -type f -name '*.proto' -exec dirname {} \; | sort -u `; do \ echo "${B}${G}⇒ Documentation for $$(basename $$f) ${R}"; \ protoc \ --doc_opt=.github/markdown.tmpl,$${f}.md \ - --proto_path=.:./vendor:/usr/local/include \ + --proto_path=.:/usr/local/include \ --doc_out=proto-docs/ $${f}/*.proto; \ done diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..2006bea --- /dev/null +++ b/buf.yaml @@ -0,0 +1,10 @@ +lint: + use: + - DEFAULT + - COMMENTS + - ENUM_FIRST_VALUE_ZERO + except: + - PACKAGE_DIRECTORY_MATCH + - PACKAGE_VERSION_SUFFIX + - ENUM_VALUE_PREFIX + - ENUM_ZERO_VALUE_SUFFIX From 42e35feffff8d2270e128f13bb78bfb7b018fe0e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 13 Aug 2020 00:43:51 +0300 Subject: [PATCH 160/440] [#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 --- Makefile | 2 +- accounting/service.proto | 22 ++--- acl/types.proto | 52 ++++++++--- container/service.proto | 106 +++++++++++++---------- container/types.proto | 13 ++- netmap/types.proto | 82 +++++++++++++----- object/service.proto | 183 ++++++++++++++++++++++++--------------- object/types.proto | 46 +++++++--- refs/types.proto | 6 +- service/meta.proto | 67 ++++++++++---- service/verify.proto | 6 +- session/service.proto | 24 ++--- storagegroup/types.proto | 8 +- 13 files changed, 393 insertions(+), 224 deletions(-) diff --git a/Makefile b/Makefile index 76ee25b..6daa283 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ #!/usr/bin/make -f SHELL=bash -# BRanch to match for BRaking changes +# BRanch to match for BReaking changes BRBR?=master .PHONY: lint diff --git a/accounting/service.proto b/accounting/service.proto index b276fdc..4afbcee 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package accounting; +package neo.fs.v2.accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/accounting"; -option csharp_namespace = "NeoFS.API.Accounting"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting;accounting"; +option csharp_namespace = "NeoFS.API.v2.Accounting"; import "refs/types.proto"; import "service/meta.proto"; @@ -11,7 +11,7 @@ import "service/verify.proto"; // The service provides methods for obtaining information // about the account balance in NeoFS system. -service Accounting { +service AccountingService { // Returns the amount of funds for the requested NeoFS account. rpc Balance (BalanceRequest) returns (BalanceResponse); } @@ -24,23 +24,23 @@ service Accounting { // To gain access to the requested information, the request body must be formed // according to the requirements from the system specification. message BalanceRequest { + //Request body message Body { // Carries user identifier in NeoFS system for which the balance // is requested. - refs.OwnerID owner_id = 1; + neo.fs.v2.refs.OwnerID owner_id = 1; } - // Body of the balance request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } // Decimal represents the decimal numbers. @@ -56,20 +56,20 @@ message Decimal { // // The amount of funds is calculated in decimal numbers. message BalanceResponse { + //Request body message Body { // Carries the amount of funds on the account. Decimal balance = 1; } - // Body of the balance response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } diff --git a/acl/types.proto b/acl/types.proto index 31731fd..ad7d778 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -1,16 +1,16 @@ syntax = "proto3"; -package acl; +package neo.fs.v2.acl; -option go_package = "github.com/nspcc-dev/neofs-api-go/acl"; -option csharp_namespace = "NeoFS.API.Acl"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl;acl"; +option csharp_namespace = "NeoFS.API.v2.Acl"; import "refs/types.proto"; // Target of the access control rule in access control list. enum Target { - // Unknown target, default value. - UNKNOWN = 0; + // Unspecified target, default value. + TARGET_UNSPECIFIED= 0; // User target rule is applied if sender is the owner of the container. USER = 1; @@ -27,13 +27,28 @@ enum Target { message EACLRecord { // Operation is an enumeration of operation types. enum Operation { - OPERATION_UNKNOWN = 0; + // Unspecified operation, default value. + OPERATION_UNSPECIFIED = 0; + + // Get GET = 1; + + // Head HEAD = 2; + + // Put PUT = 3; + + // Delete DELETE = 4; + + // Search SEARCH = 5; + + // GetRange GETRANGE = 6; + + // GetRangeHash GETRANGEHASH = 7; } @@ -42,8 +57,13 @@ message EACLRecord { // Action is an enumeration of EACL actions. enum Action { - ACTION_UNKNOWN = 0; + // Unspecified action, default value. + ACTION_UNSPECIFIED = 0; + + // Allow action ALLOW = 1; + + // Deny action DENY = 2; } @@ -54,8 +74,13 @@ message EACLRecord { message FilterInfo { // Header is an enumeration of filtering header types. enum Header { - HEADER_UNKNOWN = 0; + // Unspecified header, default value. + HEADER_UNSPECIFIED = 0; + + // Filter request headers REQUEST = 1; + + // Filter object headers OBJECT = 2; } @@ -64,11 +89,15 @@ message EACLRecord { // MatchType is an enumeration of match types. enum MatchType { - MATCH_UNKNOWN = 0; + // Unspecified match type, default value. + MATCH_TYPE_UNSPECIFIED = 0; + + // Return true if strings are equal STRING_EQUAL = 1; + + // Return true if strings are different STRING_NOT_EQUAL = 2; } - // MatchType carries type of match. MatchType match_type = 2 [json_name = "MatchType"]; @@ -90,7 +119,6 @@ message EACLRecord { // key_list carries public keys of ACL target. repeated bytes key_list = 2 [json_name="Keys"]; } - // targets carries information about extended ACL target list. repeated TargetInfo targets = 4 [json_name="Targets"]; } @@ -99,7 +127,7 @@ message EACLRecord { message EACLTable { // Carries identifier of the container that should use given // access control rules. - refs.ContainerID container_id = 1 [json_name="ContainerID"]; + neo.fs.v2.refs.ContainerID container_id = 1 [json_name="ContainerID"]; // Records carries list of extended ACL rule records. repeated EACLRecord records = 2 [json_name="Records"]; diff --git a/container/service.proto b/container/service.proto index dddb38c..c0712ea 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package container; +package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/container"; -option csharp_namespace = "NeoFS.API.Container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container"; +option csharp_namespace = "NeoFS.API.v2.Container"; import "acl/types.proto"; import "container/types.proto"; @@ -11,9 +11,9 @@ import "refs/types.proto"; import "service/meta.proto"; import "service/verify.proto"; -// Service provides API to access container smart-contract in morph chain +// ContainerService provides API to access container smart-contract in morph chain // via NeoFS node. -service Service { +service ContainerService { // Put invokes 'Put' method in container smart-contract and returns // response immediately. After new block in morph chain, request is verified // by inner ring nodes. After one more block in morph chain, container @@ -43,7 +43,9 @@ service Service { rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } +// New NeoFS Container creation request message PutRequest { + // Request body message Body { // Container to create in NeoFS. container.Container container = 1; @@ -55,138 +57,144 @@ message PutRequest { // Signature of stable-marshalled container according to RFC-6979. bytes signature = 3; } - // Body of container put request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// New NeoFS Container creation response message PutResponse { + // Response body message Body { // container_id carries identifier of the new container. - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; } - // Body of container put response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Container removal request message DeleteRequest { + // Request body message Body { // container_id carries identifier of the container to delete // from NeoFS. - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; // Signature of container id according to RFC-6979. bytes signature = 2; } - // Body of container delete request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because delete operation is asynchronous and done // via consensus in inner ring nodes message DeleteResponse { + // Response body message Body {} - // Body of container delete response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Get container structure message GetRequest { + // Request body message Body { // container_id carries identifier of the container to get. - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; } - // Body of container get request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Get container structure message GetResponse { + // Response body message Body { // Container that has been requested. - container.Container container = 1; + Container container = 1; } - // Body of container get response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// List containers message ListRequest { + // Request body message Body { // owner_id carries identifier of the container owner. - refs.OwnerID owner_id = 1; + neo.fs.v2.refs.OwnerID owner_id = 1; } - // Body of list containers request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// List containers message ListResponse { + // Response body message Body { // ContainerIDs carries list of identifiers of the containers that belong to the owner. repeated refs.ContainerID container_ids = 1; @@ -197,37 +205,40 @@ message ListResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Set Extended ACL message SetExtendedACLRequest { + // Request body message Body { // Extended ACL to set for the container. - acl.EACLTable eacl = 1; + neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. bytes signature = 2; } - // Body of set extended acl request message. Body body = 1; // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Set Extended ACL message SetExtendedACLResponse { + // Response body message Body { } // Body of set extended acl response message. @@ -235,18 +246,20 @@ message SetExtendedACLResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Get Extended ACL message GetExtendedACLRequest { + // Request body message Body { // container_id carries identifier of the container that has Extended ACL. - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; } // Body of get extended acl request message. @@ -254,32 +267,33 @@ message GetExtendedACLRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Get Extended ACL message GetExtendedACLResponse { + // Response body message Body { // Extended ACL that has been requested if it was set up. - acl.EACLTable eacl = 1; + neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. bytes signature = 2; } - // Body of get extended acl response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } diff --git a/container/types.proto b/container/types.proto index 572c141..10e374a 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package container; +package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/container"; -option csharp_namespace = "NeoFS.API.Container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container"; +option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; import "refs/types.proto"; @@ -14,7 +14,7 @@ import "refs/types.proto"; // SHA256 hash of stable-marshalled container message. message Container { // OwnerID carries identifier of the container owner. - refs.OwnerID owner_id = 1; + neo.fs.v2.refs.OwnerID owner_id = 1; // Nonce is a 16 byte UUID, used to avoid collisions of container id. bytes nonce = 2; @@ -31,10 +31,9 @@ message Container { // Value of immutable container attribute. string value = 2; } - // Attributes define any immutable characteristics of container. repeated Attribute attributes = 4; - // Rules define storage policy for the object inside the container. - netmap.PlacementRule rules = 5; + // Placement policy for the object inside the container. + neo.fs.v2.netmap.PlacementPolicy placement_policy = 5; } diff --git a/netmap/types.proto b/netmap/types.proto index 44866d2..37fadaf 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -1,84 +1,118 @@ syntax = "proto3"; -package netmap; +package neo.fs.v2.netmap; -option go_package = "github.com/nspcc-dev/neofs-api-go/netmap"; -option csharp_namespace = "NeoFS.API.Netmap"; +option go_package = "github.com/nspcc-dev/neofs-api-go/netmap;netmap"; +option csharp_namespace = "NeoFS.API.v2.Netmap"; -message PlacementRule { +// Set of rules to select a subset of nodes able to store container's objects +message PlacementPolicy { + // Replication factor uint32 repl_factor = 1; - message SFGroup { + // Filters to apply to Network Map + message FilterGroup { + // Filter definition message Filter { + // Filter identifier string key = 1; - message SimpleFilters { - repeated SimpleFilter filters = 1; - } - + // Minimal simple filter message SimpleFilter { + // Filtering operation enum Operation { - NP = 0; + // No Operation defined + OPERATION_UNSPECIFIED= 0; + + // Equal EQ = 1; + + // Not Equal NE = 2; + + // Greater then GT = 3; + + // Greater or equal GE = 4; + + // Less then LT = 5; + + // Less or equal LE = 6; + + // Logical OR OR = 7; + + // Logical AND AND = 8; } - + // Filtering operation Operation op = 1; + // List of filters + message SimpleFilters { + // List of filters + repeated SimpleFilter filters = 1; + } + + // Filtering operation argument oneof args { + // Value string value = 2; + // Result of other filter application SimpleFilters f_args = 3; } } - + // The rest of filter SimpleFilter f = 2; } + // Resulting filter list repeated Filter filters = 1; + // Selector message Selector { + // How many to select uint32 count = 1; + // Key to select string key = 2; } + // List of selectors repeated Selector selectors = 2; + // Parts of graph to exclude. Internal use. repeated uint32 exclude = 3; } - - repeated SFGroup sf_groups = 2; + // List of filter groups + repeated FilterGroup filter_groups = 2; } -// Groups the information about the NeoFS node. +// NeoFS node description message NodeInfo { - // Carries network address of the NeoFS node. + // Ways to connect to a node string address = 1; - // Carries public key of the NeoFS node in a binary format. + // Public key of the NeoFS node in a binary format. bytes public_key = 2; - // Groups attributes of the NeoFS node. + // Attributes of the NeoFS node. message Attribute { - // Carries string key to the node attribute. + // Key of the node attribute. string key = 1; - // Carries string value of the node attribute. + // Value of the node attribute. string value = 2; } - // Carries list of the NeoFS node attributes in a string key-value format. repeated Attribute attributes = 3; // Represents the enumeration of various states of the NeoFS node. enum State { - // Undefined state. - UNKNOWN = 0; + // Unknown state. + UNSPECIFIED = 0; // Active state in the network. ONLINE = 1; @@ -89,4 +123,4 @@ message NodeInfo { // Carries state of the NeoFS node. State state = 4; -} \ No newline at end of file +} diff --git a/object/service.proto b/object/service.proto index df5d6ab..04ecb1f 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package object; +package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/object"; -option csharp_namespace = "NeoFS.API.Object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object;object"; +option csharp_namespace = "NeoFS.API.v2.Object"; import "object/types.proto"; import "refs/types.proto"; @@ -11,7 +11,7 @@ import "service/meta.proto"; import "service/verify.proto"; // Object service provides API for manipulating with the object. -service Service { +service ObjectService { // Get the object from container. Response uses gRPC stream. First response // message carry object of requested address. Chunk messages are parts of // the object's payload if it is needed. All messages except first carry @@ -52,10 +52,12 @@ service Service { rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } +// Get object request message GetRequest { + // Request body message Body { // Address of the requested object. - refs.Address address = 1; + neo.fs.v2.refs.Address address = 1; // Carries the raw option flag of the request. // Raw request is sent to receive only the objects @@ -67,21 +69,25 @@ message GetRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// get object response message GetResponse { + // Response body message Body { // Initialization parameters of the object got from NeoFS. message Init { // Object ID - refs.ObjectID object_id = 1; + neo.fs.v2.refs.ObjectID object_id = 1; + // Object signature - service.Signature signature =2; + neo.fs.v2.service.Signature signature =2; + // Object header. Header header = 3; } @@ -89,6 +95,7 @@ message GetResponse { oneof object_part { // Initialization parameters of the object stream. Init init =1; + // Part of the object payload. bytes chunk = 2; } @@ -98,34 +105,39 @@ message GetResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Put object request message PutRequest { + // Request body message Body { // Groups initialization parameters of object placement in NeoFS. message Init { // Object ID, where available - refs.ObjectID object_id = 1; + neo.fs.v2.refs.ObjectID object_id = 1; + // Object signature, were available - service.Signature signature =2; + neo.fs.v2.service.Signature signature =2; + // Header of the object to save in the system. Header header = 3; + // Number of the object copies to store within the RPC call. // Default zero value is processed according to the // container placement rules. uint32 copies_number = 4; } - // Carries the single part of the query stream. oneof object_part { // Carries the initialization parameters of the object stream. Init init = 1; + // Carries part of the object payload. bytes chunk = 2; } @@ -135,54 +147,60 @@ message PutRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Put object response message PutResponse { + // Response body message Body { // Carries identifier of the saved object. // It is used to access an object in the container. - refs.ObjectID object_id = 1; + neo.fs.v2.refs.ObjectID object_id = 1; } // Body of put object response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Object Delete request message DeleteRequest { + // Request body message Body { // Carries the address of the object to be deleted. - refs.Address address = 1; + neo.fs.v2.refs.Address address = 1; + // Carries identifier the object owner. - refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2; } // Body of delete object request message. Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because we cannot guarantee permanent object removal // in distributed system. message DeleteResponse { + // Response body message Body { } // Body of delete object response message. @@ -190,20 +208,24 @@ message DeleteResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Object head request message HeadRequest { + // Request body message Body { // Address of the object with the requested header. - refs.Address address = 1; + neo.fs.v2.refs.Address address = 1; + // Return only minimal header subset bool main_only = 2; + // Carries the raw option flag of the request. // Raw request is sent to receive only the headers of the objects // that are physically stored on the server. @@ -214,31 +236,41 @@ message HeadRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Head response message HeadResponse { + // Response body message Body { + // Short header fields message ShortHeader { // Object format version. - service.Version version = 1; + neo.fs.v2.service.Version version = 1; + // Epoch when the object was created uint64 creation_epoch = 2; + // Object's owner - refs.OwnerID owner_id = 3; + neo.fs.v2.refs.OwnerID owner_id = 3; + // Type of the object payload content ObjectType object_type = 4; + // Size of payload in bytes. // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown uint64 payload_length = 5; } // Carries the requested object header or it's part oneof head{ + // Full object header Header header = 1; + + // Short object header ShortHeader short_header = 2; } } @@ -247,70 +279,74 @@ message HeadResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Search objects request message SearchRequest { + // Request body message Body { // Carries search container identifier. - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; - message Query { - uint32 version = 1; - - message Filter { - enum MatchType { - MATCH_UNKNOWN = 0; - STRING_EQUAL = 1; - } - - MatchType match_type = 1; - - string name = 2; - - string value = 3; + // Version of the Query Language used + uint32 version = 2; + // Filter structure + message Filter { + // Type of match expression + enum MatchType { + // Unknown. Not used + MATCH_TYPE_UNSPECIFIED = 0; + // Full string match + STRING_EQUAL = 1; } + // Match type to use + MatchType match_type = 1; - repeated Filter filters = 2; + // Header name to match + string name = 2; + + // Header value to match + string value = 3; } - - Query query = 2; + // List of search expressions + repeated Filter filters = 3; } - // Body of search object request message. Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Search response message SearchResponse { + // Response body message Body { - // Carries list of object identifiers that match the search query. - repeated refs.ObjectID id_list = 1; + // Carries list of object identifiers that match the search query + repeated neo.fs.v2.refs.ObjectID id_list = 1; } - // Body of search object response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } // Range groups the parameters of object payload range. @@ -322,10 +358,12 @@ message Range { uint64 length = 2; } +// Request to get part of object's payload message GetRangeRequest { + // Request Body message Body { // Address carries address of the object that contains the requested payload range. - refs.Address address = 1; + neo.fs.v2.refs.Address address = 1; // Range carries the parameters of the requested payload range. Range range = 2; @@ -336,14 +374,16 @@ message GetRangeRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Get part of object's payload message GetRangeResponse { + // Response body message Body { // Carries part of the object payload. bytes chunk = 1; @@ -354,18 +394,20 @@ message GetRangeResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } +// Get hash of object's payload part message GetRangeHashRequest { + // Request body message Body { // Carries address of the object that contains the requested payload range. - refs.Address address = 1; + neo.fs.v2.refs.Address address = 1; // Carries the list of object payload range to calculate homomorphic hash. repeated Range ranges = 2; @@ -373,35 +415,34 @@ message GetRangeHashRequest { // Carries binary salt to XOR object payload ranges before hash calculation. bytes salt = 3; } - // Body of get range hash object request message. Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } +// Get hash of object's payload part message GetRangeHashResponse { + // Response body message Body { // Carries list of homomorphic hashes in a binary format. repeated bytes hash_list = 1; } - // Body of get range hash object response message. Body body = 1; // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } - diff --git a/object/types.proto b/object/types.proto index 3ec02cb..05f4571 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package object; +package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/object"; -option csharp_namespace = "NeoFS.API.Object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object;object"; +option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; import "service/meta.proto"; @@ -13,33 +13,45 @@ import "service/verify.proto"; enum ObjectType { // Just a normal object REGULAR = 0; + // Used internally to identify deleted objects TOMBSTONE = 1; + // Identifies that the object holds StorageGroup information STORAGE_GROUP = 2; } +// Object Headers message Header { // Object's container - refs.ContainerID container_id = 1; + neo.fs.v2.refs.ContainerID container_id = 1; + // Object's owner - refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2; + // Epoch when the object was created uint64 creation_epoch = 3; + // Object format version. // Effectively the version of API library used to create particular object - service.Version version = 4; + neo.fs.v2.service.Version version = 4; + // Size of payload in bytes. // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown uint64 payload_length = 5; + // Hash of payload bytes bytes payload_hash = 6; + + // Special object type ObjectType object_type = 7; + // Homomorphic hash of the object payload. bytes homomorphic_hash = 8; + // Session token, if it was used during Object creation. // Need it to verify integrity and authenticity out of Request scope. - service.SessionToken session_token = 9; + neo.fs.v2.service.SessionToken session_token = 9; // Attribute groups the user-defined Key-Value pairs attached to the object message Attribute { @@ -48,6 +60,7 @@ message Header { // string value of the object attribute string value = 2; } + // User-defined object attributes repeated Attribute attributes = 10; // Information about spawning the objects through a payload splitting. @@ -55,15 +68,19 @@ message Header { // Identifier of the origin object. // Parent and children objects must be within the same container. // Parent object_id is known only to the minor child. - refs.ObjectID parent = 1; + neo.fs.v2.refs.ObjectID parent = 1; + // Previous carries identifier of the left split neighbor. - refs.ObjectID previous = 2; + neo.fs.v2.refs.ObjectID previous = 2; + // `signature` field of the parent object. Used to reconstruct parent. - service.Signature parent_signature = 3; + neo.fs.v2.service.Signature parent_signature = 3; + // `header` field of the parent object. Used to reconstruct parent. Header parent_header = 4; + // Children carries list of identifiers of the objects generated by splitting the current. - repeated refs.ObjectID children = 5; + repeated neo.fs.v2.refs.ObjectID children = 5; } // Position of the object in the split hierarchy. Split split = 11; @@ -75,11 +92,14 @@ message Object { // Object is content-addressed. It means id will change if header or payload // changes. It's calculated as a hash of header field, which contains hash of // object's payload - refs.ObjectID object_id = 1; + neo.fs.v2.refs.ObjectID object_id = 1; + // Signed object_id - service.Signature signature = 2; + neo.fs.v2.service.Signature signature = 2; + // Object metadata headers Header header = 3; + // Payload bytes. bytes payload = 4; } diff --git a/refs/types.proto b/refs/types.proto index 0b5fcff..1ffb033 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package refs; +package neo.fs.v2.refs; -option go_package = "github.com/nspcc-dev/neofs-api-go/refs"; -option csharp_namespace = "NeoFS.API.Refs"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs;refs"; +option csharp_namespace = "NeoFS.API.v2.Refs"; // Address of object (container id + object id) message Address { diff --git a/service/meta.proto b/service/meta.proto index 2e51d92..e74a606 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -1,17 +1,19 @@ syntax = "proto3"; -package service; +package neo.fs.v2.service; -option go_package = "github.com/nspcc-dev/neofs-api-go/service"; -option csharp_namespace = "NeoFS.API.Service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service"; +option csharp_namespace = "NeoFS.API.v2.Service"; import "acl/types.proto"; import "refs/types.proto"; import "service/verify.proto"; +// Extended headers for Request/Response message XHeader { // Key of the X-Header. string key = 1; + // Value of the X-Header. string value = 2; } @@ -20,6 +22,7 @@ message XHeader { message Version { // Major API version. uint32 major = 1; + // Minor API version. uint32 minor = 2; } @@ -28,50 +31,67 @@ message Version { message TokenLifetime { // Expiration Epoch uint64 exp = 1; + // Not valid before Epoch uint64 nbf = 2; + // Issued at Epoch uint64 iat = 3; } // NeoFS session token. message SessionToken { + // Session token body message Body { // ID is a token identifier. valid UUIDv4 represented in bytes bytes id = 1; + // OwnerID carries identifier of the session initiator. - refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2; + // Verb is an enumeration of session request types enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; + // Refers to object.Put RPC call - OBJECT_PUT = 0; + OBJECT_PUT = 1; + // Refers to object.Get RPC call - OBJECT_GET = 1; + OBJECT_GET = 2; + // Refers to object.Head RPC call - OBJECT_HEAD = 2; + OBJECT_HEAD = 3; + // Refers to object.Search RPC call - OBJECT_SEARCH = 3; + OBJECT_SEARCH = 4; + // Refers to object.Delete RPC call - OBJECT_DELETE = 4; + OBJECT_DELETE = 5; + // Refers to object.GetRange RPC call - OBJECT_RANGE = 5; + OBJECT_RANGE = 6; + // Refers to object.GetRangeHash RPC call - OBJECT_RANGEHASH = 6; + OBJECT_RANGEHASH = 7; } // Verb is a type of request for which the token is issued Verb verb = 3; + // Lifetime is a lifetime of the session TokenLifetime lifetime = 4; + // SessionKey is a public key of session key bytes session_key = 5; + // Carries context of the session. oneof context { // object_address represents the object session context. - refs.Address object_address = 6; + neo.fs.v2.refs.Address object_address = 6; } } // Session Token body - Body token = 1; + Body body = 1; // Signature is a signature of session token information Signature signature = 2; @@ -79,16 +99,19 @@ message SessionToken { // BearerToken has information about request ACL rules with limited lifetime message BearerToken { + // Bearer Token body message Body { // EACLTable carries table of extended ACL rules - acl.EACLTable eacl_table = 1; + neo.fs.v2.acl.EACLTable eacl_table = 1; + // OwnerID carries identifier of the token owner - refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2; + // Token expiration and valid time period parameters TokenLifetime lifetime = 3; } // Bearer Token body - Body token = 1; + Body body = 1; // Signature of BearerToken body Signature signature = 2; @@ -98,16 +121,21 @@ message BearerToken { message RequestMetaHeader { // Client API version. Version version = 1; + // Client local epoch number. Set to 0 if unknown. uint64 epoch = 2; + // Maximum number of nodes in the request route. uint32 ttl = 3; + // Request X-Headers. repeated XHeader x_headers = 4; + // Token is a token of the session within which the request is sent - SessionToken token = 5; + SessionToken session_token = 5; + // Bearer is a Bearer token of the request - BearerToken bearer = 6; + BearerToken bearer_token = 6; // RequestMetaHeader of the origin request. RequestMetaHeader origin = 7; @@ -117,10 +145,13 @@ message RequestMetaHeader { message ResponseMetaHeader { // Server API version. Version version = 1; + // Server local epoch number. uint64 epoch = 2; + // Maximum number of nodes in the response route. uint32 ttl = 3; + // Response X-Headers. repeated XHeader x_headers = 4; diff --git a/service/verify.proto b/service/verify.proto index 0c8e39f..77745c6 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package service; +package neo.fs.v2.service; -option go_package = "github.com/nspcc-dev/neofs-api-go/service"; -option csharp_namespace = "NeoFS.API.Service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service"; +option csharp_namespace = "NeoFS.API.v2.Service"; import "acl/types.proto"; import "refs/types.proto"; diff --git a/session/service.proto b/session/service.proto index 6227800..94281a7 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,43 +1,45 @@ syntax = "proto3"; -package session; +package neo.fs.v2.session; -option go_package = "github.com/nspcc-dev/neofs-api-go/session"; -option csharp_namespace = "NeoFS.API.Session"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session;session"; +option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; import "service/meta.proto"; import "service/verify.proto"; -service Session { +// Create Session record on Node side +service SessionService { // Create opens new session between the client and the server. rpc Create (CreateRequest) returns (CreateResponse); } // CreateRequest carries an information necessary for opening a session. message CreateRequest { + // Request body message Body { // Carries an identifier of a session initiator. - refs.OwnerID owner_id = 1; + neo.fs.v2.refs.OwnerID owner_id = 1; // Carries a lifetime of the session. - service.TokenLifetime lifetime = 2; + neo.fs.v2.service.TokenLifetime lifetime = 2; } - // Body of create session token request message. Body body = 1; // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - service.RequestMetaHeader meta_header = 2; + neo.fs.v2.service.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } // CreateResponse carries an information about the opened session. message CreateResponse { + // Response body message Body { // id carries an identifier of session token. bytes id = 1; @@ -51,10 +53,10 @@ message CreateResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.service.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; } diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 20b5425..94cefc3 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -1,9 +1,9 @@ syntax = "proto3"; -package storagegroup; +package neo.fs.v2.storagegroup; -option go_package = "github.com/nspcc-dev/neofs-api-go/storagegroup"; -option csharp_namespace = "NeoFS.API.StorageGroup"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup;storagegroup"; +option csharp_namespace = "NeoFS.API.v2.StorageGroup"; import "refs/types.proto"; @@ -26,5 +26,5 @@ message StorageGroup { // Members carries the list of identifiers of the object storage group members. // The list is strictly ordered. - repeated refs.ObjectID members = 4; + repeated neo.fs.v2.refs.ObjectID members = 4; } From eb61f7cafd0718b6f28e638c069b1d6d18974d52 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 13 Aug 2020 19:18:53 +0300 Subject: [PATCH 161/440] [#45] docs: Regenerate Markdown docs Signed-off-by: Stanislav Bogatyrev --- proto-docs/accounting.md | 48 ++--- proto-docs/acl.md | 80 +++---- proto-docs/container.md | 268 +++++++++++------------ proto-docs/netmap.md | 126 +++++------ proto-docs/object.md | 426 ++++++++++++++++++------------------- proto-docs/refs.md | 20 +- proto-docs/service.md | 125 +++++------ proto-docs/session.md | 46 ++-- proto-docs/storagegroup.md | 6 +- 9 files changed, 567 insertions(+), 578 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 3184254..147046a 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -5,14 +5,14 @@ - [accounting/service.proto](#accounting/service.proto) - Services - - [Accounting](#accounting.Accounting) + - [AccountingService](#neo.fs.v2.accounting.AccountingService) - Messages - - [BalanceRequest](#accounting.BalanceRequest) - - [BalanceRequest.Body](#accounting.BalanceRequest.Body) - - [BalanceResponse](#accounting.BalanceResponse) - - [BalanceResponse.Body](#accounting.BalanceResponse.Body) - - [Decimal](#accounting.Decimal) + - [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) + - [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) + - [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) + - [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) + - [Decimal](#neo.fs.v2.accounting.Decimal) - [Scalar Value Types](#scalar-value-types) @@ -27,9 +27,9 @@ - + -### Service "accounting.Accounting" +### Service "neo.fs.v2.accounting.AccountingService" The service provides methods for obtaining information about the account balance in NeoFS system. @@ -44,11 +44,11 @@ Returns the amount of funds for the requested NeoFS account. | Name | Input | Output | | ---- | ----- | ------ | -| Balance | [BalanceRequest](#accounting.BalanceRequest) | [BalanceResponse](#accounting.BalanceResponse) | +| Balance | [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) | [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) | - + ### Message BalanceRequest Message defines the request body of Balance method. @@ -62,23 +62,23 @@ according to the requirements from the system specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [BalanceRequest.Body](#accounting.BalanceRequest.Body) | | Body of the balance request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) | | Body of the balance request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message BalanceRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | - + ### Message BalanceResponse Message defines the response body of Balance method. @@ -88,23 +88,23 @@ The amount of funds is calculated in decimal numbers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [BalanceResponse.Body](#accounting.BalanceResponse.Body) | | Body of the balance response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) | | Body of the balance response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message BalanceResponse.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| balance | [Decimal](#accounting.Decimal) | | Carries the amount of funds on the account. | +| balance | [Decimal](#neo.fs.v2.accounting.Decimal) | | Carries the amount of funds on the account. | - + ### Message Decimal Decimal represents the decimal numbers. diff --git a/proto-docs/acl.md b/proto-docs/acl.md index c550c30..b2adaf6 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -6,10 +6,10 @@ - [acl/types.proto](#acl/types.proto) - Messages - - [EACLRecord](#acl.EACLRecord) - - [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) - - [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) - - [EACLTable](#acl.EACLTable) + - [EACLRecord](#neo.fs.v2.acl.EACLRecord) + - [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) + - [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) + - [EACLTable](#neo.fs.v2.acl.EACLTable) - [Scalar Value Types](#scalar-value-types) @@ -25,7 +25,7 @@ - + ### Message EACLRecord EACLRecord groups information about extended ACL rule. @@ -33,13 +33,13 @@ EACLRecord groups information about extended ACL rule. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| operation | [EACLRecord.Operation](#acl.EACLRecord.Operation) | | Operation carries type of operation. | -| action | [EACLRecord.Action](#acl.EACLRecord.Action) | | Action carries ACL target action. | -| filters | [EACLRecord.FilterInfo](#acl.EACLRecord.FilterInfo) | repeated | filters carries set of filters. | -| targets | [EACLRecord.TargetInfo](#acl.EACLRecord.TargetInfo) | repeated | targets carries information about extended ACL target list. | +| operation | [EACLRecord.Operation](#neo.fs.v2.acl.EACLRecord.Operation) | | Operation carries type of operation. | +| action | [EACLRecord.Action](#neo.fs.v2.acl.EACLRecord.Action) | | Action carries ACL target action. | +| filters | [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) | repeated | filters carries set of filters. | +| targets | [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) | repeated | targets carries information about extended ACL target list. | - + ### Message EACLRecord.FilterInfo FilterInfo groups information about filter. @@ -47,13 +47,13 @@ FilterInfo groups information about filter. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [EACLRecord.FilterInfo.Header](#acl.EACLRecord.FilterInfo.Header) | | Header carries type of header. | -| match_type | [EACLRecord.FilterInfo.MatchType](#acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | +| header | [EACLRecord.FilterInfo.Header](#neo.fs.v2.acl.EACLRecord.FilterInfo.Header) | | Header carries type of header. | +| match_type | [EACLRecord.FilterInfo.MatchType](#neo.fs.v2.acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | | header_name | [string](#string) | | header_name carries name of filtering header. | | header_val | [string](#string) | | header_val carries value of filtering header. | - + ### Message EACLRecord.TargetInfo TargetInfo groups information about extended ACL target. @@ -61,11 +61,11 @@ TargetInfo groups information about extended ACL target. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| target | [Target](#acl.Target) | | target carries target of ACL rule. | +| target | [Target](#neo.fs.v2.acl.Target) | | target carries target of ACL rule. | | key_list | [bytes](#bytes) | repeated | key_list carries public keys of ACL target. | - + ### Message EACLTable EACLRecord carries the information about extended ACL rules. @@ -73,77 +73,77 @@ EACLRecord carries the information about extended ACL rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | -| records | [EACLRecord](#acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | +| records | [EACLRecord](#neo.fs.v2.acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | - + ### EACLRecord.Action Action is an enumeration of EACL actions. | Name | Number | Description | | ---- | ------ | ----------- | -| ACTION_UNKNOWN | 0 | | -| ALLOW | 1 | | -| DENY | 2 | | +| ACTION_UNSPECIFIED | 0 | Unspecified action, default value. | +| ALLOW | 1 | Allow action | +| DENY | 2 | Deny action | - + ### EACLRecord.FilterInfo.Header Header is an enumeration of filtering header types. | Name | Number | Description | | ---- | ------ | ----------- | -| HEADER_UNKNOWN | 0 | | -| REQUEST | 1 | | -| OBJECT | 2 | | +| HEADER_UNSPECIFIED | 0 | Unspecified header, default value. | +| REQUEST | 1 | Filter request headers | +| OBJECT | 2 | Filter object headers | - + ### EACLRecord.FilterInfo.MatchType MatchType is an enumeration of match types. | Name | Number | Description | | ---- | ------ | ----------- | -| MATCH_UNKNOWN | 0 | | -| STRING_EQUAL | 1 | | -| STRING_NOT_EQUAL | 2 | | +| MATCH_TYPE_UNSPECIFIED | 0 | Unspecified match type, default value. | +| STRING_EQUAL | 1 | Return true if strings are equal | +| STRING_NOT_EQUAL | 2 | Return true if strings are different | - + ### EACLRecord.Operation Operation is an enumeration of operation types. | Name | Number | Description | | ---- | ------ | ----------- | -| OPERATION_UNKNOWN | 0 | | -| GET | 1 | | -| HEAD | 2 | | -| PUT | 3 | | -| DELETE | 4 | | -| SEARCH | 5 | | -| GETRANGE | 6 | | -| GETRANGEHASH | 7 | | +| OPERATION_UNSPECIFIED | 0 | Unspecified operation, default value. | +| GET | 1 | Get | +| HEAD | 2 | Head | +| PUT | 3 | Put | +| DELETE | 4 | Delete | +| SEARCH | 5 | Search | +| GETRANGE | 6 | GetRange | +| GETRANGEHASH | 7 | GetRangeHash | - + ### Target Target of the access control rule in access control list. | Name | Number | Description | | ---- | ------ | ----------- | -| UNKNOWN | 0 | Unknown target, default value. | +| TARGET_UNSPECIFIED | 0 | Unspecified target, default value. | | USER | 1 | User target rule is applied if sender is the owner of the container. | | SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | | OTHERS | 3 | Others target rule is applied if sender is not user or system target. | diff --git a/proto-docs/container.md b/proto-docs/container.md index ff5e3c5..8ed1b00 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -5,40 +5,40 @@ - [container/service.proto](#container/service.proto) - Services - - [Service](#container.Service) + - [ContainerService](#neo.fs.v2.container.ContainerService) - Messages - - [DeleteRequest](#container.DeleteRequest) - - [DeleteRequest.Body](#container.DeleteRequest.Body) - - [DeleteResponse](#container.DeleteResponse) - - [DeleteResponse.Body](#container.DeleteResponse.Body) - - [GetExtendedACLRequest](#container.GetExtendedACLRequest) - - [GetExtendedACLRequest.Body](#container.GetExtendedACLRequest.Body) - - [GetExtendedACLResponse](#container.GetExtendedACLResponse) - - [GetExtendedACLResponse.Body](#container.GetExtendedACLResponse.Body) - - [GetRequest](#container.GetRequest) - - [GetRequest.Body](#container.GetRequest.Body) - - [GetResponse](#container.GetResponse) - - [GetResponse.Body](#container.GetResponse.Body) - - [ListRequest](#container.ListRequest) - - [ListRequest.Body](#container.ListRequest.Body) - - [ListResponse](#container.ListResponse) - - [ListResponse.Body](#container.ListResponse.Body) - - [PutRequest](#container.PutRequest) - - [PutRequest.Body](#container.PutRequest.Body) - - [PutResponse](#container.PutResponse) - - [PutResponse.Body](#container.PutResponse.Body) - - [SetExtendedACLRequest](#container.SetExtendedACLRequest) - - [SetExtendedACLRequest.Body](#container.SetExtendedACLRequest.Body) - - [SetExtendedACLResponse](#container.SetExtendedACLResponse) - - [SetExtendedACLResponse.Body](#container.SetExtendedACLResponse.Body) + - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) + - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) + - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) + - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) + - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) + - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) + - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) + - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) + - [GetRequest](#neo.fs.v2.container.GetRequest) + - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) + - [GetResponse](#neo.fs.v2.container.GetResponse) + - [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) + - [ListRequest](#neo.fs.v2.container.ListRequest) + - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) + - [ListResponse](#neo.fs.v2.container.ListResponse) + - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) + - [PutRequest](#neo.fs.v2.container.PutRequest) + - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) + - [PutResponse](#neo.fs.v2.container.PutResponse) + - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) + - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) + - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) + - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) + - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) - [container/types.proto](#container/types.proto) - Messages - - [Container](#container.Container) - - [Container.Attribute](#container.Container.Attribute) + - [Container](#neo.fs.v2.container.Container) + - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) - [Scalar Value Types](#scalar-value-types) @@ -53,10 +53,10 @@ - + -### Service "container.Service" -Service provides API to access container smart-contract in morph chain +### Service "neo.fs.v2.container.ContainerService" +ContainerService provides API to access container smart-contract in morph chain via NeoFS node. ``` @@ -78,7 +78,7 @@ added into smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | -| Put | [PutRequest](#container.PutRequest) | [PutResponse](#container.PutResponse) | +| Put | [PutRequest](#neo.fs.v2.container.PutRequest) | [PutResponse](#neo.fs.v2.container.PutResponse) | #### Method Delete Delete invokes 'Delete' method in container smart-contract and returns @@ -88,14 +88,14 @@ removed from smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | -| Delete | [DeleteRequest](#container.DeleteRequest) | [DeleteResponse](#container.DeleteResponse) | +| Delete | [DeleteRequest](#neo.fs.v2.container.DeleteRequest) | [DeleteResponse](#neo.fs.v2.container.DeleteResponse) | #### Method Get Get returns container from container smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | -| Get | [GetRequest](#container.GetRequest) | [GetResponse](#container.GetResponse) | +| Get | [GetRequest](#neo.fs.v2.container.GetRequest) | [GetResponse](#neo.fs.v2.container.GetResponse) | #### Method List List returns all owner's containers from container smart-contract @@ -103,7 +103,7 @@ storage. | Name | Input | Output | | ---- | ----- | ------ | -| List | [ListRequest](#container.ListRequest) | [ListResponse](#container.ListResponse) | +| List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) | #### Method SetExtendedACL SetExtendedACL invokes 'SetEACL' method in container smart-contract and @@ -112,7 +112,7 @@ Extended ACL added into smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | -| SetExtendedACL | [SetExtendedACLRequest](#container.SetExtendedACLRequest) | [SetExtendedACLResponse](#container.SetExtendedACLResponse) | +| SetExtendedACL | [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) | [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) | #### Method GetExtendedACL GetExtendedACL returns Extended ACL table and signature from container @@ -120,36 +120,36 @@ smart-contract storage. | Name | Input | Output | | ---- | ----- | ------ | -| GetExtendedACL | [GetExtendedACLRequest](#container.GetExtendedACLRequest) | [GetExtendedACLResponse](#container.GetExtendedACLResponse) | +| GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) | - + ### Message DeleteRequest - +Container removal request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [DeleteRequest.Body](#container.DeleteRequest.Body) | | Body of container delete request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) | | Body of container delete request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message DeleteRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | | signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | - + ### Message DeleteResponse DeleteResponse is empty because delete operation is asynchronous and done @@ -158,255 +158,255 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [DeleteResponse.Body](#container.DeleteResponse.Body) | | Body of container delete response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) | | Body of container delete response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message DeleteResponse.Body +Response body - - + ### Message GetExtendedACLRequest - +Get Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetExtendedACLRequest.Body](#container.GetExtendedACLRequest.Body) | | Body of get extended acl request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) | | Body of get extended acl request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetExtendedACLRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container that has Extended ACL. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container that has Extended ACL. | - + ### Message GetExtendedACLResponse - +Get Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetExtendedACLResponse.Body](#container.GetExtendedACLResponse.Body) | | Body of get extended acl response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) | | Body of get extended acl response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetExtendedACLResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL that has been requested if it was set up. | +| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL that has been requested if it was set up. | | signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | - + ### Message GetRequest - +Get container structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRequest.Body](#container.GetRequest.Body) | | Body of container get request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) | | Body of container get request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the container to get. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to get. | - + ### Message GetResponse - +Get container structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetResponse.Body](#container.GetResponse.Body) | | Body of container get response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) | | Body of container get response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container | [Container](#container.Container) | | Container that has been requested. | +| container | [Container](#neo.fs.v2.container.Container) | | Container that has been requested. | - + ### Message ListRequest - +List containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [ListRequest.Body](#container.ListRequest.Body) | | Body of list containers request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) | | Body of list containers request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message ListRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | owner_id carries identifier of the container owner. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | owner_id carries identifier of the container owner. | - + ### Message ListResponse - +List containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [ListResponse.Body](#container.ListResponse.Body) | | Body of list containers response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) | | Body of list containers response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message ListResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_ids | [refs.ContainerID](#refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | +| container_ids | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | - + ### Message PutRequest - +New NeoFS Container creation request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [PutRequest.Body](#container.PutRequest.Body) | | Body of container put request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) | | Body of container put request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message PutRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container | [Container](#container.Container) | | Container to create in NeoFS. | +| container | [Container](#neo.fs.v2.container.Container) | | Container to create in NeoFS. | | public_key | [bytes](#bytes) | | Public Key of container owner. It can be public key of the owner or it can be public key that bound in neofs.id smart-contract. | | signature | [bytes](#bytes) | | Signature of stable-marshalled container according to RFC-6979. | - + ### Message PutResponse - +New NeoFS Container creation response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [PutResponse.Body](#container.PutResponse.Body) | | Body of container put response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) | | Body of container put response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message PutResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | container_id carries identifier of the new container. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the new container. | - + ### Message SetExtendedACLRequest - +Set Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SetExtendedACLRequest.Body](#container.SetExtendedACLRequest.Body) | | Body of set extended acl request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) | | Body of set extended acl request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message SetExtendedACLRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl | [acl.EACLTable](#acl.EACLTable) | | Extended ACL to set for the container. | +| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL to set for the container. | | signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | - + ### Message SetExtendedACLResponse - +Set Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SetExtendedACLResponse.Body](#container.SetExtendedACLResponse.Body) | | Body of set extended acl response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) | | Body of set extended acl response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message SetExtendedACLResponse.Body - +Response body @@ -424,7 +424,7 @@ via consensus in inner ring nodes - + ### Message Container Container is a structure that defines object placement behaviour. Objects @@ -435,14 +435,14 @@ SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the container owner. | | nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | basic_acl | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | -| attributes | [Container.Attribute](#container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | -| rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | +| attributes | [Container.Attribute](#neo.fs.v2.container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | +| placement_policy | [neo.fs.v2.netmap.PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) | | Placement policy for the object inside the container. | - + ### Message Container.Attribute Attribute is a key-value pair of strings. diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 459c42e..d375b12 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -6,14 +6,14 @@ - [netmap/types.proto](#netmap/types.proto) - Messages - - [NodeInfo](#netmap.NodeInfo) - - [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) - - [PlacementRule](#netmap.PlacementRule) - - [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) - - [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) - - [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) - - [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) - - [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) + - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) + - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) + - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) + - [PlacementPolicy.FilterGroup](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup) + - [PlacementPolicy.FilterGroup.Filter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter) + - [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) + - [PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters) + - [PlacementPolicy.FilterGroup.Selector](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Selector) - [Scalar Value Types](#scalar-value-types) @@ -29,136 +29,136 @@ - + ### Message NodeInfo -Groups the information about the NeoFS node. +NeoFS node description | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [string](#string) | | Carries network address of the NeoFS node. | -| public_key | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | -| attributes | [NodeInfo.Attribute](#netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | -| state | [NodeInfo.State](#netmap.NodeInfo.State) | | Carries state of the NeoFS node. | +| address | [string](#string) | | Ways to connect to a node | +| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format. | +| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | +| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node. | - + ### Message NodeInfo.Attribute -Groups attributes of the NeoFS node. +Attributes of the NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Carries string key to the node attribute. | -| value | [string](#string) | | Carries string value of the node attribute. | +| key | [string](#string) | | Key of the node attribute. | +| value | [string](#string) | | Value of the node attribute. | - - -### Message PlacementRule + +### Message PlacementPolicy +Set of rules to select a subset of nodes able to store container's objects | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| repl_factor | [uint32](#uint32) | | | -| sf_groups | [PlacementRule.SFGroup](#netmap.PlacementRule.SFGroup) | repeated | | +| repl_factor | [uint32](#uint32) | | Replication factor | +| filter_groups | [PlacementPolicy.FilterGroup](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup) | repeated | List of filter groups | - - -### Message PlacementRule.SFGroup + +### Message PlacementPolicy.FilterGroup +Filters to apply to Network Map | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| filters | [PlacementRule.SFGroup.Filter](#netmap.PlacementRule.SFGroup.Filter) | repeated | | -| selectors | [PlacementRule.SFGroup.Selector](#netmap.PlacementRule.SFGroup.Selector) | repeated | | -| exclude | [uint32](#uint32) | repeated | | +| filters | [PlacementPolicy.FilterGroup.Filter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter) | repeated | Resulting filter list | +| selectors | [PlacementPolicy.FilterGroup.Selector](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Selector) | repeated | List of selectors | +| exclude | [uint32](#uint32) | repeated | Parts of graph to exclude. Internal use. | - - -### Message PlacementRule.SFGroup.Filter + +### Message PlacementPolicy.FilterGroup.Filter +Filter definition | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | | -| f | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | | | +| key | [string](#string) | | Filter identifier | +| f | [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) | | The rest of filter | - - -### Message PlacementRule.SFGroup.Filter.SimpleFilter + +### Message PlacementPolicy.FilterGroup.Filter.SimpleFilter +Minimal simple filter | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| op | [PlacementRule.SFGroup.Filter.SimpleFilter.Operation](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter.Operation) | | | -| value | [string](#string) | | | -| f_args | [PlacementRule.SFGroup.Filter.SimpleFilters](#netmap.PlacementRule.SFGroup.Filter.SimpleFilters) | | | +| op | [PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation) | | Filtering operation | +| value | [string](#string) | | Value | +| f_args | [PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters) | | Result of other filter application | - - -### Message PlacementRule.SFGroup.Filter.SimpleFilters + +### Message PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters +List of filters | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| filters | [PlacementRule.SFGroup.Filter.SimpleFilter](#netmap.PlacementRule.SFGroup.Filter.SimpleFilter) | repeated | | +| filters | [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) | repeated | List of filters | - - -### Message PlacementRule.SFGroup.Selector + +### Message PlacementPolicy.FilterGroup.Selector +Selector | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| count | [uint32](#uint32) | | | -| key | [string](#string) | | | +| count | [uint32](#uint32) | | How many to select | +| key | [string](#string) | | Key to select | - + ### NodeInfo.State Represents the enumeration of various states of the NeoFS node. | Name | Number | Description | | ---- | ------ | ----------- | -| UNKNOWN | 0 | Undefined state. | +| UNSPECIFIED | 0 | Unknown state. | | ONLINE | 1 | Active state in the network. | | OFFLINE | 2 | Network unavailable state. | - - -### PlacementRule.SFGroup.Filter.SimpleFilter.Operation + +### PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation +Filtering operation | Name | Number | Description | | ---- | ------ | ----------- | -| NP | 0 | | -| EQ | 1 | | -| NE | 2 | | -| GT | 3 | | -| GE | 4 | | -| LT | 5 | | -| LE | 6 | | -| OR | 7 | | -| AND | 8 | | +| OPERATION_UNSPECIFIED | 0 | No Operation defined | +| EQ | 1 | Equal | +| NE | 2 | Not Equal | +| GT | 3 | Greater then | +| GE | 4 | Greater or equal | +| LT | 5 | Less then | +| LE | 6 | Less or equal | +| OR | 7 | Logical OR | +| AND | 8 | Logical AND | diff --git a/proto-docs/object.md b/proto-docs/object.md index 0e0633e..94fc650 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -5,52 +5,51 @@ - [object/service.proto](#object/service.proto) - Services - - [Service](#object.Service) + - [ObjectService](#neo.fs.v2.object.ObjectService) - Messages - - [DeleteRequest](#object.DeleteRequest) - - [DeleteRequest.Body](#object.DeleteRequest.Body) - - [DeleteResponse](#object.DeleteResponse) - - [DeleteResponse.Body](#object.DeleteResponse.Body) - - [GetRangeHashRequest](#object.GetRangeHashRequest) - - [GetRangeHashRequest.Body](#object.GetRangeHashRequest.Body) - - [GetRangeHashResponse](#object.GetRangeHashResponse) - - [GetRangeHashResponse.Body](#object.GetRangeHashResponse.Body) - - [GetRangeRequest](#object.GetRangeRequest) - - [GetRangeRequest.Body](#object.GetRangeRequest.Body) - - [GetRangeResponse](#object.GetRangeResponse) - - [GetRangeResponse.Body](#object.GetRangeResponse.Body) - - [GetRequest](#object.GetRequest) - - [GetRequest.Body](#object.GetRequest.Body) - - [GetResponse](#object.GetResponse) - - [GetResponse.Body](#object.GetResponse.Body) - - [GetResponse.Body.Init](#object.GetResponse.Body.Init) - - [HeadRequest](#object.HeadRequest) - - [HeadRequest.Body](#object.HeadRequest.Body) - - [HeadResponse](#object.HeadResponse) - - [HeadResponse.Body](#object.HeadResponse.Body) - - [HeadResponse.Body.ShortHeader](#object.HeadResponse.Body.ShortHeader) - - [PutRequest](#object.PutRequest) - - [PutRequest.Body](#object.PutRequest.Body) - - [PutRequest.Body.Init](#object.PutRequest.Body.Init) - - [PutResponse](#object.PutResponse) - - [PutResponse.Body](#object.PutResponse.Body) - - [Range](#object.Range) - - [SearchRequest](#object.SearchRequest) - - [SearchRequest.Body](#object.SearchRequest.Body) - - [SearchRequest.Body.Query](#object.SearchRequest.Body.Query) - - [SearchRequest.Body.Query.Filter](#object.SearchRequest.Body.Query.Filter) - - [SearchResponse](#object.SearchResponse) - - [SearchResponse.Body](#object.SearchResponse.Body) + - [DeleteRequest](#neo.fs.v2.object.DeleteRequest) + - [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) + - [DeleteResponse](#neo.fs.v2.object.DeleteResponse) + - [DeleteResponse.Body](#neo.fs.v2.object.DeleteResponse.Body) + - [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) + - [GetRangeHashRequest.Body](#neo.fs.v2.object.GetRangeHashRequest.Body) + - [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) + - [GetRangeHashResponse.Body](#neo.fs.v2.object.GetRangeHashResponse.Body) + - [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) + - [GetRangeRequest.Body](#neo.fs.v2.object.GetRangeRequest.Body) + - [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) + - [GetRangeResponse.Body](#neo.fs.v2.object.GetRangeResponse.Body) + - [GetRequest](#neo.fs.v2.object.GetRequest) + - [GetRequest.Body](#neo.fs.v2.object.GetRequest.Body) + - [GetResponse](#neo.fs.v2.object.GetResponse) + - [GetResponse.Body](#neo.fs.v2.object.GetResponse.Body) + - [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) + - [HeadRequest](#neo.fs.v2.object.HeadRequest) + - [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) + - [HeadResponse](#neo.fs.v2.object.HeadResponse) + - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) + - [HeadResponse.Body.ShortHeader](#neo.fs.v2.object.HeadResponse.Body.ShortHeader) + - [PutRequest](#neo.fs.v2.object.PutRequest) + - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) + - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) + - [PutResponse](#neo.fs.v2.object.PutResponse) + - [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) + - [Range](#neo.fs.v2.object.Range) + - [SearchRequest](#neo.fs.v2.object.SearchRequest) + - [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) + - [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) + - [SearchResponse](#neo.fs.v2.object.SearchResponse) + - [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) - [object/types.proto](#object/types.proto) - Messages - - [Header](#object.Header) - - [Header.Attribute](#object.Header.Attribute) - - [Header.Split](#object.Header.Split) - - [Object](#object.Object) + - [Header](#neo.fs.v2.object.Header) + - [Header.Attribute](#neo.fs.v2.object.Header.Attribute) + - [Header.Split](#neo.fs.v2.object.Header.Split) + - [Object](#neo.fs.v2.object.Object) - [Scalar Value Types](#scalar-value-types) @@ -65,9 +64,9 @@ - + -### Service "object.Service" +### Service "neo.fs.v2.object.ObjectService" Object service provides API for manipulating with the object. ``` @@ -91,7 +90,7 @@ message payload and all chunks keeping receiving order. | Name | Input | Output | | ---- | ----- | ------ | -| Get | [GetRequest](#object.GetRequest) | [GetResponse](#object.GetResponse) | +| Get | [GetRequest](#neo.fs.v2.object.GetRequest) | [GetResponse](#neo.fs.v2.object.GetResponse) | #### Method Put Put the object into container. Request uses gRPC stream. First message @@ -103,14 +102,14 @@ SHOULD BE sent in direct order of fragmentation. | Name | Input | Output | | ---- | ----- | ------ | -| Put | [PutRequest](#object.PutRequest) | [PutResponse](#object.PutResponse) | +| Put | [PutRequest](#neo.fs.v2.object.PutRequest) | [PutResponse](#neo.fs.v2.object.PutResponse) | #### Method Delete Delete the object from a container | Name | Input | Output | | ---- | ----- | ------ | -| Delete | [DeleteRequest](#object.DeleteRequest) | [DeleteResponse](#object.DeleteResponse) | +| Delete | [DeleteRequest](#neo.fs.v2.object.DeleteRequest) | [DeleteResponse](#neo.fs.v2.object.DeleteResponse) | #### Method Head Head returns the object without data payload. Object in the @@ -119,7 +118,7 @@ headers are also present. | Name | Input | Output | | ---- | ----- | ------ | -| Head | [HeadRequest](#object.HeadRequest) | [HeadResponse](#object.HeadResponse) | +| Head | [HeadRequest](#neo.fs.v2.object.HeadRequest) | [HeadResponse](#neo.fs.v2.object.HeadResponse) | #### Method Search Search objects in container. Version of query language format SHOULD BE @@ -128,7 +127,7 @@ package). | Name | Input | Output | | ---- | ----- | ------ | -| Search | [SearchRequest](#object.SearchRequest) | [SearchResponse](#object.SearchResponse) | +| Search | [SearchRequest](#neo.fs.v2.object.SearchRequest) | [SearchResponse](#neo.fs.v2.object.SearchResponse) | #### Method GetRange GetRange of data payload. Range is a pair (offset, length). @@ -137,7 +136,7 @@ keeping receiving order. | Name | Input | Output | | ---- | ----- | ------ | -| GetRange | [GetRangeRequest](#object.GetRangeRequest) | [GetRangeResponse](#object.GetRangeResponse) | +| GetRange | [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) | [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) | #### Method GetRangeHash GetRangeHash returns homomorphic hash of object payload range after XOR @@ -147,36 +146,36 @@ calculated for XORed data. | Name | Input | Output | | ---- | ----- | ------ | -| GetRangeHash | [GetRangeHashRequest](#object.GetRangeHashRequest) | [GetRangeHashResponse](#object.GetRangeHashResponse) | +| GetRangeHash | [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) | [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) | - + ### Message DeleteRequest - +Object Delete request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [DeleteRequest.Body](#object.DeleteRequest.Body) | | Body of delete object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) | | Body of delete object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message DeleteRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Carries the address of the object to be deleted. | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries identifier the object owner. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries the address of the object to be deleted. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries identifier the object owner. | - + ### Message DeleteResponse DeleteResponse is empty because we cannot guarantee permanent object removal @@ -185,61 +184,61 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [DeleteResponse.Body](#object.DeleteResponse.Body) | | Body of delete object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [DeleteResponse.Body](#neo.fs.v2.object.DeleteResponse.Body) | | Body of delete object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message DeleteResponse.Body +Response body - - + ### Message GetRangeHashRequest - +Get hash of object's payload part | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRangeHashRequest.Body](#object.GetRangeHashRequest.Body) | | Body of get range hash object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRangeHashRequest.Body](#neo.fs.v2.object.GetRangeHashRequest.Body) | | Body of get range hash object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRangeHashRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Carries address of the object that contains the requested payload range. | -| ranges | [Range](#object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries address of the object that contains the requested payload range. | +| ranges | [Range](#neo.fs.v2.object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | | salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | - + ### Message GetRangeHashResponse - +Get hash of object's payload part | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRangeHashResponse.Body](#object.GetRangeHashResponse.Body) | | Body of get range hash object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRangeHashResponse.Body](#neo.fs.v2.object.GetRangeHashResponse.Body) | | Body of get range hash object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRangeHashResponse.Body - +Response body | Field | Type | Label | Description | @@ -247,48 +246,48 @@ in distributed system. | hash_list | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | - + ### Message GetRangeRequest - +Request to get part of object's payload | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRangeRequest.Body](#object.GetRangeRequest.Body) | | Body of get range object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRangeRequest.Body](#neo.fs.v2.object.GetRangeRequest.Body) | | Body of get range object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRangeRequest.Body - +Request Body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Address carries address of the object that contains the requested payload range. | -| range | [Range](#object.Range) | | Range carries the parameters of the requested payload range. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address carries address of the object that contains the requested payload range. | +| range | [Range](#neo.fs.v2.object.Range) | | Range carries the parameters of the requested payload range. | - + ### Message GetRangeResponse - +Get part of object's payload | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRangeResponse.Body](#object.GetRangeResponse.Body) | | Body of get range object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRangeResponse.Body](#neo.fs.v2.object.GetRangeResponse.Body) | | Body of get range object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRangeResponse.Body - +Response body | Field | Type | Label | Description | @@ -296,57 +295,57 @@ in distributed system. | chunk | [bytes](#bytes) | | Carries part of the object payload. | - + ### Message GetRequest - +Get object request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetRequest.Body](#object.GetRequest.Body) | | Body of get object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetRequest.Body](#neo.fs.v2.object.GetRequest.Body) | | Body of get object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Address of the requested object. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the requested object. | | raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | - + ### Message GetResponse - +get object response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [GetResponse.Body](#object.GetResponse.Body) | | Body of get object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [GetResponse.Body](#neo.fs.v2.object.GetResponse.Body) | | Body of get object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message GetResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| init | [GetResponse.Body.Init](#object.GetResponse.Body.Init) | | Initialization parameters of the object stream. | +| init | [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) | | Initialization parameters of the object stream. | | chunk | [bytes](#bytes) | | Part of the object payload. | - + ### Message GetResponse.Body.Init Initialization parameters of the object got from NeoFS. @@ -354,103 +353,103 @@ Initialization parameters of the object got from NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [refs.ObjectID](#refs.ObjectID) | | Object ID | -| signature | [service.Signature](#service.Signature) | | Object signature | -| header | [Header](#object.Header) | | Object header. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Object signature | +| header | [Header](#neo.fs.v2.object.Header) | | Object header. | - + ### Message HeadRequest - +Object head request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [HeadRequest.Body](#object.HeadRequest.Body) | | Body of head object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) | | Body of head object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message HeadRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [refs.Address](#refs.Address) | | Address of the object with the requested header. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object with the requested header. | | main_only | [bool](#bool) | | Return only minimal header subset | | raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | - + ### Message HeadResponse - +Head response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [HeadResponse.Body](#object.HeadResponse.Body) | | Body of head object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) | | Body of head object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message HeadResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#object.Header) | | | -| short_header | [HeadResponse.Body.ShortHeader](#object.HeadResponse.Body.ShortHeader) | | | +| header | [Header](#neo.fs.v2.object.Header) | | Full object header | +| short_header | [HeadResponse.Body.ShortHeader](#neo.fs.v2.object.HeadResponse.Body.ShortHeader) | | Short object header | - + ### Message HeadResponse.Body.ShortHeader - +Short header fields | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [service.Version](#service.Version) | | Object format version. | +| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Object's owner | -| object_type | [ObjectType](#object.ObjectType) | | Type of the object payload content | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | +| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | | payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | - + ### Message PutRequest - +Put object request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [PutRequest.Body](#object.PutRequest.Body) | | Body of put object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) | | Body of put object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message PutRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| init | [PutRequest.Body.Init](#object.PutRequest.Body.Init) | | Carries the initialization parameters of the object stream. | +| init | [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) | | Carries the initialization parameters of the object stream. | | chunk | [bytes](#bytes) | | Carries part of the object payload. | - + ### Message PutRequest.Body.Init Groups initialization parameters of object placement in NeoFS. @@ -458,37 +457,37 @@ Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [refs.ObjectID](#refs.ObjectID) | | Object ID, where available | -| signature | [service.Signature](#service.Signature) | | Object signature, were available | -| header | [Header](#object.Header) | | Header of the object to save in the system. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID, where available | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Object signature, were available | +| header | [Header](#neo.fs.v2.object.Header) | | Header of the object to save in the system. | | copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | - + ### Message PutResponse - +Put object response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [PutResponse.Body](#object.PutResponse.Body) | | Body of put object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) | | Body of put object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message PutResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [refs.ObjectID](#refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | - + ### Message Range Range groups the parameters of object payload range. @@ -500,91 +499,80 @@ Range groups the parameters of object payload range. | length | [uint64](#uint64) | | Carries the length of the object payload range. | - + ### Message SearchRequest - +Search objects request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SearchRequest.Body](#object.SearchRequest.Body) | | Body of search object request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) | | Body of search object request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message SearchRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | Carries search container identifier. | -| query | [SearchRequest.Body.Query](#object.SearchRequest.Body.Query) | | | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Carries search container identifier. | +| version | [uint32](#uint32) | | Version of the Query Language used | +| filters | [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) | repeated | List of search expressions | - - -### Message SearchRequest.Body.Query + +### Message SearchRequest.Body.Filter +Filter structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [uint32](#uint32) | | | -| filters | [SearchRequest.Body.Query.Filter](#object.SearchRequest.Body.Query.Filter) | repeated | | +| match_type | [SearchRequest.Body.Filter.MatchType](#neo.fs.v2.object.SearchRequest.Body.Filter.MatchType) | | Match type to use | +| name | [string](#string) | | Header name to match | +| value | [string](#string) | | Header value to match | - - -### Message SearchRequest.Body.Query.Filter - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| match_type | [SearchRequest.Body.Query.Filter.MatchType](#object.SearchRequest.Body.Query.Filter.MatchType) | | | -| name | [string](#string) | | | -| value | [string](#string) | | | - - - + ### Message SearchResponse - +Search response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SearchResponse.Body](#object.SearchResponse.Body) | | Body of search object response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) | | Body of search object response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message SearchResponse.Body - +Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id_list | [refs.ObjectID](#refs.ObjectID) | repeated | Carries list of object identifiers that match the search query. | +| id_list | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Carries list of object identifiers that match the search query | - - -### SearchRequest.Body.Query.Filter.MatchType + +### SearchRequest.Body.Filter.MatchType +Type of match expression | Name | Number | Description | | ---- | ------ | ----------- | -| MATCH_UNKNOWN | 0 | | -| STRING_EQUAL | 1 | | +| MATCH_TYPE_UNSPECIFIED | 0 | Unknown. Not used | +| STRING_EQUAL | 1 | Full string match | @@ -600,28 +588,28 @@ Range groups the parameters of object payload range. - + ### Message Header - +Object Headers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [refs.ContainerID](#refs.ContainerID) | | Object's container | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Object's owner | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | -| version | [service.Version](#service.Version) | | Object format version. Effectively the version of API library used to create particular object | +| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. Effectively the version of API library used to create particular object | | payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | | payload_hash | [bytes](#bytes) | | Hash of payload bytes | -| object_type | [ObjectType](#object.ObjectType) | | | +| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | | homomorphic_hash | [bytes](#bytes) | | Homomorphic hash of the object payload. | -| session_token | [service.SessionToken](#service.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | -| attributes | [Header.Attribute](#object.Header.Attribute) | repeated | | -| split | [Header.Split](#object.Header.Split) | | Position of the object in the split hierarchy. | +| session_token | [neo.fs.v2.service.SessionToken](#neo.fs.v2.service.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | +| attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | +| split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy. | - + ### Message Header.Attribute Attribute groups the user-defined Key-Value pairs attached to the object @@ -633,7 +621,7 @@ Attribute groups the user-defined Key-Value pairs attached to the object | value | [string](#string) | | string value of the object attribute | - + ### Message Header.Split Information about spawning the objects through a payload splitting. @@ -641,14 +629,14 @@ Information about spawning the objects through a payload splitting. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| parent | [refs.ObjectID](#refs.ObjectID) | | Identifier of the origin object. Parent and children objects must be within the same container. Parent object_id is known only to the minor child. | -| previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. | -| parent_signature | [service.Signature](#service.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | -| parent_header | [Header](#object.Header) | | `header` field of the parent object. Used to reconstruct parent. | -| children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | +| parent | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the origin object. Parent and children objects must be within the same container. Parent object_id is known only to the minor child. | +| previous | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Previous carries identifier of the left split neighbor. | +| parent_signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | +| parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | +| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | - + ### Message Object Object structure. @@ -656,15 +644,15 @@ Object structure. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [refs.ObjectID](#refs.ObjectID) | | Object's unique identifier. Object is content-addressed. It means id will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload | -| signature | [service.Signature](#service.Signature) | | Signed object_id | -| header | [Header](#object.Header) | | Object metadata headers | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. Object is content-addressed. It means id will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signed object_id | +| header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | | payload | [bytes](#bytes) | | Payload bytes. | - + ### ObjectType Type of the object payload content diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 1b87449..103c3e9 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -6,10 +6,10 @@ - [refs/types.proto](#refs/types.proto) - Messages - - [Address](#refs.Address) - - [ContainerID](#refs.ContainerID) - - [ObjectID](#refs.ObjectID) - - [OwnerID](#refs.OwnerID) + - [Address](#neo.fs.v2.refs.Address) + - [ContainerID](#neo.fs.v2.refs.ContainerID) + - [ObjectID](#neo.fs.v2.refs.ObjectID) + - [OwnerID](#neo.fs.v2.refs.OwnerID) - [Scalar Value Types](#scalar-value-types) @@ -25,7 +25,7 @@ - + ### Message Address Address of object (container id + object id) @@ -33,11 +33,11 @@ Address of object (container id + object id) | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [ContainerID](#refs.ContainerID) | | container_id carries container identifier. | -| object_id | [ObjectID](#refs.ObjectID) | | object_id carries object identifier. | +| container_id | [ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries container identifier. | +| object_id | [ObjectID](#neo.fs.v2.refs.ObjectID) | | object_id carries object identifier. | - + ### Message ContainerID NeoFS container identifier. @@ -48,7 +48,7 @@ NeoFS container identifier. | value | [bytes](#bytes) | | value carries the container identifier in a binary format. | - + ### Message ObjectID NeoFS object identifier. @@ -59,7 +59,7 @@ NeoFS object identifier. | value | [bytes](#bytes) | | value carries the object identifier in a binary format. | - + ### Message OwnerID OwnerID group information about the owner of the NeoFS container. diff --git a/proto-docs/service.md b/proto-docs/service.md index 6f9c9e8..3d01579 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,23 +6,23 @@ - [service/meta.proto](#service/meta.proto) - Messages - - [BearerToken](#service.BearerToken) - - [BearerToken.Body](#service.BearerToken.Body) - - [RequestMetaHeader](#service.RequestMetaHeader) - - [ResponseMetaHeader](#service.ResponseMetaHeader) - - [SessionToken](#service.SessionToken) - - [SessionToken.Body](#service.SessionToken.Body) - - [TokenLifetime](#service.TokenLifetime) - - [Version](#service.Version) - - [XHeader](#service.XHeader) + - [BearerToken](#neo.fs.v2.service.BearerToken) + - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) + - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) + - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) + - [SessionToken](#neo.fs.v2.service.SessionToken) + - [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) + - [TokenLifetime](#neo.fs.v2.service.TokenLifetime) + - [Version](#neo.fs.v2.service.Version) + - [XHeader](#neo.fs.v2.service.XHeader) - [service/verify.proto](#service/verify.proto) - Messages - - [RequestVerificationHeader](#service.RequestVerificationHeader) - - [ResponseVerificationHeader](#service.ResponseVerificationHeader) - - [Signature](#service.Signature) + - [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) + - [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) + - [Signature](#neo.fs.v2.service.Signature) - [Scalar Value Types](#scalar-value-types) @@ -38,7 +38,7 @@ - + ### Message BearerToken BearerToken has information about request ACL rules with limited lifetime @@ -46,24 +46,24 @@ BearerToken has information about request ACL rules with limited lifetime | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| token | [BearerToken.Body](#service.BearerToken.Body) | | Bearer Token body | -| signature | [Signature](#service.Signature) | | Signature of BearerToken body | +| body | [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) | | Bearer Token body | +| signature | [Signature](#neo.fs.v2.service.Signature) | | Signature of BearerToken body | - + ### Message BearerToken.Body - +Bearer Token body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl_table | [acl.EACLTable](#acl.EACLTable) | | EACLTable carries table of extended ACL rules | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner | -| lifetime | [TokenLifetime](#service.TokenLifetime) | | Token expiration and valid time period parameters | +| eacl_table | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | EACLTable carries table of extended ACL rules | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the token owner | +| lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Token expiration and valid time period parameters | - + ### Message RequestMetaHeader Information about the request @@ -71,16 +71,16 @@ Information about the request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [Version](#service.Version) | | Client API version. | +| version | [Version](#neo.fs.v2.service.Version) | | Client API version. | | epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | | ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | -| x_headers | [XHeader](#service.XHeader) | repeated | Request X-Headers. | -| token | [SessionToken](#service.SessionToken) | | Token is a token of the session within which the request is sent | -| bearer | [BearerToken](#service.BearerToken) | | Bearer is a Bearer token of the request | -| origin | [RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | +| x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Request X-Headers. | +| session_token | [SessionToken](#neo.fs.v2.service.SessionToken) | | Token is a token of the session within which the request is sent | +| bearer_token | [BearerToken](#neo.fs.v2.service.BearerToken) | | Bearer is a Bearer token of the request | +| origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | - + ### Message ResponseMetaHeader Information about the response @@ -88,14 +88,14 @@ Information about the response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [Version](#service.Version) | | Server API version. | +| version | [Version](#neo.fs.v2.service.Version) | | Server API version. | | epoch | [uint64](#uint64) | | Server local epoch number. | | ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | -| x_headers | [XHeader](#service.XHeader) | repeated | Response X-Headers. | -| origin | [ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta header of the origin response. | +| x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Response X-Headers. | +| origin | [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta header of the origin response. | - + ### Message SessionToken NeoFS session token. @@ -103,27 +103,27 @@ NeoFS session token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| token | [SessionToken.Body](#service.SessionToken.Body) | | Session Token body | -| signature | [Signature](#service.Signature) | | Signature is a signature of session token information | +| body | [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) | | Session Token body | +| signature | [Signature](#neo.fs.v2.service.Signature) | | Signature is a signature of session token information | - + ### Message SessionToken.Body - +Session token body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the session initiator. | -| verb | [SessionToken.Body.Verb](#service.SessionToken.Body.Verb) | | Verb is a type of request for which the token is issued | -| lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | +| verb | [SessionToken.Body.Verb](#neo.fs.v2.service.SessionToken.Body.Verb) | | Verb is a type of request for which the token is issued | +| lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| object_address | [refs.Address](#refs.Address) | | object_address represents the object session context. | +| object_address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | object_address represents the object session context. | - + ### Message TokenLifetime Lifetime parameters of the token. Filed names taken from rfc7519. @@ -136,7 +136,7 @@ Lifetime parameters of the token. Filed names taken from rfc7519. | iat | [uint64](#uint64) | | Issued at Epoch | - + ### Message Version Represents API version used by node. @@ -148,10 +148,10 @@ Represents API version used by node. | minor | [uint32](#uint32) | | Minor API version. | - + ### Message XHeader - +Extended headers for Request/Response | Field | Type | Label | Description | @@ -162,20 +162,21 @@ Represents API version used by node. - + ### SessionToken.Body.Verb Verb is an enumeration of session request types | Name | Number | Description | | ---- | ------ | ----------- | -| OBJECT_PUT | 0 | Refers to object.Put RPC call | -| OBJECT_GET | 1 | Refers to object.Get RPC call | -| OBJECT_HEAD | 2 | Refers to object.Head RPC call | -| OBJECT_SEARCH | 3 | Refers to object.Search RPC call | -| OBJECT_DELETE | 4 | Refers to object.Delete RPC call | -| OBJECT_RANGE | 5 | Refers to object.GetRange RPC call | -| OBJECT_RANGEHASH | 6 | Refers to object.GetRangeHash RPC call | +| VERB_UNSPECIFIED | 0 | Unknown verb | +| OBJECT_PUT | 1 | Refers to object.Put RPC call | +| OBJECT_GET | 2 | Refers to object.Get RPC call | +| OBJECT_HEAD | 3 | Refers to object.Head RPC call | +| OBJECT_SEARCH | 4 | Refers to object.Search RPC call | +| OBJECT_DELETE | 5 | Refers to object.Delete RPC call | +| OBJECT_RANGE | 6 | Refers to object.GetRange RPC call | +| OBJECT_RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | @@ -191,7 +192,7 @@ Verb is an enumeration of session request types - + ### Message RequestVerificationHeader Verification info for request signed by all intermediate nodes @@ -199,13 +200,13 @@ Verification info for request signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#service.Signature) | | Request Body signature. Should be generated once by request initiator. | -| meta_signature | [Signature](#service.Signature) | | Request Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#service.Signature) | | Sign previous hops | -| origin | [RequestVerificationHeader](#service.RequestVerificationHeader) | | Chain of previous hops signatures | +| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. | +| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures | - + ### Message ResponseVerificationHeader Verification info for response signed by all intermediate nodes @@ -213,13 +214,13 @@ Verification info for response signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#service.Signature) | | Response Body signature. Should be generated once by answering node. | -| meta_signature | [Signature](#service.Signature) | | Response Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#service.Signature) | | Sign previous hops | -| origin | [ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Chain of previous hops signatures | +| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. | +| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures | - + ### Message Signature Signature of something in NeoFS diff --git a/proto-docs/session.md b/proto-docs/session.md index d1f6d6f..63a695d 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -5,13 +5,13 @@ - [session/service.proto](#session/service.proto) - Services - - [Session](#session.Session) + - [SessionService](#neo.fs.v2.session.SessionService) - Messages - - [CreateRequest](#session.CreateRequest) - - [CreateRequest.Body](#session.CreateRequest.Body) - - [CreateResponse](#session.CreateResponse) - - [CreateResponse.Body](#session.CreateResponse.Body) + - [CreateRequest](#neo.fs.v2.session.CreateRequest) + - [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) + - [CreateResponse](#neo.fs.v2.session.CreateResponse) + - [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) - [Scalar Value Types](#scalar-value-types) @@ -26,10 +26,10 @@ - - -### Service "session.Session" + +### Service "neo.fs.v2.session.SessionService" +Create Session record on Node side ``` rpc Create(CreateRequest) returns (CreateResponse); @@ -42,11 +42,11 @@ Create opens new session between the client and the server. | Name | Input | Output | | ---- | ----- | ------ | -| Create | [CreateRequest](#session.CreateRequest) | [CreateResponse](#session.CreateResponse) | +| Create | [CreateRequest](#neo.fs.v2.session.CreateRequest) | [CreateResponse](#neo.fs.v2.session.CreateResponse) | - + ### Message CreateRequest CreateRequest carries an information necessary for opening a session. @@ -54,24 +54,24 @@ CreateRequest carries an information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [CreateRequest.Body](#session.CreateRequest.Body) | | Body of create session token request message. | -| meta_header | [service.RequestMetaHeader](#service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) | | Body of create session token request message. | +| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message CreateRequest.Body - +Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [refs.OwnerID](#refs.OwnerID) | | Carries an identifier of a session initiator. | -| lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Carries a lifetime of the session. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries an identifier of a session initiator. | +| lifetime | [neo.fs.v2.service.TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Carries a lifetime of the session. | - + ### Message CreateResponse CreateResponse carries an information about the opened session. @@ -79,15 +79,15 @@ CreateResponse carries an information about the opened session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [CreateResponse.Body](#session.CreateResponse.Body) | | Body of create session token response message. | -| meta_header | [service.ResponseMetaHeader](#service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [service.ResponseVerificationHeader](#service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| body | [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) | | Body of create session token response message. | +| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - + ### Message CreateResponse.Body - +Response body | Field | Type | Label | Description | diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index ca75ee1..b15925a 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -6,7 +6,7 @@ - [storagegroup/types.proto](#storagegroup/types.proto) - Messages - - [StorageGroup](#storagegroup.StorageGroup) + - [StorageGroup](#neo.fs.v2.storagegroup.StorageGroup) - [Scalar Value Types](#scalar-value-types) @@ -22,7 +22,7 @@ - + ### Message StorageGroup StorageGroup groups the information about the NeoFS storage group. @@ -34,7 +34,7 @@ The storage group consists of objects from single container. | validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | | validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | | expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | -| members | [refs.ObjectID](#refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | +| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | From af26bd2b5da1967c32c8b53c53c3d8b21f8177e7 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 14 Aug 2020 10:01:41 +0300 Subject: [PATCH 162/440] [#45] Fix go_option in netmap package --- netmap/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/types.proto b/netmap/types.proto index 37fadaf..1b9c69a 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/nspcc-dev/neofs-api-go/netmap;netmap"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap;netmap"; option csharp_namespace = "NeoFS.API.v2.Netmap"; // Set of rules to select a subset of nodes able to store container's objects From f87d70ca23709bf7b2742f592d60cc135c4a82d2 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 13 Aug 2020 23:51:55 +0300 Subject: [PATCH 163/440] [#46] Add per-service context to SessionToken Signed-off-by: Stanislav Bogatyrev --- proto-docs/service.md | 36 ++++++++++++++-------- service/meta.proto | 72 +++++++++++++++++++++++-------------------- service/verify.proto | 3 -- 3 files changed, 63 insertions(+), 48 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index 3d01579..c2cdd29 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -8,6 +8,7 @@ - Messages - [BearerToken](#neo.fs.v2.service.BearerToken) - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) + - [ObjectServiceContext](#neo.fs.v2.service.ObjectServiceContext) - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) - [SessionToken](#neo.fs.v2.service.SessionToken) @@ -63,6 +64,18 @@ Bearer Token body | lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Token expiration and valid time period parameters | + + +### Message ObjectServiceContext +Context information for Session Tokens related to ObjectService requests + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| verb | [ObjectServiceContext.Verb](#neo.fs.v2.service.ObjectServiceContext.Verb) | | Verb is a type of request for which the token is issued | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | + + ### Message RequestMetaHeader @@ -117,10 +130,9 @@ Session token body | ----- | ---- | ----- | ----------- | | id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | -| verb | [SessionToken.Body.Verb](#neo.fs.v2.service.SessionToken.Body.Verb) | | Verb is a type of request for which the token is issued | | lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| object_address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | object_address represents the object session context. | +| object_service | [ObjectServiceContext](#neo.fs.v2.service.ObjectServiceContext) | | ObjectService session context. | @@ -162,21 +174,21 @@ Extended headers for Request/Response - + -### SessionToken.Body.Verb -Verb is an enumeration of session request types +### ObjectServiceContext.Verb +Object request verbs | Name | Number | Description | | ---- | ------ | ----------- | | VERB_UNSPECIFIED | 0 | Unknown verb | -| OBJECT_PUT | 1 | Refers to object.Put RPC call | -| OBJECT_GET | 2 | Refers to object.Get RPC call | -| OBJECT_HEAD | 3 | Refers to object.Head RPC call | -| OBJECT_SEARCH | 4 | Refers to object.Search RPC call | -| OBJECT_DELETE | 5 | Refers to object.Delete RPC call | -| OBJECT_RANGE | 6 | Refers to object.GetRange RPC call | -| OBJECT_RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | +| PUT | 1 | Refers to object.Put RPC call | +| GET | 2 | Refers to object.Get RPC call | +| HEAD | 3 | Refers to object.Head RPC call | +| SEARCH | 4 | Refers to object.Search RPC call | +| DELETE | 5 | Refers to object.Delete RPC call | +| RANGE | 6 | Refers to object.GetRange RPC call | +| RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | diff --git a/service/meta.proto b/service/meta.proto index e74a606..5cfe6d1 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -39,6 +39,41 @@ message TokenLifetime { uint64 iat = 3; } +// Context information for Session Tokens related to ObjectService requests +message ObjectServiceContext { + // Object request verbs + enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; + + // Refers to object.Put RPC call + PUT = 1; + + // Refers to object.Get RPC call + GET = 2; + + // Refers to object.Head RPC call + HEAD = 3; + + // Refers to object.Search RPC call + SEARCH = 4; + + // Refers to object.Delete RPC call + DELETE = 5; + + // Refers to object.GetRange RPC call + RANGE = 6; + + // Refers to object.GetRangeHash RPC call + RANGEHASH = 7; + } + // Verb is a type of request for which the token is issued + Verb verb = 1; + + // Related Object address + neo.fs.v2.refs.Address address = 2; +} + // NeoFS session token. message SessionToken { // Session token body @@ -49,45 +84,16 @@ message SessionToken { // OwnerID carries identifier of the session initiator. neo.fs.v2.refs.OwnerID owner_id = 2; - // Verb is an enumeration of session request types - enum Verb { - // Unknown verb - VERB_UNSPECIFIED = 0; - - // Refers to object.Put RPC call - OBJECT_PUT = 1; - - // Refers to object.Get RPC call - OBJECT_GET = 2; - - // Refers to object.Head RPC call - OBJECT_HEAD = 3; - - // Refers to object.Search RPC call - OBJECT_SEARCH = 4; - - // Refers to object.Delete RPC call - OBJECT_DELETE = 5; - - // Refers to object.GetRange RPC call - OBJECT_RANGE = 6; - - // Refers to object.GetRangeHash RPC call - OBJECT_RANGEHASH = 7; - } - // Verb is a type of request for which the token is issued - Verb verb = 3; - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 4; + TokenLifetime lifetime = 3; // SessionKey is a public key of session key - bytes session_key = 5; + bytes session_key = 4; // Carries context of the session. oneof context { - // object_address represents the object session context. - neo.fs.v2.refs.Address object_address = 6; + // ObjectService session context. + ObjectServiceContext object_service = 5; } } // Session Token body diff --git a/service/verify.proto b/service/verify.proto index 77745c6..ecfab78 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -5,9 +5,6 @@ package neo.fs.v2.service; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service"; option csharp_namespace = "NeoFS.API.v2.Service"; -import "acl/types.proto"; -import "refs/types.proto"; - // Signature of something in NeoFS message Signature { // Public key used for signing. From e63a48252958ee63c590c35a871b3ee0df2f951a Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 14 Aug 2020 21:27:31 +0300 Subject: [PATCH 164/440] [#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 --- accounting/service.proto | 2 +- acl/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 2 +- service/meta.proto | 2 +- service/verify.proto | 2 +- session/service.proto | 2 +- storagegroup/types.proto | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 4afbcee..f328831 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting;accounting"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "NeoFS.API.v2.Accounting"; import "refs/types.proto"; diff --git a/acl/types.proto b/acl/types.proto index ad7d778..edb3649 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.acl; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl;acl"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl"; option csharp_namespace = "NeoFS.API.v2.Acl"; import "refs/types.proto"; diff --git a/container/service.proto b/container/service.proto index c0712ea..b0b7165 100644 --- a/container/service.proto +++ b/container/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; option csharp_namespace = "NeoFS.API.v2.Container"; import "acl/types.proto"; diff --git a/container/types.proto b/container/types.proto index 10e374a..0761bf0 100644 --- a/container/types.proto +++ b/container/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container;container"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; diff --git a/netmap/types.proto b/netmap/types.proto index 1b9c69a..7e1dd42 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap;netmap"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "NeoFS.API.v2.Netmap"; // Set of rules to select a subset of nodes able to store container's objects diff --git a/object/service.proto b/object/service.proto index 04ecb1f..7bb3248 100644 --- a/object/service.proto +++ b/object/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object;object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; option csharp_namespace = "NeoFS.API.v2.Object"; import "object/types.proto"; diff --git a/object/types.proto b/object/types.proto index 05f4571..35a2a07 100644 --- a/object/types.proto +++ b/object/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object;object"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; diff --git a/refs/types.proto b/refs/types.proto index 1ffb033..f181a78 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.refs; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs;refs"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "NeoFS.API.v2.Refs"; // Address of object (container id + object id) diff --git a/service/meta.proto b/service/meta.proto index 5cfe6d1..ddf8d64 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.service; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service"; option csharp_namespace = "NeoFS.API.v2.Service"; import "acl/types.proto"; diff --git a/service/verify.proto b/service/verify.proto index ecfab78..af4c526 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.service; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service"; option csharp_namespace = "NeoFS.API.v2.Service"; // Signature of something in NeoFS diff --git a/session/service.proto b/session/service.proto index 94281a7..3c26447 100644 --- a/session/service.proto +++ b/session/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.session; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session;session"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 94cefc3..196a867 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.storagegroup; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup;storagegroup"; +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup/grpc;storagegroup"; option csharp_namespace = "NeoFS.API.v2.StorageGroup"; import "refs/types.proto"; From 7555e166b2a4a1314d4895d45aaf9f27aa9a53d8 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 14 Aug 2020 22:04:56 +0300 Subject: [PATCH 165/440] [#49] Minor reformat - Trying to move enums to the package level - Trying to keep all definitions in types.proto Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 129 ++++++++++++++++++++++--------------------- object/service.proto | 25 --------- object/types.proto | 27 +++++++++ proto-docs/acl.md | 24 ++++---- proto-docs/object.md | 60 ++++++++++---------- 5 files changed, 134 insertions(+), 131 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index edb3649..9a38775 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -23,81 +23,82 @@ enum Target { OTHERS = 3; } +// MatchType is an enumeration of match types. +enum MatchType { + // Unspecified match type, default value. + MATCH_TYPE_UNSPECIFIED = 0; + + // Return true if strings are equal + STRING_EQUAL = 1; + + // Return true if strings are different + STRING_NOT_EQUAL = 2; +} + +// Operation is an enumeration of operation types. +enum Operation { + // Unspecified operation, default value. + OPERATION_UNSPECIFIED = 0; + + // Get + GET = 1; + + // Head + HEAD = 2; + + // Put + PUT = 3; + + // Delete + DELETE = 4; + + // Search + SEARCH = 5; + + // GetRange + GETRANGE = 6; + + // GetRangeHash + GETRANGEHASH = 7; +} + +// Action is an enumeration of EACL actions. +enum Action { + // Unspecified action, default value. + ACTION_UNSPECIFIED = 0; + + // Allow action + ALLOW = 1; + + // Deny action + DENY = 2; +} + +// Header is an enumeration of filtering header types. +enum HeaderType { + // Unspecified header, default value. + HEADER_UNSPECIFIED = 0; + + // Filter request headers + REQUEST = 1; + + // Filter object headers + OBJECT = 2; +} + // EACLRecord groups information about extended ACL rule. message EACLRecord { - // Operation is an enumeration of operation types. - enum Operation { - // Unspecified operation, default value. - OPERATION_UNSPECIFIED = 0; - - // Get - GET = 1; - - // Head - HEAD = 2; - - // Put - PUT = 3; - - // Delete - DELETE = 4; - - // Search - SEARCH = 5; - - // GetRange - GETRANGE = 6; - - // GetRangeHash - GETRANGEHASH = 7; - } - // Operation carries type of operation. Operation operation = 1 [json_name = "Operation"]; - // Action is an enumeration of EACL actions. - enum Action { - // Unspecified action, default value. - ACTION_UNSPECIFIED = 0; - - // Allow action - ALLOW = 1; - - // Deny action - DENY = 2; - } - // Action carries ACL target action. Action action = 2 [json_name = "Action"]; // FilterInfo groups information about filter. message FilterInfo { - // Header is an enumeration of filtering header types. - enum Header { - // Unspecified header, default value. - HEADER_UNSPECIFIED = 0; - - // Filter request headers - REQUEST = 1; - - // Filter object headers - OBJECT = 2; - } - // Header carries type of header. - Header header = 1 [json_name = "HeaderType"]; + HeaderType header = 1 [json_name = "HeaderType"]; - // MatchType is an enumeration of match types. - enum MatchType { - // Unspecified match type, default value. - MATCH_TYPE_UNSPECIFIED = 0; - - // Return true if strings are equal - STRING_EQUAL = 1; - - // Return true if strings are different - STRING_NOT_EQUAL = 2; - } // MatchType carries type of match. MatchType match_type = 2 [json_name = "MatchType"]; @@ -114,7 +115,7 @@ message EACLRecord { // TargetInfo groups information about extended ACL target. message TargetInfo { // target carries target of ACL rule. - acl.Target target = 1 [json_name="Role"]; + Target target = 1 [json_name="Role"]; // key_list carries public keys of ACL target. repeated bytes key_list = 2 [json_name="Keys"]; diff --git a/object/service.proto b/object/service.proto index 7bb3248..bbd466f 100644 --- a/object/service.proto +++ b/object/service.proto @@ -247,24 +247,6 @@ message HeadRequest { message HeadResponse { // Response body message Body { - // Short header fields - message ShortHeader { - // Object format version. - neo.fs.v2.service.Version version = 1; - - // Epoch when the object was created - uint64 creation_epoch = 2; - - // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3; - - // Type of the object payload content - ObjectType object_type = 4; - - // Size of payload in bytes. - // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown - uint64 payload_length = 5; - } // Carries the requested object header or it's part oneof head{ // Full object header @@ -298,13 +280,6 @@ message SearchRequest { uint32 version = 2; // Filter structure message Filter { - // Type of match expression - enum MatchType { - // Unknown. Not used - MATCH_TYPE_UNSPECIFIED = 0; - // Full string match - STRING_EQUAL = 1; - } // Match type to use MatchType match_type = 1; diff --git a/object/types.proto b/object/types.proto index 35a2a07..89edf9b 100644 --- a/object/types.proto +++ b/object/types.proto @@ -21,6 +21,33 @@ enum ObjectType { STORAGE_GROUP = 2; } +// Type of match expression +enum MatchType { + // Unknown. Not used + MATCH_TYPE_UNSPECIFIED = 0; + // Full string match + STRING_EQUAL = 1; +} + +// Short header fields +message ShortHeader { + // Object format version. + neo.fs.v2.service.Version version = 1; + + // Epoch when the object was created + uint64 creation_epoch = 2; + + // Object's owner + neo.fs.v2.refs.OwnerID owner_id = 3; + + // Type of the object payload content + ObjectType object_type = 4; + + // Size of payload in bytes. + // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown + uint64 payload_length = 5; +} + // Object Headers message Header { // Object's container diff --git a/proto-docs/acl.md b/proto-docs/acl.md index b2adaf6..b653ec9 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -33,8 +33,8 @@ EACLRecord groups information about extended ACL rule. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| operation | [EACLRecord.Operation](#neo.fs.v2.acl.EACLRecord.Operation) | | Operation carries type of operation. | -| action | [EACLRecord.Action](#neo.fs.v2.acl.EACLRecord.Action) | | Action carries ACL target action. | +| operation | [Operation](#neo.fs.v2.acl.Operation) | | Operation carries type of operation. | +| action | [Action](#neo.fs.v2.acl.Action) | | Action carries ACL target action. | | filters | [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) | repeated | filters carries set of filters. | | targets | [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) | repeated | targets carries information about extended ACL target list. | @@ -47,8 +47,8 @@ FilterInfo groups information about filter. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [EACLRecord.FilterInfo.Header](#neo.fs.v2.acl.EACLRecord.FilterInfo.Header) | | Header carries type of header. | -| match_type | [EACLRecord.FilterInfo.MatchType](#neo.fs.v2.acl.EACLRecord.FilterInfo.MatchType) | | MatchType carries type of match. | +| header | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Header carries type of header. | +| match_type | [MatchType](#neo.fs.v2.acl.MatchType) | | MatchType carries type of match. | | header_name | [string](#string) | | header_name carries name of filtering header. | | header_val | [string](#string) | | header_val carries value of filtering header. | @@ -79,9 +79,9 @@ EACLRecord carries the information about extended ACL rules. - + -### EACLRecord.Action +### Action Action is an enumeration of EACL actions. | Name | Number | Description | @@ -92,9 +92,9 @@ Action is an enumeration of EACL actions. - + -### EACLRecord.FilterInfo.Header +### HeaderType Header is an enumeration of filtering header types. | Name | Number | Description | @@ -105,9 +105,9 @@ Header is an enumeration of filtering header types. - + -### EACLRecord.FilterInfo.MatchType +### MatchType MatchType is an enumeration of match types. | Name | Number | Description | @@ -118,9 +118,9 @@ MatchType is an enumeration of match types. - + -### EACLRecord.Operation +### Operation Operation is an enumeration of operation types. | Name | Number | Description | diff --git a/proto-docs/object.md b/proto-docs/object.md index 94fc650..5f79a90 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -29,7 +29,6 @@ - [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) - [HeadResponse](#neo.fs.v2.object.HeadResponse) - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) - - [HeadResponse.Body.ShortHeader](#neo.fs.v2.object.HeadResponse.Body.ShortHeader) - [PutRequest](#neo.fs.v2.object.PutRequest) - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) @@ -50,6 +49,7 @@ - [Header.Attribute](#neo.fs.v2.object.Header.Attribute) - [Header.Split](#neo.fs.v2.object.Header.Split) - [Object](#neo.fs.v2.object.Object) + - [ShortHeader](#neo.fs.v2.object.ShortHeader) - [Scalar Value Types](#scalar-value-types) @@ -406,22 +406,7 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | header | [Header](#neo.fs.v2.object.Header) | | Full object header | -| short_header | [HeadResponse.Body.ShortHeader](#neo.fs.v2.object.HeadResponse.Body.ShortHeader) | | Short object header | - - - - -### Message HeadResponse.Body.ShortHeader -Short header fields - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. | -| creation_epoch | [uint64](#uint64) | | Epoch when the object was created | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | -| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | -| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | +| short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | @@ -533,7 +518,7 @@ Filter structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| match_type | [SearchRequest.Body.Filter.MatchType](#neo.fs.v2.object.SearchRequest.Body.Filter.MatchType) | | Match type to use | +| match_type | [MatchType](#neo.fs.v2.object.MatchType) | | Match type to use | | name | [string](#string) | | Header name to match | | value | [string](#string) | | Header value to match | @@ -563,18 +548,6 @@ Response body - - - -### SearchRequest.Body.Filter.MatchType -Type of match expression - -| Name | Number | Description | -| ---- | ------ | ----------- | -| MATCH_TYPE_UNSPECIFIED | 0 | Unknown. Not used | -| STRING_EQUAL | 1 | Full string match | - - @@ -649,9 +622,36 @@ Object structure. | header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | | payload | [bytes](#bytes) | | Payload bytes. | + + + +### Message ShortHeader +Short header fields + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. | +| creation_epoch | [uint64](#uint64) | | Epoch when the object was created | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | +| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | + + + +### MatchType +Type of match expression + +| Name | Number | Description | +| ---- | ------ | ----------- | +| MATCH_TYPE_UNSPECIFIED | 0 | Unknown. Not used | +| STRING_EQUAL | 1 | Full string match | + + + ### ObjectType From 4e908a17b17a51a1a17d5418d7c08e2a1cc3af4d Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 14 Aug 2020 22:44:32 +0300 Subject: [PATCH 166/440] [#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 --- container/types.proto | 15 ++++++++++----- object/types.proto | 20 ++++++++++---------- proto-docs/container.md | 1 + proto-docs/object.md | 4 ++-- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/container/types.proto b/container/types.proto index 0761bf0..5b10606 100644 --- a/container/types.proto +++ b/container/types.proto @@ -7,21 +7,26 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; import "refs/types.proto"; +import "service/meta.proto"; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes // and access control information. ID of the container is a 32 byte long // SHA256 hash of stable-marshalled container message. message Container { + // Container format version. + // Effectively the version of API library used to create container + neo.fs.v2.service.Version version = 1; + // OwnerID carries identifier of the container owner. - neo.fs.v2.refs.OwnerID owner_id = 1; + neo.fs.v2.refs.OwnerID owner_id = 2; // Nonce is a 16 byte UUID, used to avoid collisions of container id. - bytes nonce = 2; + bytes nonce = 3; // BasicACL contains access control rules for owner, system, others groups and // permission bits for bearer token and Extended ACL. - uint32 basic_acl = 3; + uint32 basic_acl = 4; // Attribute is a key-value pair of strings. message Attribute { @@ -32,8 +37,8 @@ message Container { string value = 2; } // Attributes define any immutable characteristics of container. - repeated Attribute attributes = 4; + repeated Attribute attributes = 5; // Placement policy for the object inside the container. - neo.fs.v2.netmap.PlacementPolicy placement_policy = 5; + neo.fs.v2.netmap.PlacementPolicy placement_policy = 6; } diff --git a/object/types.proto b/object/types.proto index 89edf9b..efcca41 100644 --- a/object/types.proto +++ b/object/types.proto @@ -50,18 +50,18 @@ message ShortHeader { // Object Headers message Header { - // Object's container - neo.fs.v2.refs.ContainerID container_id = 1; - - // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 2; - - // Epoch when the object was created - uint64 creation_epoch = 3; - // Object format version. // Effectively the version of API library used to create particular object - neo.fs.v2.service.Version version = 4; + neo.fs.v2.service.Version version = 1; + + // Object's container + neo.fs.v2.refs.ContainerID container_id = 2; + + // Object's owner + neo.fs.v2.refs.OwnerID owner_id = 3; + + // Object creation Epoch + uint64 creation_epoch = 4; // Size of payload in bytes. // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown diff --git a/proto-docs/container.md b/proto-docs/container.md index 8ed1b00..7d4f684 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -435,6 +435,7 @@ SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Container format version. Effectively the version of API library used to create container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the container owner. | | nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | basic_acl | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 5f79a90..365c10b 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -569,10 +569,10 @@ Object Headers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. Effectively the version of API library used to create particular object | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | -| creation_epoch | [uint64](#uint64) | | Epoch when the object was created | -| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. Effectively the version of API library used to create particular object | +| creation_epoch | [uint64](#uint64) | | Object creation Epoch | | payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | | payload_hash | [bytes](#bytes) | | Hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | From 1647242397f0d9f019ab49043e4f50d4b6de90ee Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 14:00:34 +0300 Subject: [PATCH 167/440] [#46] Rename session context fields It should simplify reading. Signed-off-by: Stanislav Bogatyrev --- proto-docs/service.md | 14 +++++++------- service/meta.proto | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/proto-docs/service.md b/proto-docs/service.md index c2cdd29..389c54d 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -8,7 +8,7 @@ - Messages - [BearerToken](#neo.fs.v2.service.BearerToken) - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) - - [ObjectServiceContext](#neo.fs.v2.service.ObjectServiceContext) + - [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) - [SessionToken](#neo.fs.v2.service.SessionToken) @@ -64,15 +64,15 @@ Bearer Token body | lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Token expiration and valid time period parameters | - + -### Message ObjectServiceContext +### Message ObjectSessionContext Context information for Session Tokens related to ObjectService requests | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| verb | [ObjectServiceContext.Verb](#neo.fs.v2.service.ObjectServiceContext.Verb) | | Verb is a type of request for which the token is issued | +| verb | [ObjectSessionContext.Verb](#neo.fs.v2.service.ObjectSessionContext.Verb) | | Verb is a type of request for which the token is issued | | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | @@ -132,7 +132,7 @@ Session token body | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | | lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Lifetime is a lifetime of the session | | session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| object_service | [ObjectServiceContext](#neo.fs.v2.service.ObjectServiceContext) | | ObjectService session context. | +| object | [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) | | ObjectService session context. | @@ -174,9 +174,9 @@ Extended headers for Request/Response - + -### ObjectServiceContext.Verb +### ObjectSessionContext.Verb Object request verbs | Name | Number | Description | diff --git a/service/meta.proto b/service/meta.proto index ddf8d64..aad0277 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -40,7 +40,7 @@ message TokenLifetime { } // Context information for Session Tokens related to ObjectService requests -message ObjectServiceContext { +message ObjectSessionContext { // Object request verbs enum Verb { // Unknown verb @@ -93,7 +93,7 @@ message SessionToken { // Carries context of the session. oneof context { // ObjectService session context. - ObjectServiceContext object_service = 5; + ObjectSessionContext object = 5; } } // Session Token body From a78b8a1ea5dc4b5632557375a0d8ce1077fdcea4 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 14:13:16 +0300 Subject: [PATCH 168/440] Move all service types to types.proto Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 3 +- container/service.proto | 3 +- container/types.proto | 2 +- object/service.proto | 3 +- object/types.proto | 3 +- proto-docs/service.md | 111 ++++++++++++---------------- service/{meta.proto => types.proto} | 35 ++++++++- service/verify.proto | 40 ---------- session/service.proto | 3 +- 9 files changed, 86 insertions(+), 117 deletions(-) rename service/{meta.proto => types.proto} (77%) delete mode 100644 service/verify.proto diff --git a/accounting/service.proto b/accounting/service.proto index f328831..b4c6bd6 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accoun option csharp_namespace = "NeoFS.API.v2.Accounting"; import "refs/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; +import "service/types.proto"; // The service provides methods for obtaining information // about the account balance in NeoFS system. diff --git a/container/service.proto b/container/service.proto index b0b7165..c498477 100644 --- a/container/service.proto +++ b/container/service.proto @@ -8,8 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "acl/types.proto"; import "container/types.proto"; import "refs/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; +import "service/types.proto"; // ContainerService provides API to access container smart-contract in morph chain // via NeoFS node. diff --git a/container/types.proto b/container/types.proto index 5b10606..589d392 100644 --- a/container/types.proto +++ b/container/types.proto @@ -7,7 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; import "refs/types.proto"; -import "service/meta.proto"; +import "service/types.proto"; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes diff --git a/object/service.proto b/object/service.proto index bbd466f..aad7466 100644 --- a/object/service.proto +++ b/object/service.proto @@ -7,8 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Object"; import "object/types.proto"; import "refs/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; +import "service/types.proto"; // Object service provides API for manipulating with the object. service ObjectService { diff --git a/object/types.proto b/object/types.proto index efcca41..c2a2afa 100644 --- a/object/types.proto +++ b/object/types.proto @@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; +import "service/types.proto"; // Type of the object payload content enum ObjectType { diff --git a/proto-docs/service.md b/proto-docs/service.md index 389c54d..d61b9a1 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -3,37 +3,32 @@ ## Table of Contents -- [service/meta.proto](#service/meta.proto) +- [service/types.proto](#service/types.proto) - Messages - [BearerToken](#neo.fs.v2.service.BearerToken) - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) - [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) + - [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) + - [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) - [SessionToken](#neo.fs.v2.service.SessionToken) - [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) + - [Signature](#neo.fs.v2.service.Signature) - [TokenLifetime](#neo.fs.v2.service.TokenLifetime) - [Version](#neo.fs.v2.service.Version) - [XHeader](#neo.fs.v2.service.XHeader) -- [service/verify.proto](#service/verify.proto) - - - Messages - - [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) - - [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) - - [Signature](#neo.fs.v2.service.Signature) - - - [Scalar Value Types](#scalar-value-types) - +

Top

-## service/meta.proto +## service/types.proto @@ -93,6 +88,20 @@ Information about the request | origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | + + +### Message RequestVerificationHeader +Verification info for request signed by all intermediate nodes + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. | +| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures | + + ### Message ResponseMetaHeader @@ -108,6 +117,20 @@ Information about the response | origin | [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta header of the origin response. | + + +### Message ResponseVerificationHeader +Verification info for response signed by all intermediate nodes + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. | +| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node | +| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures | + + ### Message SessionToken @@ -135,6 +158,18 @@ Session token body | object | [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) | | ObjectService session context. | + + +### Message Signature +Signature of something in NeoFS + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | Public key used for signing. | +| sign | [bytes](#bytes) | | Signature | + + ### Message TokenLifetime @@ -195,60 +230,6 @@ Object request verbs - -

Top

- -## service/verify.proto - - - - - - - -### Message RequestVerificationHeader -Verification info for request signed by all intermediate nodes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. | -| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | -| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures | - - - - -### Message ResponseVerificationHeader -Verification info for response signed by all intermediate nodes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. | -| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | -| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures | - - - - -### Message Signature -Signature of something in NeoFS - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | Public key used for signing. | -| sign | [bytes](#bytes) | | Signature | - - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ Type | Java Type | Python Type | diff --git a/service/meta.proto b/service/types.proto similarity index 77% rename from service/meta.proto rename to service/types.proto index aad0277..c59f4d1 100644 --- a/service/meta.proto +++ b/service/types.proto @@ -7,7 +7,6 @@ option csharp_namespace = "NeoFS.API.v2.Service"; import "acl/types.proto"; import "refs/types.proto"; -import "service/verify.proto"; // Extended headers for Request/Response message XHeader { @@ -164,3 +163,37 @@ message ResponseMetaHeader { // Carries response meta header of the origin response. ResponseMetaHeader origin = 5; } + +// Signature of something in NeoFS +message Signature { + // Public key used for signing. + bytes key = 1; + // Signature + bytes sign = 2; +} + +// Verification info for request signed by all intermediate nodes +message RequestVerificationHeader { + // Request Body signature. Should be generated once by request initiator. + Signature body_signature = 1; + // Request Meta signature is added and signed by any intermediate node + Signature meta_signature = 2; + // Sign previous hops + Signature origin_signature = 3; + + // Chain of previous hops signatures + RequestVerificationHeader origin = 4; +} + +// Verification info for response signed by all intermediate nodes +message ResponseVerificationHeader { + // Response Body signature. Should be generated once by answering node. + Signature body_signature = 1; + // Response Meta signature is added and signed by any intermediate node + Signature meta_signature = 2; + // Sign previous hops + Signature origin_signature = 3; + + // Chain of previous hops signatures + ResponseVerificationHeader origin = 4; +} diff --git a/service/verify.proto b/service/verify.proto deleted file mode 100644 index af4c526..0000000 --- a/service/verify.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.service; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service"; -option csharp_namespace = "NeoFS.API.v2.Service"; - -// Signature of something in NeoFS -message Signature { - // Public key used for signing. - bytes key = 1; - // Signature - bytes sign = 2; -} - -// Verification info for request signed by all intermediate nodes -message RequestVerificationHeader { - // Request Body signature. Should be generated once by request initiator. - Signature body_signature = 1; - // Request Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; - // Sign previous hops - Signature origin_signature = 3; - - // Chain of previous hops signatures - RequestVerificationHeader origin = 4; -} - -// Verification info for response signed by all intermediate nodes -message ResponseVerificationHeader { - // Response Body signature. Should be generated once by answering node. - Signature body_signature = 1; - // Response Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; - // Sign previous hops - Signature origin_signature = 3; - - // Chain of previous hops signatures - ResponseVerificationHeader origin = 4; -} diff --git a/session/service.proto b/session/service.proto index 3c26447..b8bd37e 100644 --- a/session/service.proto +++ b/session/service.proto @@ -6,8 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; -import "service/meta.proto"; -import "service/verify.proto"; +import "service/types.proto"; // Create Session record on Node side service SessionService { From 13a80df882d9f0626ab28451e9a3ea108fd27658 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 14:26:53 +0300 Subject: [PATCH 169/440] Use common signature type Signed-off-by: Stanislav Bogatyrev --- container/service.proto | 14 +++++--------- object/service.proto | 5 +---- proto-docs/container.md | 9 ++++----- proto-docs/object.md | 1 - 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/container/service.proto b/container/service.proto index c498477..95c1668 100644 --- a/container/service.proto +++ b/container/service.proto @@ -49,12 +49,8 @@ message PutRequest { // Container to create in NeoFS. container.Container container = 1; - // Public Key of container owner. It can be public key of the owner - // or it can be public key that bound in neofs.id smart-contract. - bytes public_key = 2; - - // Signature of stable-marshalled container according to RFC-6979. - bytes signature = 3; + //Signature of stable-marshalled container according to RFC-6979. + neo.fs.v2.service.Signature signature =2; } // Body of container put request message. Body body = 1; @@ -98,7 +94,7 @@ message DeleteRequest { neo.fs.v2.refs.ContainerID container_id = 1; // Signature of container id according to RFC-6979. - bytes signature = 2; + neo.fs.v2.service.Signature signature = 2; } // Body of container delete request message. Body body = 1; @@ -220,7 +216,7 @@ message SetExtendedACLRequest { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + neo.fs.v2.service.Signature signature = 2; } // Body of set extended acl request message. Body body = 1; @@ -282,7 +278,7 @@ message GetExtendedACLResponse { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes signature = 2; + neo.fs.v2.service.Signature signature = 2; } // Body of get extended acl response message. Body body = 1; diff --git a/object/service.proto b/object/service.proto index aad7466..1fd03a0 100644 --- a/object/service.proto +++ b/object/service.proto @@ -180,10 +180,7 @@ message DeleteRequest { message Body { // Carries the address of the object to be deleted. neo.fs.v2.refs.Address address = 1; - - // Carries identifier the object owner. - neo.fs.v2.refs.OwnerID owner_id = 2; - } + } // Body of delete object request message. Body body = 1; diff --git a/proto-docs/container.md b/proto-docs/container.md index 7d4f684..a757ed5 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -146,7 +146,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | -| signature | [bytes](#bytes) | | Signature of container id according to RFC-6979. | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of container id according to RFC-6979. | @@ -216,7 +216,7 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL that has been requested if it was set up. | -| signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -337,8 +337,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Container to create in NeoFS. | -| public_key | [bytes](#bytes) | | Public Key of container owner. It can be public key of the owner or it can be public key that bound in neofs.id smart-contract. | -| signature | [bytes](#bytes) | | Signature of stable-marshalled container according to RFC-6979. | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled container according to RFC-6979. | @@ -387,7 +386,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL to set for the container. | -| signature | [bytes](#bytes) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 365c10b..93e7f88 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -172,7 +172,6 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries the address of the object to be deleted. | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries identifier the object owner. | From b07c1c31734328a06e96c01dc644b6c01b4d272e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 14:32:48 +0300 Subject: [PATCH 170/440] Separate accounting service from it's types Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 10 +--------- accounting/types.proto | 15 +++++++++++++++ proto-docs/accounting.md | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 accounting/types.proto diff --git a/accounting/service.proto b/accounting/service.proto index b4c6bd6..1af4641 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -5,6 +5,7 @@ package neo.fs.v2.accounting; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "NeoFS.API.v2.Accounting"; +import "accounting/types.proto"; import "refs/types.proto"; import "service/types.proto"; @@ -42,15 +43,6 @@ message BalanceRequest { neo.fs.v2.service.RequestVerificationHeader verify_header = 3; } -// Decimal represents the decimal numbers. -message Decimal { - // value carries number value. - int64 value = 1; - - // precision carries value precision. - uint32 precision = 2; -} - // Message defines the response body of Balance method. // // The amount of funds is calculated in decimal numbers. diff --git a/accounting/types.proto b/accounting/types.proto new file mode 100644 index 0000000..6ebf289 --- /dev/null +++ b/accounting/types.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +package neo.fs.v2.accounting; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; +option csharp_namespace = "NeoFS.API.v2.Accounting"; + +// Decimal represents the decimal numbers. +message Decimal { + // value carries number value. + int64 value = 1; + + // precision carries value precision. + uint32 precision = 2; +} \ No newline at end of file diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 147046a..f29c60b 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -12,6 +12,11 @@ - [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) - [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) - [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) + + +- [accounting/types.proto](#accounting/types.proto) + + - Messages - [Decimal](#neo.fs.v2.accounting.Decimal) @@ -103,6 +108,20 @@ Request body | ----- | ---- | ----- | ----------- | | balance | [Decimal](#neo.fs.v2.accounting.Decimal) | | Carries the amount of funds on the account. | + + + + + + + +

Top

+ +## accounting/types.proto + + + + From 54778a86edcf6aecd529ffc2d95b4c95b79913e3 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 16:14:25 +0300 Subject: [PATCH 171/440] Move Version to refs Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 3 +-- object/types.proto | 4 ++-- refs/types.proto | 11 ++++++++++- service/types.proto | 13 ++----------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/container/types.proto b/container/types.proto index 589d392..85d89c6 100644 --- a/container/types.proto +++ b/container/types.proto @@ -7,7 +7,6 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; import "refs/types.proto"; -import "service/types.proto"; // Container is a structure that defines object placement behaviour. Objects // can be stored only within containers. They define placement rule, attributes @@ -16,7 +15,7 @@ import "service/types.proto"; message Container { // Container format version. // Effectively the version of API library used to create container - neo.fs.v2.service.Version version = 1; + neo.fs.v2.refs.Version version = 1; // OwnerID carries identifier of the container owner. neo.fs.v2.refs.OwnerID owner_id = 2; diff --git a/object/types.proto b/object/types.proto index c2a2afa..7324d6c 100644 --- a/object/types.proto +++ b/object/types.proto @@ -31,7 +31,7 @@ enum MatchType { // Short header fields message ShortHeader { // Object format version. - neo.fs.v2.service.Version version = 1; + neo.fs.v2.refs.Version version = 1; // Epoch when the object was created uint64 creation_epoch = 2; @@ -51,7 +51,7 @@ message ShortHeader { message Header { // Object format version. // Effectively the version of API library used to create particular object - neo.fs.v2.service.Version version = 1; + neo.fs.v2.refs.Version version = 1; // Object's container neo.fs.v2.refs.ContainerID container_id = 2; diff --git a/refs/types.proto b/refs/types.proto index f181a78..1f190a9 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -29,4 +29,13 @@ message ContainerID { message OwnerID { // value carries the identifier of the container owner in a binary format. bytes value = 1; -} \ No newline at end of file +} + +// Represents API version used by node. +message Version { + // Major API version. + uint32 major = 1; + + // Minor API version. + uint32 minor = 2; +} diff --git a/service/types.proto b/service/types.proto index c59f4d1..85cf208 100644 --- a/service/types.proto +++ b/service/types.proto @@ -17,15 +17,6 @@ message XHeader { string value = 2; } -// Represents API version used by node. -message Version { - // Major API version. - uint32 major = 1; - - // Minor API version. - uint32 minor = 2; -} - // Lifetime parameters of the token. Filed names taken from rfc7519. message TokenLifetime { // Expiration Epoch @@ -125,7 +116,7 @@ message BearerToken { // Information about the request message RequestMetaHeader { // Client API version. - Version version = 1; + neo.fs.v2.refs.Version version = 1; // Client local epoch number. Set to 0 if unknown. uint64 epoch = 2; @@ -149,7 +140,7 @@ message RequestMetaHeader { // Information about the response message ResponseMetaHeader { // Server API version. - Version version = 1; + neo.fs.v2.refs.Version version = 1; // Server local epoch number. uint64 epoch = 2; From 7d72061fb31e5de39eb2849d9ecf8657c8bdd321 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 16:41:47 +0300 Subject: [PATCH 172/440] Move BearerToken type to acl package Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 31 +++++++++++++++++++ container/service.proto | 8 ++--- object/service.proto | 4 +-- object/types.proto | 4 +-- refs/types.proto | 8 +++++ service/types.proto | 66 ++++++++++++----------------------------- session/service.proto | 5 ++-- 7 files changed, 68 insertions(+), 58 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 9a38775..ae29abc 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -133,3 +133,34 @@ message EACLTable { // Records carries list of extended ACL rule records. repeated EACLRecord records = 2 [json_name="Records"]; } + +// BearerToken has information about request ACL rules with limited lifetime +message BearerToken { + // Bearer Token body + message Body { + // EACLTable carries table of extended ACL rules + EACLTable eacl_table = 1; + + // OwnerID carries identifier of the token owner + neo.fs.v2.refs.OwnerID owner_id = 2; + + // Lifetime parameters of the token. Filed names taken from rfc7519. + message TokenLifetime { + // Expiration Epoch + uint64 exp = 1; + + // Not valid before Epoch + uint64 nbf = 2; + + // Issued at Epoch + uint64 iat = 3; + } + // Token expiration and valid time period parameters + TokenLifetime lifetime = 3; + } + // Bearer Token body + Body body = 1; + + // Signature of BearerToken body + neo.fs.v2.refs.Signature signature = 2; +} diff --git a/container/service.proto b/container/service.proto index 95c1668..5c08c40 100644 --- a/container/service.proto +++ b/container/service.proto @@ -50,7 +50,7 @@ message PutRequest { container.Container container = 1; //Signature of stable-marshalled container according to RFC-6979. - neo.fs.v2.service.Signature signature =2; + neo.fs.v2.refs.Signature signature =2; } // Body of container put request message. Body body = 1; @@ -94,7 +94,7 @@ message DeleteRequest { neo.fs.v2.refs.ContainerID container_id = 1; // Signature of container id according to RFC-6979. - neo.fs.v2.service.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2; } // Body of container delete request message. Body body = 1; @@ -216,7 +216,7 @@ message SetExtendedACLRequest { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - neo.fs.v2.service.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2; } // Body of set extended acl request message. Body body = 1; @@ -278,7 +278,7 @@ message GetExtendedACLResponse { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - neo.fs.v2.service.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2; } // Body of get extended acl response message. Body body = 1; diff --git a/object/service.proto b/object/service.proto index 1fd03a0..67d41ed 100644 --- a/object/service.proto +++ b/object/service.proto @@ -85,7 +85,7 @@ message GetResponse { neo.fs.v2.refs.ObjectID object_id = 1; // Object signature - neo.fs.v2.service.Signature signature =2; + neo.fs.v2.refs.Signature signature =2; // Object header. Header header = 3; @@ -122,7 +122,7 @@ message PutRequest { neo.fs.v2.refs.ObjectID object_id = 1; // Object signature, were available - neo.fs.v2.service.Signature signature =2; + neo.fs.v2.refs.Signature signature =2; // Header of the object to save in the system. Header header = 3; diff --git a/object/types.proto b/object/types.proto index 7324d6c..356ad8b 100644 --- a/object/types.proto +++ b/object/types.proto @@ -100,7 +100,7 @@ message Header { neo.fs.v2.refs.ObjectID previous = 2; // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.service.Signature parent_signature = 3; + neo.fs.v2.refs.Signature parent_signature = 3; // `header` field of the parent object. Used to reconstruct parent. Header parent_header = 4; @@ -121,7 +121,7 @@ message Object { neo.fs.v2.refs.ObjectID object_id = 1; // Signed object_id - neo.fs.v2.service.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2; // Object metadata headers Header header = 3; diff --git a/refs/types.proto b/refs/types.proto index 1f190a9..a17571d 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -39,3 +39,11 @@ message Version { // Minor API version. uint32 minor = 2; } + +// Signature of something in NeoFS +message Signature { + // Public key used for signing. + bytes key = 1; + // Signature + bytes sign = 2; +} diff --git a/service/types.proto b/service/types.proto index 85cf208..f657d5f 100644 --- a/service/types.proto +++ b/service/types.proto @@ -17,18 +17,6 @@ message XHeader { string value = 2; } -// Lifetime parameters of the token. Filed names taken from rfc7519. -message TokenLifetime { - // Expiration Epoch - uint64 exp = 1; - - // Not valid before Epoch - uint64 nbf = 2; - - // Issued at Epoch - uint64 iat = 3; -} - // Context information for Session Tokens related to ObjectService requests message ObjectSessionContext { // Object request verbs @@ -74,6 +62,17 @@ message SessionToken { // OwnerID carries identifier of the session initiator. neo.fs.v2.refs.OwnerID owner_id = 2; + // Lifetime parameters of the token. Filed names taken from rfc7519. + message TokenLifetime { + // Expiration Epoch + uint64 exp = 1; + + // Not valid before Epoch + uint64 nbf = 2; + + // Issued at Epoch + uint64 iat = 3; + } // Lifetime is a lifetime of the session TokenLifetime lifetime = 3; @@ -90,27 +89,7 @@ message SessionToken { Body body = 1; // Signature is a signature of session token information - Signature signature = 2; -} - -// BearerToken has information about request ACL rules with limited lifetime -message BearerToken { - // Bearer Token body - message Body { - // EACLTable carries table of extended ACL rules - neo.fs.v2.acl.EACLTable eacl_table = 1; - - // OwnerID carries identifier of the token owner - neo.fs.v2.refs.OwnerID owner_id = 2; - - // Token expiration and valid time period parameters - TokenLifetime lifetime = 3; - } - // Bearer Token body - Body body = 1; - - // Signature of BearerToken body - Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2; } // Information about the request @@ -131,7 +110,7 @@ message RequestMetaHeader { SessionToken session_token = 5; // Bearer is a Bearer token of the request - BearerToken bearer_token = 6; + neo.fs.v2.acl.BearerToken bearer_token = 6; // RequestMetaHeader of the origin request. RequestMetaHeader origin = 7; @@ -155,22 +134,15 @@ message ResponseMetaHeader { ResponseMetaHeader origin = 5; } -// Signature of something in NeoFS -message Signature { - // Public key used for signing. - bytes key = 1; - // Signature - bytes sign = 2; -} // Verification info for request signed by all intermediate nodes message RequestVerificationHeader { // Request Body signature. Should be generated once by request initiator. - Signature body_signature = 1; + neo.fs.v2.refs.Signature body_signature = 1; // Request Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; + neo.fs.v2.refs.Signature meta_signature = 2; // Sign previous hops - Signature origin_signature = 3; + neo.fs.v2.refs.Signature origin_signature = 3; // Chain of previous hops signatures RequestVerificationHeader origin = 4; @@ -179,11 +151,11 @@ message RequestVerificationHeader { // Verification info for response signed by all intermediate nodes message ResponseVerificationHeader { // Response Body signature. Should be generated once by answering node. - Signature body_signature = 1; + neo.fs.v2.refs.Signature body_signature = 1; // Response Meta signature is added and signed by any intermediate node - Signature meta_signature = 2; + neo.fs.v2.refs.Signature meta_signature = 2; // Sign previous hops - Signature origin_signature = 3; + neo.fs.v2.refs.Signature origin_signature = 3; // Chain of previous hops signatures ResponseVerificationHeader origin = 4; diff --git a/session/service.proto b/session/service.proto index b8bd37e..f04ebb7 100644 --- a/session/service.proto +++ b/session/service.proto @@ -20,9 +20,8 @@ message CreateRequest { message Body { // Carries an identifier of a session initiator. neo.fs.v2.refs.OwnerID owner_id = 1; - - // Carries a lifetime of the session. - neo.fs.v2.service.TokenLifetime lifetime = 2; + // Expiration Epoch + uint64 expiration = 2; } // Body of create session token request message. Body body = 1; From e5f78eb9277582dcfcec93116cc3be3c80e9c23e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 16:49:05 +0300 Subject: [PATCH 173/440] Move SessionToken to session package Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 4 +-- service/types.proto | 77 ++--------------------------------------- session/types.proto | 83 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 77 deletions(-) create mode 100644 session/types.proto diff --git a/object/types.proto b/object/types.proto index 356ad8b..5c448c3 100644 --- a/object/types.proto +++ b/object/types.proto @@ -6,7 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; -import "service/types.proto"; +import "session/types.proto"; // Type of the object payload content enum ObjectType { @@ -77,7 +77,7 @@ message Header { // Session token, if it was used during Object creation. // Need it to verify integrity and authenticity out of Request scope. - neo.fs.v2.service.SessionToken session_token = 9; + neo.fs.v2.session.SessionToken session_token = 9; // Attribute groups the user-defined Key-Value pairs attached to the object message Attribute { diff --git a/service/types.proto b/service/types.proto index f657d5f..3f9db75 100644 --- a/service/types.proto +++ b/service/types.proto @@ -7,6 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Service"; import "acl/types.proto"; import "refs/types.proto"; +import "session/types.proto"; // Extended headers for Request/Response message XHeader { @@ -17,80 +18,6 @@ message XHeader { string value = 2; } -// Context information for Session Tokens related to ObjectService requests -message ObjectSessionContext { - // Object request verbs - enum Verb { - // Unknown verb - VERB_UNSPECIFIED = 0; - - // Refers to object.Put RPC call - PUT = 1; - - // Refers to object.Get RPC call - GET = 2; - - // Refers to object.Head RPC call - HEAD = 3; - - // Refers to object.Search RPC call - SEARCH = 4; - - // Refers to object.Delete RPC call - DELETE = 5; - - // Refers to object.GetRange RPC call - RANGE = 6; - - // Refers to object.GetRangeHash RPC call - RANGEHASH = 7; - } - // Verb is a type of request for which the token is issued - Verb verb = 1; - - // Related Object address - neo.fs.v2.refs.Address address = 2; -} - -// NeoFS session token. -message SessionToken { - // Session token body - message Body { - // ID is a token identifier. valid UUIDv4 represented in bytes - bytes id = 1; - - // OwnerID carries identifier of the session initiator. - neo.fs.v2.refs.OwnerID owner_id = 2; - - // Lifetime parameters of the token. Filed names taken from rfc7519. - message TokenLifetime { - // Expiration Epoch - uint64 exp = 1; - - // Not valid before Epoch - uint64 nbf = 2; - - // Issued at Epoch - uint64 iat = 3; - } - // Lifetime is a lifetime of the session - TokenLifetime lifetime = 3; - - // SessionKey is a public key of session key - bytes session_key = 4; - - // Carries context of the session. - oneof context { - // ObjectService session context. - ObjectSessionContext object = 5; - } - } - // Session Token body - Body body = 1; - - // Signature is a signature of session token information - neo.fs.v2.refs.Signature signature = 2; -} // Information about the request message RequestMetaHeader { @@ -107,7 +34,7 @@ message RequestMetaHeader { repeated XHeader x_headers = 4; // Token is a token of the session within which the request is sent - SessionToken session_token = 5; + neo.fs.v2.session.SessionToken session_token = 5; // Bearer is a Bearer token of the request neo.fs.v2.acl.BearerToken bearer_token = 6; diff --git a/session/types.proto b/session/types.proto new file mode 100644 index 0000000..84ba10c --- /dev/null +++ b/session/types.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; + +package neo.fs.v2.session; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; +option csharp_namespace = "NeoFS.API.v2.Session"; + +import "refs/types.proto"; + +// Context information for Session Tokens related to ObjectService requests +message ObjectSessionContext { + // Object request verbs + enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; + + // Refers to object.Put RPC call + PUT = 1; + + // Refers to object.Get RPC call + GET = 2; + + // Refers to object.Head RPC call + HEAD = 3; + + // Refers to object.Search RPC call + SEARCH = 4; + + // Refers to object.Delete RPC call + DELETE = 5; + + // Refers to object.GetRange RPC call + RANGE = 6; + + // Refers to object.GetRangeHash RPC call + RANGEHASH = 7; + } + // Verb is a type of request for which the token is issued + Verb verb = 1; + + // Related Object address + neo.fs.v2.refs.Address address = 2; +} + +// NeoFS session token. +message SessionToken { + // Session token body + message Body { + // ID is a token identifier. valid UUIDv4 represented in bytes + bytes id = 1; + + // OwnerID carries identifier of the session initiator. + neo.fs.v2.refs.OwnerID owner_id = 2; + + // Lifetime parameters of the token. Filed names taken from rfc7519. + message TokenLifetime { + // Expiration Epoch + uint64 exp = 1; + + // Not valid before Epoch + uint64 nbf = 2; + + // Issued at Epoch + uint64 iat = 3; + } + // Lifetime is a lifetime of the session + TokenLifetime lifetime = 3; + + // SessionKey is a public key of session key + bytes session_key = 4; + + // Carries context of the session. + oneof context { + // ObjectService session context. + ObjectSessionContext object = 5; + } + } + // Session Token body + Body body = 1; + + // Signature is a signature of session token information + neo.fs.v2.refs.Signature signature = 2; +} From 579a618f7271998aeae74336e6fdd67e05dfb66b Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 16:51:28 +0300 Subject: [PATCH 174/440] docs: Update docs with new token locations Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 41 +++++++++++ proto-docs/container.md | 10 +-- proto-docs/object.md | 14 ++-- proto-docs/refs.md | 26 +++++++ proto-docs/service.md | 147 +++------------------------------------- proto-docs/session.md | 95 +++++++++++++++++++++++++- 6 files changed, 183 insertions(+), 150 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index b653ec9..f3f14c7 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -6,6 +6,9 @@ - [acl/types.proto](#acl/types.proto) - Messages + - [BearerToken](#neo.fs.v2.acl.BearerToken) + - [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) + - [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) - [EACLRecord](#neo.fs.v2.acl.EACLRecord) - [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) - [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) @@ -25,6 +28,44 @@ + + +### Message BearerToken +BearerToken has information about request ACL rules with limited lifetime + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) | | Bearer Token body | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of BearerToken body | + + + + +### Message BearerToken.Body +Bearer Token body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | EACLTable carries table of extended ACL rules | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the token owner | +| lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | + + + + +### Message BearerToken.Body.TokenLifetime +Lifetime parameters of the token. Filed names taken from rfc7519. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| exp | [uint64](#uint64) | | Expiration Epoch | +| nbf | [uint64](#uint64) | | Not valid before Epoch | +| iat | [uint64](#uint64) | | Issued at Epoch | + + ### Message EACLRecord diff --git a/proto-docs/container.md b/proto-docs/container.md index a757ed5..a36f4a6 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -146,7 +146,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of container id according to RFC-6979. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of container id according to RFC-6979. | @@ -216,7 +216,7 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL that has been requested if it was set up. | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -337,7 +337,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Container to create in NeoFS. | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled container according to RFC-6979. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled container according to RFC-6979. | @@ -386,7 +386,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL to set for the container. | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | @@ -434,7 +434,7 @@ SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Container format version. Effectively the version of API library used to create container | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively the version of API library used to create container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the container owner. | | nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | basic_acl | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 93e7f88..2ec1b6c 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -353,7 +353,7 @@ Initialization parameters of the object got from NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Object signature | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature | | header | [Header](#neo.fs.v2.object.Header) | | Object header. | @@ -442,7 +442,7 @@ Groups initialization parameters of object placement in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID, where available | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Object signature, were available | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature, were available | | header | [Header](#neo.fs.v2.object.Header) | | Header of the object to save in the system. | | copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | @@ -568,7 +568,7 @@ Object Headers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. Effectively the version of API library used to create particular object | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | @@ -576,7 +576,7 @@ Object Headers | payload_hash | [bytes](#bytes) | | Hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | | homomorphic_hash | [bytes](#bytes) | | Homomorphic hash of the object payload. | -| session_token | [neo.fs.v2.service.SessionToken](#neo.fs.v2.service.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | +| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy. | @@ -603,7 +603,7 @@ Information about spawning the objects through a payload splitting. | ----- | ---- | ----- | ----------- | | parent | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the origin object. Parent and children objects must be within the same container. Parent object_id is known only to the minor child. | | previous | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Previous carries identifier of the left split neighbor. | -| parent_signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | +| parent_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | | parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | | children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | @@ -617,7 +617,7 @@ Object structure. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. Object is content-addressed. It means id will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload | -| signature | [neo.fs.v2.service.Signature](#neo.fs.v2.service.Signature) | | Signed object_id | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id | | header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | | payload | [bytes](#bytes) | | Payload bytes. | @@ -630,7 +630,7 @@ Short header fields | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.service.Version](#neo.fs.v2.service.Version) | | Object format version. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 103c3e9..c892388 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -10,6 +10,8 @@ - [ContainerID](#neo.fs.v2.refs.ContainerID) - [ObjectID](#neo.fs.v2.refs.ObjectID) - [OwnerID](#neo.fs.v2.refs.OwnerID) + - [Signature](#neo.fs.v2.refs.Signature) + - [Version](#neo.fs.v2.refs.Version) - [Scalar Value Types](#scalar-value-types) @@ -69,6 +71,30 @@ OwnerID group information about the owner of the NeoFS container. | ----- | ---- | ----- | ----------- | | value | [bytes](#bytes) | | value carries the identifier of the container owner in a binary format. | + + + +### Message Signature +Signature of something in NeoFS + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | Public key used for signing. | +| sign | [bytes](#bytes) | | Signature | + + + + +### Message Version +Represents API version used by node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| major | [uint32](#uint32) | | Major API version. | +| minor | [uint32](#uint32) | | Minor API version. | + diff --git a/proto-docs/service.md b/proto-docs/service.md index d61b9a1..e37ad9f 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,18 +6,10 @@ - [service/types.proto](#service/types.proto) - Messages - - [BearerToken](#neo.fs.v2.service.BearerToken) - - [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) - - [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) - [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) - [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) - - [SessionToken](#neo.fs.v2.service.SessionToken) - - [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) - - [Signature](#neo.fs.v2.service.Signature) - - [TokenLifetime](#neo.fs.v2.service.TokenLifetime) - - [Version](#neo.fs.v2.service.Version) - [XHeader](#neo.fs.v2.service.XHeader) @@ -34,43 +26,6 @@ - - -### Message BearerToken -BearerToken has information about request ACL rules with limited lifetime - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [BearerToken.Body](#neo.fs.v2.service.BearerToken.Body) | | Bearer Token body | -| signature | [Signature](#neo.fs.v2.service.Signature) | | Signature of BearerToken body | - - - - -### Message BearerToken.Body -Bearer Token body - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| eacl_table | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | EACLTable carries table of extended ACL rules | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the token owner | -| lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Token expiration and valid time period parameters | - - - - -### Message ObjectSessionContext -Context information for Session Tokens related to ObjectService requests - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| verb | [ObjectSessionContext.Verb](#neo.fs.v2.service.ObjectSessionContext.Verb) | | Verb is a type of request for which the token is issued | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | - - ### Message RequestMetaHeader @@ -79,12 +34,12 @@ Information about the request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [Version](#neo.fs.v2.service.Version) | | Client API version. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Client API version. | | epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | | ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | | x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Request X-Headers. | -| session_token | [SessionToken](#neo.fs.v2.service.SessionToken) | | Token is a token of the session within which the request is sent | -| bearer_token | [BearerToken](#neo.fs.v2.service.BearerToken) | | Bearer is a Bearer token of the request | +| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Token is a token of the session within which the request is sent | +| bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | Bearer is a Bearer token of the request | | origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | @@ -96,9 +51,9 @@ Verification info for request signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Body signature. Should be generated once by request initiator. | -| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Request Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by request initiator. | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by any intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | | origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures | @@ -110,7 +65,7 @@ Information about the response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [Version](#neo.fs.v2.service.Version) | | Server API version. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Server API version. | | epoch | [uint64](#uint64) | | Server local epoch number. | | ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | | x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Response X-Headers. | @@ -125,76 +80,12 @@ Verification info for response signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Body signature. Should be generated once by answering node. | -| meta_signature | [Signature](#neo.fs.v2.service.Signature) | | Response Meta signature is added and signed by any intermediate node | -| origin_signature | [Signature](#neo.fs.v2.service.Signature) | | Sign previous hops | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by answering node. | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by any intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | | origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures | - - -### Message SessionToken -NeoFS session token. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [SessionToken.Body](#neo.fs.v2.service.SessionToken.Body) | | Session Token body | -| signature | [Signature](#neo.fs.v2.service.Signature) | | Signature is a signature of session token information | - - - - -### Message SessionToken.Body -Session token body - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | -| lifetime | [TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Lifetime is a lifetime of the session | -| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| object | [ObjectSessionContext](#neo.fs.v2.service.ObjectSessionContext) | | ObjectService session context. | - - - - -### Message Signature -Signature of something in NeoFS - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | Public key used for signing. | -| sign | [bytes](#bytes) | | Signature | - - - - -### Message TokenLifetime -Lifetime parameters of the token. Filed names taken from rfc7519. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| exp | [uint64](#uint64) | | Expiration Epoch | -| nbf | [uint64](#uint64) | | Not valid before Epoch | -| iat | [uint64](#uint64) | | Issued at Epoch | - - - - -### Message Version -Represents API version used by node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| major | [uint32](#uint32) | | Major API version. | -| minor | [uint32](#uint32) | | Minor API version. | - - ### Message XHeader @@ -208,24 +99,6 @@ Extended headers for Request/Response - - - -### ObjectSessionContext.Verb -Object request verbs - -| Name | Number | Description | -| ---- | ------ | ----------- | -| VERB_UNSPECIFIED | 0 | Unknown verb | -| PUT | 1 | Refers to object.Put RPC call | -| GET | 2 | Refers to object.Get RPC call | -| HEAD | 3 | Refers to object.Head RPC call | -| SEARCH | 4 | Refers to object.Search RPC call | -| DELETE | 5 | Refers to object.Delete RPC call | -| RANGE | 6 | Refers to object.GetRange RPC call | -| RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | - - diff --git a/proto-docs/session.md b/proto-docs/session.md index 63a695d..81ec58e 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -14,6 +14,15 @@ - [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) +- [session/types.proto](#session/types.proto) + + - Messages + - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) + - [SessionToken](#neo.fs.v2.session.SessionToken) + - [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) + - [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) + + - [Scalar Value Types](#scalar-value-types) @@ -68,7 +77,7 @@ Request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries an identifier of a session initiator. | -| lifetime | [neo.fs.v2.service.TokenLifetime](#neo.fs.v2.service.TokenLifetime) | | Carries a lifetime of the session. | +| expiration | [uint64](#uint64) | | Expiration Epoch | @@ -101,6 +110,90 @@ Response body + +

Top

+ +## session/types.proto + + + + + + + +### Message ObjectSessionContext +Context information for Session Tokens related to ObjectService requests + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| verb | [ObjectSessionContext.Verb](#neo.fs.v2.session.ObjectSessionContext.Verb) | | Verb is a type of request for which the token is issued | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | + + + + +### Message SessionToken +NeoFS session token. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) | | Session Token body | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature is a signature of session token information | + + + + +### Message SessionToken.Body +Session token body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | +| lifetime | [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) | | Lifetime is a lifetime of the session | +| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | +| object | [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) | | ObjectService session context. | + + + + +### Message SessionToken.Body.TokenLifetime +Lifetime parameters of the token. Filed names taken from rfc7519. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| exp | [uint64](#uint64) | | Expiration Epoch | +| nbf | [uint64](#uint64) | | Not valid before Epoch | +| iat | [uint64](#uint64) | | Issued at Epoch | + + + + + + +### ObjectSessionContext.Verb +Object request verbs + +| Name | Number | Description | +| ---- | ------ | ----------- | +| VERB_UNSPECIFIED | 0 | Unknown verb | +| PUT | 1 | Refers to object.Put RPC call | +| GET | 2 | Refers to object.Get RPC call | +| HEAD | 3 | Refers to object.Head RPC call | +| SEARCH | 4 | Refers to object.Search RPC call | +| DELETE | 5 | Refers to object.Delete RPC call | +| RANGE | 6 | Refers to object.GetRange RPC call | +| RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | + + + + + + ## Scalar Value Types | .proto Type | Notes | C++ Type | Java Type | Python Type | From 526792324db66dc31ad82a7aa05aeb35f6e90046 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 18:26:51 +0300 Subject: [PATCH 175/440] [#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 --- object/service.proto | 10 ++++++++-- object/types.proto | 4 ++-- refs/types.proto | 18 ++++++++++++++++++ storagegroup/types.proto | 2 +- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/object/service.proto b/object/service.proto index 67d41ed..dba34d6 100644 --- a/object/service.proto +++ b/object/service.proto @@ -385,6 +385,9 @@ message GetRangeHashRequest { // Carries binary salt to XOR object payload ranges before hash calculation. bytes salt = 3; + + // Checksum algorithm type + neo.fs.v2.refs.ChecksumType type = 4; } // Body of get range hash object request message. Body body = 1; @@ -402,8 +405,11 @@ message GetRangeHashRequest { message GetRangeHashResponse { // Response body message Body { - // Carries list of homomorphic hashes in a binary format. - repeated bytes hash_list = 1; + // Checksum algorithm type + neo.fs.v2.refs.ChecksumType type = 1; + + // List of range hashes in a binary format. + repeated bytes hash_list = 2; } // Body of get range hash object response message. Body body = 1; diff --git a/object/types.proto b/object/types.proto index 5c448c3..9121d6d 100644 --- a/object/types.proto +++ b/object/types.proto @@ -67,13 +67,13 @@ message Header { uint64 payload_length = 5; // Hash of payload bytes - bytes payload_hash = 6; + Checksum payload_hash = 6; // Special object type ObjectType object_type = 7; // Homomorphic hash of the object payload. - bytes homomorphic_hash = 8; + Checksum homomorphic_hash = 8; // Session token, if it was used during Object creation. // Need it to verify integrity and authenticity out of Request scope. diff --git a/refs/types.proto b/refs/types.proto index a17571d..29ddd2a 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -47,3 +47,21 @@ message Signature { // Signature bytes sign = 2; } + +// Checksum algorithm type +enum ChecksumType { + // Unknown. Not used + CHECKSUM_TYPE_UNSPECIFIED = 0; + + // Tillich-Zemor homomorphic hash funciton + TZ = 1; + + // SHA-256 + SHA256 = 2; +} + +// Checksum message +message Checksum { + ChecksumType type = 1; + bytes sum = 2; +} diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 196a867..305f2dd 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -18,7 +18,7 @@ message StorageGroup { // payloads of the storage group members // The order of concatenation is the same as the order of the members in the // Members field. - bytes validation_hash = 2; + Checksum validation_hash = 2; // expiration_epoch carries last NeoFS epoch number of the storage group // lifetime. From 762c9762ef88751dd34efefcfffcbbb5130e50e6 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 18 Aug 2020 18:41:25 +0300 Subject: [PATCH 176/440] [#56] Fix typos and regenerate docs Sorry =) Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 4 ++-- proto-docs/object.md | 8 +++++--- proto-docs/refs.md | 26 ++++++++++++++++++++++++++ proto-docs/storagegroup.md | 2 +- refs/types.proto | 3 +++ storagegroup/types.proto | 2 +- 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/object/types.proto b/object/types.proto index 9121d6d..5741dec 100644 --- a/object/types.proto +++ b/object/types.proto @@ -67,13 +67,13 @@ message Header { uint64 payload_length = 5; // Hash of payload bytes - Checksum payload_hash = 6; + neo.fs.v2.refs.Checksum payload_hash = 6; // Special object type ObjectType object_type = 7; // Homomorphic hash of the object payload. - Checksum homomorphic_hash = 8; + neo.fs.v2.refs.Checksum homomorphic_hash = 8; // Session token, if it was used during Object creation. // Need it to verify integrity and authenticity out of Request scope. diff --git a/proto-docs/object.md b/proto-docs/object.md index 2ec1b6c..729b3ea 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -219,6 +219,7 @@ Request body | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries address of the object that contains the requested payload range. | | ranges | [Range](#neo.fs.v2.object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | | salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | +| type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | @@ -242,7 +243,8 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| hash_list | [bytes](#bytes) | repeated | Carries list of homomorphic hashes in a binary format. | +| type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | +| hash_list | [bytes](#bytes) | repeated | List of range hashes in a binary format. | @@ -573,9 +575,9 @@ Object Headers | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | | payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | -| payload_hash | [bytes](#bytes) | | Hash of payload bytes | +| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | -| homomorphic_hash | [bytes](#bytes) | | Homomorphic hash of the object payload. | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index c892388..57d5157 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -7,6 +7,7 @@ - Messages - [Address](#neo.fs.v2.refs.Address) + - [Checksum](#neo.fs.v2.refs.Checksum) - [ContainerID](#neo.fs.v2.refs.ContainerID) - [ObjectID](#neo.fs.v2.refs.ObjectID) - [OwnerID](#neo.fs.v2.refs.OwnerID) @@ -39,6 +40,18 @@ Address of object (container id + object id) | object_id | [ObjectID](#neo.fs.v2.refs.ObjectID) | | object_id carries object identifier. | + + +### Message Checksum +Checksum message + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | +| sum | [bytes](#bytes) | | Checksum itself | + + ### Message ContainerID @@ -97,6 +110,19 @@ Represents API version used by node. + + + +### ChecksumType +Checksum algorithm type + +| Name | Number | Description | +| ---- | ------ | ----------- | +| CHECKSUM_TYPE_UNSPECIFIED | 0 | Unknown. Not used | +| TZ | 1 | Tillich-Zemor homomorphic hash funciton | +| SHA256 | 2 | SHA-256 | + + diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index b15925a..46dafdc 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -32,7 +32,7 @@ The storage group consists of objects from single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | -| validation_hash | [bytes](#bytes) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | +| validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | | expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | diff --git a/refs/types.proto b/refs/types.proto index 29ddd2a..8debfae 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -62,6 +62,9 @@ enum ChecksumType { // Checksum message message Checksum { + // Checksum algorithm type ChecksumType type = 1; + + // Checksum itself bytes sum = 2; } diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 305f2dd..5f17662 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -18,7 +18,7 @@ message StorageGroup { // payloads of the storage group members // The order of concatenation is the same as the order of the members in the // Members field. - Checksum validation_hash = 2; + neo.fs.v2.refs.Checksum validation_hash = 2; // expiration_epoch carries last NeoFS epoch number of the storage group // lifetime. From fc170f56bfc994be0ff59e914d13bdb5c63f18bf Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 19 Aug 2020 17:00:23 +0300 Subject: [PATCH 177/440] [#57] Merge service and session packages Merging session and service packages to increase clarity and reduce cross-dependencies. Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 10 ++--- container/service.proto | 50 +++++++++++----------- object/service.proto | 58 +++++++++++++------------- proto-docs/accounting.md | 8 ++-- proto-docs/container.md | 48 +++++++++++----------- proto-docs/object.md | 56 ++++++++++++------------- proto-docs/session.md | 85 ++++++++++++++++++++++++++++++++++++-- service/types.proto | 89 ---------------------------------------- session/service.proto | 10 ++--- session/types.proto | 79 +++++++++++++++++++++++++++++++++++ 10 files changed, 280 insertions(+), 213 deletions(-) delete mode 100644 service/types.proto diff --git a/accounting/service.proto b/accounting/service.proto index 1af4641..ee2f10b 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -7,7 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Accounting"; import "accounting/types.proto"; import "refs/types.proto"; -import "service/types.proto"; +import "session/types.proto"; // The service provides methods for obtaining information // about the account balance in NeoFS system. @@ -35,12 +35,12 @@ message BalanceRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Message defines the response body of Balance method. @@ -57,10 +57,10 @@ message BalanceResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/container/service.proto b/container/service.proto index 5c08c40..0e89377 100644 --- a/container/service.proto +++ b/container/service.proto @@ -8,7 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "acl/types.proto"; import "container/types.proto"; import "refs/types.proto"; -import "service/types.proto"; +import "session/types.proto"; // ContainerService provides API to access container smart-contract in morph chain // via NeoFS node. @@ -57,12 +57,12 @@ message PutRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // New NeoFS Container creation response @@ -77,12 +77,12 @@ message PutResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Container removal request @@ -101,12 +101,12 @@ message DeleteRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because delete operation is asynchronous and done @@ -119,12 +119,12 @@ message DeleteResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get container structure @@ -139,12 +139,12 @@ message GetRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get container structure @@ -159,12 +159,12 @@ message GetResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // List containers @@ -179,12 +179,12 @@ message ListRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // List containers @@ -200,12 +200,12 @@ message ListResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Set Extended ACL @@ -223,12 +223,12 @@ message SetExtendedACLRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Set Extended ACL @@ -241,12 +241,12 @@ message SetExtendedACLResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get Extended ACL @@ -262,12 +262,12 @@ message GetExtendedACLRequest { // Carries request meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get Extended ACL @@ -285,10 +285,10 @@ message GetExtendedACLResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/object/service.proto b/object/service.proto index dba34d6..15ce27f 100644 --- a/object/service.proto +++ b/object/service.proto @@ -7,7 +7,7 @@ option csharp_namespace = "NeoFS.API.v2.Object"; import "object/types.proto"; import "refs/types.proto"; -import "service/types.proto"; +import "session/types.proto"; // Object service provides API for manipulating with the object. service ObjectService { @@ -68,11 +68,11 @@ message GetRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // get object response @@ -104,12 +104,12 @@ message GetResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Put object request @@ -146,11 +146,11 @@ message PutRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Put object response @@ -166,12 +166,12 @@ message PutResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Object Delete request @@ -186,11 +186,11 @@ message DeleteRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // DeleteResponse is empty because we cannot guarantee permanent object removal @@ -204,12 +204,12 @@ message DeleteResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Object head request @@ -232,11 +232,11 @@ message HeadRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Head response @@ -257,12 +257,12 @@ message HeadResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Search objects request @@ -293,11 +293,11 @@ message SearchRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Search response @@ -312,12 +312,12 @@ message SearchResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Range groups the parameters of object payload range. @@ -345,11 +345,11 @@ message GetRangeRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get part of object's payload @@ -365,12 +365,12 @@ message GetRangeResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get hash of object's payload part @@ -394,11 +394,11 @@ message GetRangeHashRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get hash of object's payload part @@ -416,10 +416,10 @@ message GetRangeHashResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index f29c60b..202d639 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -68,8 +68,8 @@ according to the requirements from the system specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) | | Body of the balance request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -94,8 +94,8 @@ The amount of funds is calculated in decimal numbers. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) | | Body of the balance response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | diff --git a/proto-docs/container.md b/proto-docs/container.md index a36f4a6..587ddb2 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -133,8 +133,8 @@ Container removal request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) | | Body of container delete request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -159,8 +159,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) | | Body of container delete response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -179,8 +179,8 @@ Get Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) | | Body of get extended acl request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -203,8 +203,8 @@ Get Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) | | Body of get extended acl response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -228,8 +228,8 @@ Get container structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) | | Body of container get request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -252,8 +252,8 @@ Get container structure | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) | | Body of container get response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -276,8 +276,8 @@ List containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) | | Body of list containers request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -300,8 +300,8 @@ List containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) | | Body of list containers response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -324,8 +324,8 @@ New NeoFS Container creation request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) | | Body of container put request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -349,8 +349,8 @@ New NeoFS Container creation response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) | | Body of container put response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -373,8 +373,8 @@ Set Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) | | Body of set extended acl request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -398,8 +398,8 @@ Set Extended ACL | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) | | Body of set extended acl response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | diff --git a/proto-docs/object.md b/proto-docs/object.md index 729b3ea..ce47f3e 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -159,8 +159,8 @@ Object Delete request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) | | Body of delete object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -184,8 +184,8 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [DeleteResponse.Body](#neo.fs.v2.object.DeleteResponse.Body) | | Body of delete object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -204,8 +204,8 @@ Get hash of object's payload part | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRangeHashRequest.Body](#neo.fs.v2.object.GetRangeHashRequest.Body) | | Body of get range hash object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -231,8 +231,8 @@ Get hash of object's payload part | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRangeHashResponse.Body](#neo.fs.v2.object.GetRangeHashResponse.Body) | | Body of get range hash object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -256,8 +256,8 @@ Request to get part of object's payload | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRangeRequest.Body](#neo.fs.v2.object.GetRangeRequest.Body) | | Body of get range object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -281,8 +281,8 @@ Get part of object's payload | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRangeResponse.Body](#neo.fs.v2.object.GetRangeResponse.Body) | | Body of get range object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -305,8 +305,8 @@ Get object request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetRequest.Body](#neo.fs.v2.object.GetRequest.Body) | | Body of get object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -330,8 +330,8 @@ get object response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [GetResponse.Body](#neo.fs.v2.object.GetResponse.Body) | | Body of get object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -368,8 +368,8 @@ Object head request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) | | Body of head object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -394,8 +394,8 @@ Head response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) | | Body of head object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -419,8 +419,8 @@ Put object request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) | | Body of put object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -458,8 +458,8 @@ Put object response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) | | Body of put object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -494,8 +494,8 @@ Search objects request | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) | | Body of search object request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -533,8 +533,8 @@ Search response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) | | Body of search object response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | diff --git a/proto-docs/session.md b/proto-docs/session.md index 81ec58e..9a6ee57 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -18,9 +18,14 @@ - Messages - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) + - [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) + - [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) + - [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) + - [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) - [SessionToken](#neo.fs.v2.session.SessionToken) - [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) - [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) + - [XHeader](#neo.fs.v2.session.XHeader) - [Scalar Value Types](#scalar-value-types) @@ -64,8 +69,8 @@ CreateRequest carries an information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) | | Body of create session token request message. | -| meta_header | [neo.fs.v2.service.RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -89,8 +94,8 @@ CreateResponse carries an information about the opened session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body | [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) | | Body of create session token response message. | -| meta_header | [neo.fs.v2.service.ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.service.ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | +| meta_header | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -131,6 +136,66 @@ Context information for Session Tokens related to ObjectService requests | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | + + +### Message RequestMetaHeader +Information about the request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Client API version. | +| epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | +| ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | +| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Request X-Headers. | +| session_token | [SessionToken](#neo.fs.v2.session.SessionToken) | | Token is a token of the session within which the request is sent | +| bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | Bearer is a Bearer token of the request | +| origin | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | RequestMetaHeader of the origin request. | + + + + +### Message RequestVerificationHeader +Verification info for request signed by all intermediate nodes + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by request initiator. | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by any intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | +| origin | [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Chain of previous hops signatures | + + + + +### Message ResponseMetaHeader +Information about the response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Server API version. | +| epoch | [uint64](#uint64) | | Server local epoch number. | +| ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | +| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Response X-Headers. | +| origin | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta header of the origin response. | + + + + +### Message ResponseVerificationHeader +Verification info for response signed by all intermediate nodes + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by answering node. | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by any intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | +| origin | [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Chain of previous hops signatures | + + ### Message SessionToken @@ -170,6 +235,18 @@ Lifetime parameters of the token. Filed names taken from rfc7519. | nbf | [uint64](#uint64) | | Not valid before Epoch | | iat | [uint64](#uint64) | | Issued at Epoch | + + + +### Message XHeader +Extended headers for Request/Response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | | Key of the X-Header. | +| value | [string](#string) | | Value of the X-Header. | + diff --git a/service/types.proto b/service/types.proto deleted file mode 100644 index 3f9db75..0000000 --- a/service/types.proto +++ /dev/null @@ -1,89 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.service; - -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service"; -option csharp_namespace = "NeoFS.API.v2.Service"; - -import "acl/types.proto"; -import "refs/types.proto"; -import "session/types.proto"; - -// Extended headers for Request/Response -message XHeader { - // Key of the X-Header. - string key = 1; - - // Value of the X-Header. - string value = 2; -} - - -// Information about the request -message RequestMetaHeader { - // Client API version. - neo.fs.v2.refs.Version version = 1; - - // Client local epoch number. Set to 0 if unknown. - uint64 epoch = 2; - - // Maximum number of nodes in the request route. - uint32 ttl = 3; - - // Request X-Headers. - repeated XHeader x_headers = 4; - - // Token is a token of the session within which the request is sent - neo.fs.v2.session.SessionToken session_token = 5; - - // Bearer is a Bearer token of the request - neo.fs.v2.acl.BearerToken bearer_token = 6; - - // RequestMetaHeader of the origin request. - RequestMetaHeader origin = 7; -} - -// Information about the response -message ResponseMetaHeader { - // Server API version. - neo.fs.v2.refs.Version version = 1; - - // Server local epoch number. - uint64 epoch = 2; - - // Maximum number of nodes in the response route. - uint32 ttl = 3; - - // Response X-Headers. - repeated XHeader x_headers = 4; - - // Carries response meta header of the origin response. - ResponseMetaHeader origin = 5; -} - - -// Verification info for request signed by all intermediate nodes -message RequestVerificationHeader { - // Request Body signature. Should be generated once by request initiator. - neo.fs.v2.refs.Signature body_signature = 1; - // Request Meta signature is added and signed by any intermediate node - neo.fs.v2.refs.Signature meta_signature = 2; - // Sign previous hops - neo.fs.v2.refs.Signature origin_signature = 3; - - // Chain of previous hops signatures - RequestVerificationHeader origin = 4; -} - -// Verification info for response signed by all intermediate nodes -message ResponseVerificationHeader { - // Response Body signature. Should be generated once by answering node. - neo.fs.v2.refs.Signature body_signature = 1; - // Response Meta signature is added and signed by any intermediate node - neo.fs.v2.refs.Signature meta_signature = 2; - // Sign previous hops - neo.fs.v2.refs.Signature origin_signature = 3; - - // Chain of previous hops signatures - ResponseVerificationHeader origin = 4; -} diff --git a/session/service.proto b/session/service.proto index f04ebb7..5ecfe52 100644 --- a/session/service.proto +++ b/session/service.proto @@ -6,7 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; -import "service/types.proto"; +import "session/types.proto"; // Create Session record on Node side service SessionService { @@ -28,11 +28,11 @@ message CreateRequest { // Carries request meta information. Header data is used only to regulate message // transport and does not affect request execution. - neo.fs.v2.service.RequestMetaHeader meta_header = 2; + neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to authenticate // the nodes of the message route and check the correctness of transmission. - neo.fs.v2.service.RequestVerificationHeader verify_header = 3; + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // CreateResponse carries an information about the opened session. @@ -51,10 +51,10 @@ message CreateResponse { // Carries response meta information. Header data is used only to regulate // message transport and does not affect request execution. - neo.fs.v2.service.ResponseMetaHeader meta_header = 2; + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to // authenticate the nodes of the message route and check the correctness // of transmission. - neo.fs.v2.service.ResponseVerificationHeader verify_header = 3; + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/session/types.proto b/session/types.proto index 84ba10c..0f21b93 100644 --- a/session/types.proto +++ b/session/types.proto @@ -6,6 +6,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; +import "acl/types.proto"; // Context information for Session Tokens related to ObjectService requests message ObjectSessionContext { @@ -81,3 +82,81 @@ message SessionToken { // Signature is a signature of session token information neo.fs.v2.refs.Signature signature = 2; } + +// Extended headers for Request/Response +message XHeader { + // Key of the X-Header. + string key = 1; + + // Value of the X-Header. + string value = 2; +} + + +// Information about the request +message RequestMetaHeader { + // Client API version. + neo.fs.v2.refs.Version version = 1; + + // Client local epoch number. Set to 0 if unknown. + uint64 epoch = 2; + + // Maximum number of nodes in the request route. + uint32 ttl = 3; + + // Request X-Headers. + repeated XHeader x_headers = 4; + + // Token is a token of the session within which the request is sent + SessionToken session_token = 5; + + // Bearer is a Bearer token of the request + neo.fs.v2.acl.BearerToken bearer_token = 6; + + // RequestMetaHeader of the origin request. + RequestMetaHeader origin = 7; +} + +// Information about the response +message ResponseMetaHeader { + // Server API version. + neo.fs.v2.refs.Version version = 1; + + // Server local epoch number. + uint64 epoch = 2; + + // Maximum number of nodes in the response route. + uint32 ttl = 3; + + // Response X-Headers. + repeated XHeader x_headers = 4; + + // Carries response meta header of the origin response. + ResponseMetaHeader origin = 5; +} + +// Verification info for request signed by all intermediate nodes +message RequestVerificationHeader { + // Request Body signature. Should be generated once by request initiator. + neo.fs.v2.refs.Signature body_signature = 1; + // Request Meta signature is added and signed by any intermediate node + neo.fs.v2.refs.Signature meta_signature = 2; + // Sign previous hops + neo.fs.v2.refs.Signature origin_signature = 3; + + // Chain of previous hops signatures + RequestVerificationHeader origin = 4; +} + +// Verification info for response signed by all intermediate nodes +message ResponseVerificationHeader { + // Response Body signature. Should be generated once by answering node. + neo.fs.v2.refs.Signature body_signature = 1; + // Response Meta signature is added and signed by any intermediate node + neo.fs.v2.refs.Signature meta_signature = 2; + // Sign previous hops + neo.fs.v2.refs.Signature origin_signature = 3; + + // Chain of previous hops signatures + ResponseVerificationHeader origin = 4; +} From e72dceebd34498303a249945264619ebf019bf3a Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 31 Aug 2020 13:56:03 +0300 Subject: [PATCH 178/440] [#62] Put NodeInfo public_key field first To simplify decoding of NodeInfo structure inside netmap smart contract, the first field, also used as a storage key inside contract, has to be of the fixed length. Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 8 ++++---- proto-docs/netmap.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index 7e1dd42..ae424c5 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -92,11 +92,11 @@ message PlacementPolicy { // NeoFS node description message NodeInfo { - // Ways to connect to a node - string address = 1; - // Public key of the NeoFS node in a binary format. - bytes public_key = 2; + bytes public_key = 1; + + // Ways to connect to a node + string address = 2; // Attributes of the NeoFS node. message Attribute { diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index d375b12..152e507 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -37,8 +37,8 @@ NeoFS node description | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [string](#string) | | Ways to connect to a node | | public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format. | +| address | [string](#string) | | Ways to connect to a node | | attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | | state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node. | From c8054c5daa5c3cde462792264f4e960b27ea9415 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Sun, 23 Aug 2020 14:42:01 +0300 Subject: [PATCH 179/440] [#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 --- netmap/types.proto | 168 +++++++++++++++++++++++-------------------- object/service.proto | 6 +- proto-docs/netmap.md | 93 ++++++++++-------------- 3 files changed, 129 insertions(+), 138 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index ae424c5..40bad0b 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -5,89 +5,95 @@ package neo.fs.v2.netmap; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "NeoFS.API.v2.Netmap"; +// Operations on filters +enum Operation { + // No Operation defined + OPERATION_UNSPECIFIED = 0; + + // Equal + EQ = 1; + + // Not Equal + NE = 2; + + // Greater then + GT = 3; + + // Greater or equal + GE = 4; + + // Less then + LT = 5; + + // Less or equal + LE = 6; + + // Logical OR + OR = 7; + + // Logical AND + AND = 8; +} + +// Filter +message Filter { + // Name of the filter or a reference to the named filter. + // '*' means application to the whole unfiltered NetworkMap + // At top level it's used as a filter name. At lower levels it's considered to + // be a reference to another named filter + string name = 1; + + // Key to filter + string key = 2; + + // Filtering operation + Operation op = 3; + + // Value to match + string value = 4; + + // List of inner filters. Top level operation will be applied to the whole list. + repeated Filter filters = 5; +} + +// Selector +message Selector { + // Selector name to reference in object placement section + string name = 1; + + // How many nodes to select from bucket + uint32 count = 2; + + // Attribute bucket to select from + string attribute = 3; + + // Filter reference to select from + string filter = 4; +} + +// Exact bucket for each replica +message Replica { + // How many object replicas to put + uint32 count = 1; + + // Named selector bucket to put in + string selector = 2; +} + // Set of rules to select a subset of nodes able to store container's objects message PlacementPolicy { - // Replication factor - uint32 repl_factor = 1; + // Rules to set number of object replicas and place each one into a particular bucket + repeated Replica replicas = 1; - // Filters to apply to Network Map - message FilterGroup { - // Filter definition - message Filter { - // Filter identifier - string key = 1; + // Container backup factor controls how deep NeoFS will search for nodes + // alternatives to include into container. + uint32 container_backup_factor = 2; - // Minimal simple filter - message SimpleFilter { - // Filtering operation - enum Operation { - // No Operation defined - OPERATION_UNSPECIFIED= 0; + // Set of Selectors to form the container's nodes subset + repeated Selector selectors = 3; - // Equal - EQ = 1; - - // Not Equal - NE = 2; - - // Greater then - GT = 3; - - // Greater or equal - GE = 4; - - // Less then - LT = 5; - - // Less or equal - LE = 6; - - // Logical OR - OR = 7; - - // Logical AND - AND = 8; - } - // Filtering operation - Operation op = 1; - - // List of filters - message SimpleFilters { - // List of filters - repeated SimpleFilter filters = 1; - } - - // Filtering operation argument - oneof args { - // Value - string value = 2; - // Result of other filter application - SimpleFilters f_args = 3; - } - } - // The rest of filter - SimpleFilter f = 2; - } - - // Resulting filter list - repeated Filter filters = 1; - - // Selector - message Selector { - // How many to select - uint32 count = 1; - // Key to select - string key = 2; - } - - // List of selectors - repeated Selector selectors = 2; - - // Parts of graph to exclude. Internal use. - repeated uint32 exclude = 3; - } - // List of filter groups - repeated FilterGroup filter_groups = 2; + // List of named filters to reference in selectors + repeated Filter filters = 4; } // NeoFS node description @@ -105,6 +111,10 @@ message NodeInfo { // Value of the node attribute. string value = 2; + + // Parent keys, if any + // Example: For City it can be Region or Country + repeated string parents = 3; } // Carries list of the NeoFS node attributes in a string key-value format. repeated Attribute attributes = 3; @@ -112,7 +122,7 @@ message NodeInfo { // Represents the enumeration of various states of the NeoFS node. enum State { // Unknown state. - UNSPECIFIED = 0; + UNSPECIFIED = 0; // Active state in the network. ONLINE = 1; diff --git a/object/service.proto b/object/service.proto index 15ce27f..e14b0c8 100644 --- a/object/service.proto +++ b/object/service.proto @@ -85,7 +85,7 @@ message GetResponse { neo.fs.v2.refs.ObjectID object_id = 1; // Object signature - neo.fs.v2.refs.Signature signature =2; + neo.fs.v2.refs.Signature signature = 2; // Object header. Header header = 3; @@ -93,7 +93,7 @@ message GetResponse { // Carries the single message of the response stream. oneof object_part { // Initialization parameters of the object stream. - Init init =1; + Init init = 1; // Part of the object payload. bytes chunk = 2; @@ -122,7 +122,7 @@ message PutRequest { neo.fs.v2.refs.ObjectID object_id = 1; // Object signature, were available - neo.fs.v2.refs.Signature signature =2; + neo.fs.v2.refs.Signature signature = 2; // Header of the object to save in the system. Header header = 3; diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 152e507..5d1059d 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -6,14 +6,12 @@ - [netmap/types.proto](#netmap/types.proto) - Messages + - [Filter](#neo.fs.v2.netmap.Filter) - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) - - [PlacementPolicy.FilterGroup](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup) - - [PlacementPolicy.FilterGroup.Filter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter) - - [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) - - [PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters) - - [PlacementPolicy.FilterGroup.Selector](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Selector) + - [Replica](#neo.fs.v2.netmap.Replica) + - [Selector](#neo.fs.v2.netmap.Selector) - [Scalar Value Types](#scalar-value-types) @@ -29,6 +27,21 @@ + + +### Message Filter +Filter + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | Name of the filter or a reference to the named filter. '*' means application to the whole unfiltered NetworkMap At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | +| key | [string](#string) | | Key to filter | +| op | [Operation](#neo.fs.v2.netmap.Operation) | | Filtering operation | +| value | [string](#string) | | Value to match | +| filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of inner filters. Top level operation will be applied to the whole list. | + + ### Message NodeInfo @@ -53,6 +66,7 @@ Attributes of the NeoFS node. | ----- | ---- | ----- | ----------- | | key | [string](#string) | | Key of the node attribute. | | value | [string](#string) | | Value of the node attribute. | +| parents | [string](#string) | repeated | Parent keys, if any Example: For City it can be Region or Country | @@ -63,69 +77,36 @@ Set of rules to select a subset of nodes able to store container's objects | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| repl_factor | [uint32](#uint32) | | Replication factor | -| filter_groups | [PlacementPolicy.FilterGroup](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup) | repeated | List of filter groups | +| replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a particular bucket | +| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container. | +| selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | +| filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | - + -### Message PlacementPolicy.FilterGroup -Filters to apply to Network Map +### Message Replica +Exact bucket for each replica | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| filters | [PlacementPolicy.FilterGroup.Filter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter) | repeated | Resulting filter list | -| selectors | [PlacementPolicy.FilterGroup.Selector](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Selector) | repeated | List of selectors | -| exclude | [uint32](#uint32) | repeated | Parts of graph to exclude. Internal use. | +| count | [uint32](#uint32) | | How many object replicas to put | +| selector | [string](#string) | | Named selector bucket to put in | - + -### Message PlacementPolicy.FilterGroup.Filter -Filter definition - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Filter identifier | -| f | [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) | | The rest of filter | - - - - -### Message PlacementPolicy.FilterGroup.Filter.SimpleFilter -Minimal simple filter - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| op | [PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation) | | Filtering operation | -| value | [string](#string) | | Value | -| f_args | [PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters) | | Result of other filter application | - - - - -### Message PlacementPolicy.FilterGroup.Filter.SimpleFilter.SimpleFilters -List of filters - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| filters | [PlacementPolicy.FilterGroup.Filter.SimpleFilter](#neo.fs.v2.netmap.PlacementPolicy.FilterGroup.Filter.SimpleFilter) | repeated | List of filters | - - - - -### Message PlacementPolicy.FilterGroup.Selector +### Message Selector Selector | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| count | [uint32](#uint32) | | How many to select | -| key | [string](#string) | | Key to select | +| name | [string](#string) | | Selector name to reference in object placement section | +| count | [uint32](#uint32) | | How many nodes to select from bucket | +| attribute | [string](#string) | | Attribute bucket to select from | +| filter | [string](#string) | | Filter reference to select from | @@ -143,10 +124,10 @@ Represents the enumeration of various states of the NeoFS node. - + -### PlacementPolicy.FilterGroup.Filter.SimpleFilter.Operation -Filtering operation +### Operation +Operations on filters | Name | Number | Description | | ---- | ------ | ----------- | From 79baf3b63799544c120ef3b63b2081b7ae193e3c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 2 Sep 2020 13:53:44 +0300 Subject: [PATCH 180/440] [#61] acl: Add version field to eACL Table eACL Table is stored in SC storage, hence format version may be needed to correctly process it in future. Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 8 ++++++-- proto-docs/acl.md | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index ae29abc..b9beb14 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -126,12 +126,16 @@ message EACLRecord { // EACLRecord carries the information about extended ACL rules. message EACLTable { + // eACL format version. + // Effectively the version of API library used to create eACL Table + neo.fs.v2.refs.Version version = 1; + // Carries identifier of the container that should use given // access control rules. - neo.fs.v2.refs.ContainerID container_id = 1 [json_name="ContainerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [json_name="ContainerID"]; // Records carries list of extended ACL rule records. - repeated EACLRecord records = 2 [json_name="Records"]; + repeated EACLRecord records = 3 [json_name="Records"]; } // BearerToken has information about request ACL rules with limited lifetime diff --git a/proto-docs/acl.md b/proto-docs/acl.md index f3f14c7..933ff16 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -114,6 +114,7 @@ EACLRecord carries the information about extended ACL rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | eACL format version. Effectively the version of API library used to create eACL Table | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | | records | [EACLRecord](#neo.fs.v2.acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | From b1699548065638b9c5962e703df025d10767194f Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 2 Sep 2020 14:06:21 +0300 Subject: [PATCH 181/440] acl: Fix naming mismatch Field naming was different in protobuf and JSON notation. Fixed to avoid confusion. Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 24 ++++++++++++------------ proto-docs/acl.md | 32 ++++++++++++++++---------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index b9beb14..b19fbdc 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -7,10 +7,10 @@ option csharp_namespace = "NeoFS.API.v2.Acl"; import "refs/types.proto"; -// Target of the access control rule in access control list. -enum Target { - // Unspecified target, default value. - TARGET_UNSPECIFIED= 0; +// Target role of the access control rule in access control list. +enum Role { + // Unspecified role, default value. + ROLE_UNSPECIFIED= 0; // User target rule is applied if sender is the owner of the container. USER = 1; @@ -94,10 +94,10 @@ message EACLRecord { // Action carries ACL target action. Action action = 2 [json_name = "Action"]; - // FilterInfo groups information about filter. - message FilterInfo { + // Filter definition + message Filter { // Header carries type of header. - HeaderType header = 1 [json_name = "HeaderType"]; + HeaderType header_type = 1 [json_name = "HeaderType"]; // MatchType carries type of match. MatchType match_type = 2 [json_name = "MatchType"]; @@ -110,18 +110,18 @@ message EACLRecord { } // filters carries set of filters. - repeated FilterInfo filters = 3 [json_name="Filters"]; + repeated Filter filters = 3 [json_name="Filters"]; - // TargetInfo groups information about extended ACL target. - message TargetInfo { + // Information about extended ACL target. + message Target { // target carries target of ACL rule. - Target target = 1 [json_name="Role"]; + Role role = 1 [json_name="Role"]; // key_list carries public keys of ACL target. repeated bytes key_list = 2 [json_name="Keys"]; } // targets carries information about extended ACL target list. - repeated TargetInfo targets = 4 [json_name="Targets"]; + repeated Target targets = 4 [json_name="Targets"]; } // EACLRecord carries the information about extended ACL rules. diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 933ff16..9707195 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -10,8 +10,8 @@ - [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) - [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) - [EACLRecord](#neo.fs.v2.acl.EACLRecord) - - [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) - - [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) + - [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) + - [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) - [EACLTable](#neo.fs.v2.acl.EACLTable) @@ -76,33 +76,33 @@ EACLRecord groups information about extended ACL rule. | ----- | ---- | ----- | ----------- | | operation | [Operation](#neo.fs.v2.acl.Operation) | | Operation carries type of operation. | | action | [Action](#neo.fs.v2.acl.Action) | | Action carries ACL target action. | -| filters | [EACLRecord.FilterInfo](#neo.fs.v2.acl.EACLRecord.FilterInfo) | repeated | filters carries set of filters. | -| targets | [EACLRecord.TargetInfo](#neo.fs.v2.acl.EACLRecord.TargetInfo) | repeated | targets carries information about extended ACL target list. | +| filters | [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) | repeated | filters carries set of filters. | +| targets | [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) | repeated | targets carries information about extended ACL target list. | - + -### Message EACLRecord.FilterInfo -FilterInfo groups information about filter. +### Message EACLRecord.Filter +Filter definition | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Header carries type of header. | +| header_type | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Header carries type of header. | | match_type | [MatchType](#neo.fs.v2.acl.MatchType) | | MatchType carries type of match. | | header_name | [string](#string) | | header_name carries name of filtering header. | | header_val | [string](#string) | | header_val carries value of filtering header. | - + -### Message EACLRecord.TargetInfo -TargetInfo groups information about extended ACL target. +### Message EACLRecord.Target +Information about extended ACL target. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| target | [Target](#neo.fs.v2.acl.Target) | | target carries target of ACL rule. | +| role | [Role](#neo.fs.v2.acl.Role) | | target carries target of ACL rule. | | key_list | [bytes](#bytes) | repeated | key_list carries public keys of ACL target. | @@ -178,14 +178,14 @@ Operation is an enumeration of operation types. - + -### Target -Target of the access control rule in access control list. +### Role +Target role of the access control rule in access control list. | Name | Number | Description | | ---- | ------ | ----------- | -| TARGET_UNSPECIFIED | 0 | Unspecified target, default value. | +| ROLE_UNSPECIFIED | 0 | Unspecified role, default value. | | USER | 1 | User target rule is applied if sender is the owner of the container. | | SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | | OTHERS | 3 | Others target rule is applied if sender is not user or system target. | From eab2210ffea8da83961fb83c24f32b61733849a5 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 3 Sep 2020 12:19:02 +0300 Subject: [PATCH 182/440] [#59] netmap: Add LocalNodeInfo request This should be used as a handshake to know API Version supported by peer and to update local netmap view in future. Signed-off-by: Stanislav Bogatyrev --- netmap/service.proto | 57 ++++++++++++++++++++++++++++ proto-docs/netmap.md | 89 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 netmap/service.proto diff --git a/netmap/service.proto b/netmap/service.proto new file mode 100644 index 0000000..a388148 --- /dev/null +++ b/netmap/service.proto @@ -0,0 +1,57 @@ +syntax = "proto3"; + +package neo.fs.v2.netmap; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; +option csharp_namespace = "NeoFS.API.v2.Netmap"; + +import "netmap/types.proto"; +import "refs/types.proto"; +import "session/types.proto"; + +// Methods to work with NetworkMap +service NetmapService { + // Return information about Node + rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); +} + +// Get NodeInfo from the particular node directly +message LocalNodeInfoRequest { + //Request body + message Body { + } + // Body of the balance request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Local nod Info, including API Version in use +message LocalNodeInfoResponse { + //Response body + message Body { + // API version in use + neo.fs.v2.refs.Version version = 1; + + // NodeInfo from node itself + NodeInfo node_info = 2; + } + // Body of the balance response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness + // of transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 5d1059d..9315cfe 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -3,6 +3,17 @@ ## Table of Contents +- [netmap/service.proto](#netmap/service.proto) + - Services + - [NetmapService](#neo.fs.v2.netmap.NetmapService) + + - Messages + - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) + - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) + - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) + - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) + + - [netmap/types.proto](#netmap/types.proto) - Messages @@ -18,6 +29,84 @@ + +

Top

+ +## netmap/service.proto + + + + + + +### Service "neo.fs.v2.netmap.NetmapService" +Methods to work with NetworkMap + +``` +rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); + +``` + +#### Method LocalNodeInfo + +Return information about Node + +| Name | Input | Output | +| ---- | ----- | ------ | +| LocalNodeInfo | [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) | [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) | + + + + + +### Message LocalNodeInfoRequest +Get NodeInfo from the particular node directly + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) | | Body of the balance request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message LocalNodeInfoRequest.Body +Request body + + + + + +### Message LocalNodeInfoResponse +Local nod Info, including API Version in use + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) | | Body of the balance response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect response execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message LocalNodeInfoResponse.Body +Response body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | API version in use | +| node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo from node itself | + + + + + + +

Top

From a07a518a1e8e802fe2c90814068ec932bead30dc Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 3 Sep 2020 15:55:39 +0300 Subject: [PATCH 183/440] [#66] object: Add object_id signature to Head response Object ID signature is needed to check Header authenticity. Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 6 ++++++ proto-docs/object.md | 1 + 2 files changed, 7 insertions(+) diff --git a/object/service.proto b/object/service.proto index e14b0c8..f6a47a6 100644 --- a/object/service.proto +++ b/object/service.proto @@ -250,6 +250,12 @@ message HeadResponse { // Short object header ShortHeader short_header = 2; + + // Signed object_id to verify full header's authenticity through following steps: + // 1. Calculate SHA-256 of marshalled Headers structure. + // 2. Check if the resulting hash matched ObjectID + // 3. Check if ObjectID's signature in signature field is correct. + neo.fs.v2.refs.Signature signature = 3; } } // Body of head object response message. diff --git a/proto-docs/object.md b/proto-docs/object.md index ce47f3e..5ac2bbb 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -408,6 +408,7 @@ Response body | ----- | ---- | ----- | ----------- | | header | [Header](#neo.fs.v2.object.Header) | | Full object header | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id to verify full header's authenticity through following steps: 1. Calculate SHA-256 of marshalled Headers structure. 2. Check if the resulting hash matched ObjectID 3. Check if ObjectID's signature in signature field is correct. | From 4aea595cc6ab836b168ddf0b0ab9ef9cd94ec930 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 4 Sep 2020 11:09:22 +0300 Subject: [PATCH 184/440] [#67] Use tuple of header and signature in object head response Object.Head method returns either full header or short header. Since it can't return anything else, signature must be paired with full header in explicit tuple message. Signed-off-by: Alex Vanin --- object/service.proto | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/object/service.proto b/object/service.proto index f6a47a6..1a12d4e 100644 --- a/object/service.proto +++ b/object/service.proto @@ -239,23 +239,29 @@ message HeadRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } +// Tuple of full object header and signature of object ID. +message HeaderWithSignature { + // Full object header + Header header = 1; + + // Signed object_id to verify full header's authenticity through following steps: + // 1. Calculate SHA-256 of marshalled Headers structure. + // 2. Check if the resulting hash matched ObjectID + // 3. Check if ObjectID's signature in signature field is correct. + neo.fs.v2.refs.Signature signature = 2; +} + // Head response message HeadResponse { // Response body message Body { // Carries the requested object header or it's part oneof head{ - // Full object header - Header header = 1; + // Full object header with object ID signature + Header HeaderWithSignature = 1; // Short object header ShortHeader short_header = 2; - - // Signed object_id to verify full header's authenticity through following steps: - // 1. Calculate SHA-256 of marshalled Headers structure. - // 2. Check if the resulting hash matched ObjectID - // 3. Check if ObjectID's signature in signature field is correct. - neo.fs.v2.refs.Signature signature = 3; } } // Body of head object response message. From 6014665fa65ff93214bc2e7ac1833bf932f467ca Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 15:50:18 +0300 Subject: [PATCH 185/440] [#67] Typo fixes Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 2 +- proto-docs/object.md | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/object/service.proto b/object/service.proto index 1a12d4e..020e1d5 100644 --- a/object/service.proto +++ b/object/service.proto @@ -258,7 +258,7 @@ message HeadResponse { // Carries the requested object header or it's part oneof head{ // Full object header with object ID signature - Header HeaderWithSignature = 1; + HeaderWithSignature header = 1; // Short object header ShortHeader short_header = 2; diff --git a/proto-docs/object.md b/proto-docs/object.md index 5ac2bbb..941bca9 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -29,6 +29,7 @@ - [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) - [HeadResponse](#neo.fs.v2.object.HeadResponse) - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) + - [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) - [PutRequest](#neo.fs.v2.object.PutRequest) - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) @@ -406,8 +407,19 @@ Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [Header](#neo.fs.v2.object.Header) | | Full object header | +| header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object header with object ID signature | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | + + + + +### Message HeaderWithSignature +Tuple of full object header and signature of object ID. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| header | [Header](#neo.fs.v2.object.Header) | | Full object header | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id to verify full header's authenticity through following steps: 1. Calculate SHA-256 of marshalled Headers structure. 2. Check if the resulting hash matched ObjectID 3. Check if ObjectID's signature in signature field is correct. | From 3eab0c4b22e764417e819bca9318c2fed78e6490 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 09:28:14 +0300 Subject: [PATCH 186/440] Add changelog for Jindo Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84772ce..6e2d012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,57 @@ # Changelog +## [2.0.0] - 2020-09-04 - Jindo (진도, 珍島) + +Major API refactoring and simplification. + +### Added +- `neo.fs.v2` prefix added to all package names +- `container.Attributes` field added +- `refs.ContainerID` added as a separate type +- `refs.OwnerID` added as a separate type +- Object Search query language defined in `object.SearchRequest.Body.filter` +- `netmap` package added +- `refs.Signature` defined as a separate type +- `session.SessionToken` now has context information for each service +- `refs.Version` defined as a separate type +- `refs.Version` field added to all messages stored in SmartContracts +- `refs.Checksum` defined as a separate type +- `netmap.LocalNodeInfo` request added to get actual information from connected peer + +### Changed +- Extended ACL Table format changed +- Protobuf definitions style changed to follow Google Style Guide +- `System` and `Extended` Object headers are merged into on `object.Header` type +- `object.UserHeader` renamed to `object.Header.Attribute` +- `refs.ObjectID` is now a hash of the `object.Header` field, which contains hash of payload +- `StorageGroup` information moved to Object's payload +- `netmap.NodeInfo.options` renamed to `netmap.NodeInfo.attributes` and it uses a + separate `netmap.NodeInfo.Attribute` type now. +- `netmap.NodeInfo.Attribute` type now has a list of parents to construct a tree +- Session Token renamed to `session.SessionToken` from `session.Token` +- All Requests and Responses now have a common "body-meta-verify" structure +- Meta and Verification headers now follow Matryoshka-style composition +- SessionToken and BearerToken are now part of Meta header +- Object placement policy format is simplified and defined in `netmap` package +- `object.Head()` request now returns either short header or full header with a signature + +### Removed +- gogoproto is not used anymore +- `decimal` package merged into `accounting` package +- `query` package merged into `object` package +- `storagegroup` package merged into `object` package +- `bootstrap` package merged into `netmap` package +- `state` package removed +- `service` package removed. Merged with `session` package +- `state` package removed. It will be implementation specific part of neofs-node +- `SpreadMap` functionality removed from `netmap` package +- Unixtime support removed from creation timestamps, leaving only Epoch number +- `Link` type removed from Object headers +- `Redirect` type support removed from Object headers +- Withdrawal and Account Lock functionality removed from `accounting` service +- Deposit functionality removed from `accounting` service +- Settlement functionality removed from `accounting` service + ## [1.2.0] - 2020-07-08 ### Added @@ -111,3 +163,4 @@ Bump major release [1.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v0.7.5...v1.0.0 [1.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.0.0...v1.1.0 [1.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.1.0...v1.2.0 +[2.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.2.0...v2.0.0 From 2f808917d1422d430258a465f1cf38c0a419d644 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 09:45:46 +0300 Subject: [PATCH 187/440] Add README.md Signed-off-by: Stanislav Bogatyrev --- .github/logo.svg | 129 +++++++++++++++++++++++++++++++++++++++++++++++ README.md | 112 ++++++++-------------------------------- 2 files changed, 149 insertions(+), 92 deletions(-) create mode 100644 .github/logo.svg diff --git a/.github/logo.svg b/.github/logo.svg new file mode 100644 index 0000000..b4da076 --- /dev/null +++ b/.github/logo.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index d8d0c3d..17e6e44 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,37 @@ -# NeoFS-API +

+NeoFS +

+

+ NeoFS API language-agnostic protocol definitions +

-NeoFS-API repository contains language-agnostic -[protocol buffers](https://developers.google.com/protocol-buffers) definitions -of neofs-node structures and services. +--- +![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/neofs-api?sort=semver) +![License](https://img.shields.io/github/license/nspcc-dev/neofs-api.svg?style=popout) -## Description +## Overview NeoFS-API repository is the basis for language-specific libraries, e.g.: - [neofs-api-go](https://github.com/nspcc-dev/neofs-api-go) - [neofs-api-csharp](https://github.com/nspcc-dev/neofs-api-csharp) -These libraries contain compiled protocol buffers code, defined in this -repository. Use them to integrate applications with NeoFS. +Those libraries contain compiled protocol buffers definitions, wrapped with +language-specific code. Use them to integrate applications with NeoFS. This repository contains: -- 12 protocol buffers packages, -- [auto-generated docs](proto-docs) for protocol buffers, -- [manually written docs](docs) for developers (to be done). +- protocol buffers packages +- [auto-generated docs](proto-docs) for protocol buffers +- [manually written docs](docs) for developers (to be done) +# Contributing -### Protocol packages +Feel free to contribute to this project after reading the [contributing +guidelines](CONTRIBUTING.md). -#### Accounting - -Accounting package defines services and structures for balance request and -`cheque` operations. - -See: - -- [Accounting service](proto-docs/accounting.md#accounting.Accounting) -- [Withdraw service](proto-docs/accounting.md#accounting.Withdraw) - -#### ACL - -ACL package defines targets of access control rules. - -#### Bootstrap - -Bootstrap package defines bootstrap service that connects storage nodes -to the network. - -See: - -- [Bootstrap service](proto-docs/bootstrap.md#bootstrap.Bootstrap) - - -#### Container - -Container package defines service and structure of containers. NeoFS stores -objects within the registered container according to a specified storage policy. - -See: - -- [Container service](proto-docs/container.md#container.Service) - -#### Decimal - -Decimal defines structure for encoding assets amount. - -#### Object - -Object is the storage unit in NeoFS. Object package defines structure of the -object and service requests. - -See: - -- [Object service](proto-docs/object.md#object.Service) - -#### Query - -Query package defines structure for object search requests. - -#### Refs - -Refs package defines identity types: object id, container id, etc. - -#### Service - -Service package defines utility structures for all public API requests: -TTL, request signature, etc. - -#### Session - -Session package defines service and structures to setup session between -the node and the client. Session token is required in some object service -requests. Node uses session private key to re-sign new objects and requests. - -See: - -- [Session service](proto-docs/session.md#session.Session) - -#### State - -State package defines service and structures for metrics gathering. - -See: - -- [Status service](proto-docs/state.md#state.Status) - -#### StorageGroup - -Storagegroup package defines structure that contains meta data for data audit. -This meta data stored as a header in the NeoFS object. +Before starting to work on a certain topic, create an new issue first, +describing the feature/topic you are going to implement. ## License From 7f539a57850737f66f06bd9c53adf2347cc34cd4 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 15:17:53 +0300 Subject: [PATCH 188/440] Add contribution guide Signed-off-by: Stanislav Bogatyrev --- CONTRIBUTING.md | 152 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..60bd875 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,152 @@ +# Contribution guide + +First, thank you for contributing! We love and encourage pull requests from +everyone. Please follow the guidelines: + +- Check the open [issues](https://github.com/nspcc-dev/neofs-api/issues) and + [pull requests](https://github.com/nspcc-dev/neofs-api/pulls) for existing + discussions. + +- Open an issue first, to discuss a new feature or enhancement. + +- Open a pull request, and reference the relevant issue(s). + +- Make sure your commits are logically separated and have good comments + explaining the details of your change. + +- After receiving feedback, amend your commits or add new ones as + appropriate. + +- **Have fun!** + +## Development Workflow + +Start by forking the `neofs-api` repository, make changes in a branch and then +send a pull request. We encourage pull requests to discuss code changes. Here +are the steps in details: + +### Setup your GitHub Repository +Fork [NeoFS node upstream](https://github.com/nspcc-dev/neofs-api/fork) source +repository to your own personal repository. Copy the URL of your fork (you will +need it for the `git clone` command below). + +```sh +$ git clone https://github.com/nspcc-dev/neofs-api +``` + +### Set up git remote as ``upstream`` +```sh +$ cd neofs-api +$ git remote add upstream https://github.com/nspcc-dev/neofs-api +$ git fetch upstream +$ git merge upstream/master +... +``` + +### Create your feature branch +Before making code changes, make sure you create a separate branch for these +changes. Maybe you will find it convenient to name branch in +`/-` format. + +``` +$ git checkout -b feature/123-something_awesome +``` + +### Test your changes +After your code changes, make sure + +- To add test cases for the new code. +- To run `make lint` +- To squash your commits into a single commit or a series of logically separated + commits run `git rebase -i`. It's okay to force update your pull request. + +### Commit changes +After verification, commit your changes. This is a [great +post](https://chris.beams.io/posts/git-commit/) on how to write useful commit +messages. Try following this template: + +``` +[#Issue] Summary + +Description + + + + +``` + +``` +$ git commit -am '[#123] Add some feature' +``` + +### Push to the branch +Push your locally committed changes to the remote origin (your fork) +``` +$ git push origin feature/123-something_awesome +``` + +### Create a Pull Request +Pull requests can be created via GitHub. Refer to [this +document](https://help.github.com/articles/creating-a-pull-request/) for +detailed steps on how to create a pull request. After a Pull Request gets peer +reviewed and approved, it will be merged. + +## DCO Sign off + +All authors to the project retain copyright to their work. However, to ensure +that they are only submitting work that they have rights to, we are requiring +everyone to acknowledge this by signing their work. + +Any copyright notices in this repository should specify the authors as "the +contributors". + +To sign your work, just add a line like this at the end of your commit message: + +``` +Signed-off-by: Samii Sakisaka +``` + +This can easily be done with the `--signoff` option to `git commit`. + +By doing this you state that you can certify the following (from [The Developer +Certificate of Origin](https://developercertificate.org/): + +``` +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` From 153d29d371de09e2b64086b05e84bf781d937dc5 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 15:33:16 +0300 Subject: [PATCH 189/440] Add credits file Signed-off-by: Stanislav Bogatyrev --- CREDITS.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CREDITS.md diff --git a/CREDITS.md b/CREDITS.md new file mode 100644 index 0000000..bb4b97a --- /dev/null +++ b/CREDITS.md @@ -0,0 +1,26 @@ +# Credits + +Initial NeoFS research and development (2018-2020) was done by +[NeoSPCC](https://nspcc.ru) team. + +In alphabetical order: + +- Alexey Vanin +- Anastasia Prasolova +- Anatoly Bogatyrev +- Evgeny Kulikov +- Evgeny Stratonikov +- Leonard Liubich +- Sergei Liubich +- Stanislav Bogatyrev + +# Contributors + +In chronological order: + +# Special Thanks + +For product development support: + +- Fabian Wahle +- Neo Global Development From 84907f6b04e6031680fb3b835be42e5573ce29c5 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 4 Sep 2020 20:10:21 +0300 Subject: [PATCH 190/440] Add Pavel Korotkov to contributors Signed-off-by: Stanislav Bogatyrev --- CREDITS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.md b/CREDITS.md index bb4b97a..6d45ff2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -17,6 +17,7 @@ In alphabetical order: # Contributors In chronological order: +- Pavel Korotkov # Special Thanks From ea61d4e0e98d735bfaddb76d79dd61331198cab5 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 7 Sep 2020 14:32:37 +0300 Subject: [PATCH 191/440] [#68] Add SAME|DISTINCT selector clause Helps to define how selection is formed Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 21 +++++++++++++++++++-- proto-docs/netmap.md | 16 ++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index 40bad0b..e7f0ae7 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -35,6 +35,20 @@ enum Operation { AND = 8; } +// Selector modifier showing how the node set will be formed +// By default selector just groups by attribute into a bucket selecting nodes +// only by their hash distance. +enum Clause{ + // No modifier defined. Will select nodes from bucket randomly. + CLAUSE_UNSPECIFIED = 0; + + // SAME will select only nodes having the same value of bucket attribute + SAME = 1; + + // DISTINCT will select nodes having different values of bucket attribute + DISTINCT = 2; +} + // Filter message Filter { // Name of the filter or a reference to the named filter. @@ -64,11 +78,14 @@ message Selector { // How many nodes to select from bucket uint32 count = 2; + // Selector modifier showing how to form a bucket + Clause clause = 3; + // Attribute bucket to select from - string attribute = 3; + string attribute = 4; // Filter reference to select from - string filter = 4; + string filter = 5; } // Exact bucket for each replica diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 9315cfe..efe659e 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -194,12 +194,28 @@ Selector | ----- | ---- | ----- | ----------- | | name | [string](#string) | | Selector name to reference in object placement section | | count | [uint32](#uint32) | | How many nodes to select from bucket | +| clause | [Clause](#neo.fs.v2.netmap.Clause) | | Selector modifier showing how to form a bucket | | attribute | [string](#string) | | Attribute bucket to select from | | filter | [string](#string) | | Filter reference to select from | + + +### Clause +Selector modifier showing how the node set will be formed +By default selector just groups by attribute into a bucket selecting nodes +only by their hash distance. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| CLAUSE_UNSPECIFIED | 0 | No modifier defined | +| SAME | 1 | SAME will select only nodes having the same value of bucket attribute | +| DISTINCT | 2 | DISTINCT will select nodes having different values of bucket attribute | + + + ### NodeInfo.State From 81841f0f6348c1d44b6403ec383d9a815e5e28e4 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 7 Sep 2020 18:39:05 +0300 Subject: [PATCH 192/440] Update Jindo release date --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e2d012..094edf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.0.0] - 2020-09-04 - Jindo (진도, 珍島) +## [2.0.0] - 2020-09-07 - Jindo (진도, 珍島) Major API refactoring and simplification. From b94f554ed489680a3a1c97335c287e54eb876b7e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 21 Sep 2020 22:02:02 +0300 Subject: [PATCH 193/440] cicd: Add simple DCO check Signed-off-by: Stanislav Bogatyrev --- .github/workflows/dco.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/dco.yml diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml new file mode 100644 index 0000000..21ae0dc --- /dev/null +++ b/.github/workflows/dco.yml @@ -0,0 +1,24 @@ +name: DCO check + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + commits_check_job: + runs-on: ubuntu-latest + name: Commits Check + steps: + - name: Get PR Commits + id: 'get-pr-commits' + uses: tim-actions/get-pr-commits@master + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: DCO Check + uses: tim-actions/dco@master + with: + commits: ${{ steps.get-pr-commits.outputs.commits }} From 0b1d53565ddc448ab1940a7cd34b925ce1778588 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 21 Sep 2020 22:40:07 +0300 Subject: [PATCH 194/440] [#69] Fix wrong action config This action can be used with PRs only. Signed-off-by: Stanislav Bogatyrev --- .github/workflows/dco.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml index 21ae0dc..40ed8fc 100644 --- a/.github/workflows/dco.yml +++ b/.github/workflows/dco.yml @@ -1,9 +1,6 @@ name: DCO check on: - push: - branches: - - master pull_request: branches: - master From e36c9228e3f78a4da586ed21ce60b0874fc5ee0e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 21 Sep 2020 23:00:03 +0300 Subject: [PATCH 195/440] Add GH Action for protobuf linter Signed-off-by: Stanislav Bogatyrev --- .github/workflows/buf.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/buf.yml diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml new file mode 100644 index 0000000..5d9d740 --- /dev/null +++ b/.github/workflows/buf.yml @@ -0,0 +1,36 @@ +name: Buf lint + +on: + pull_request: + branches: + - master + +jobs: + lint: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: wizhi/setup-buf@v1 + with: + version: 0.20.5 + - run: buf check lint + + breaking: + runs-on: ubuntu-20.04 + steps: + - name: Setup buf + uses: wizhi/setup-buf@v1 + with: + version: 0.20.5 + - name: Check out ref code + uses: actions/checkout@v2 + with: + ref: ${{ github.base_ref }} + path: baseref + - run: cd baseref && buf image build -o image.bin + + - name: Check out code + uses: actions/checkout@v2 + with: + path: prclone + - run: cd prclone && buf check breaking --against-input ../baseref/image.bin From 28a917028d08828a6600fb1404c82675515790a2 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 17 Sep 2020 22:04:00 +0300 Subject: [PATCH 196/440] Fix typos in Makefile and READMEs Signed-off-by: Stanislav Bogatyrev --- Makefile | 4 ++-- README.md | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6daa283..d66c98a 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ lint: buf check breaking --against-input '.git#branch=$(BRBR)' .PHONY: doc -# Regenerate documentation for protot files: +# Regenerate documentation for proto files: doc: @for f in `find . -type f -name '*.proto' -exec dirname {} \; | sort -u `; do \ - echo "${B}${G}⇒ Documentation for $$(basename $$f) ${R}"; \ + echo "⇒ Documentation for $$(basename $$f)"; \ protoc \ --doc_opt=.github/markdown.tmpl,$${f}.md \ --proto_path=.:/usr/local/include \ diff --git a/README.md b/README.md index 17e6e44..f87fccb 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This repository contains: - [auto-generated docs](proto-docs) for protocol buffers - [manually written docs](docs) for developers (to be done) -# Contributing +## Contributing Feel free to contribute to this project after reading the [contributing guidelines](CONTRIBUTING.md). @@ -33,9 +33,7 @@ guidelines](CONTRIBUTING.md). Before starting to work on a certain topic, create an new issue first, describing the feature/topic you are going to implement. - ## License -This project is licensed under the Apache 2.0 License - +This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details - From 99e701e70d3e48c75a6d80b4973140a23f5b4aea Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 13 Oct 2020 12:57:07 +0300 Subject: [PATCH 197/440] Update accounting package docs Adding comments on the formats used in messages. Signed-off-by: Stanislav Bogatyrev --- accounting/service.proto | 43 ++++++++++++++++++++-------------------- accounting/types.proto | 15 ++++++++++---- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index ee2f10b..c0828f4 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -9,25 +9,25 @@ import "accounting/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// The service provides methods for obtaining information -// about the account balance in NeoFS system. +// Accounting service provides methods for interaction with NeoFS sidechain via +// other NeoFS nodes to get information about the account balance. Deposit and +// Withdraw operations can't be implemented here, as they require Mainnet NeoFS +// smart contract invocation. Transfer operations between internal NeoFS +// accounts are possible, if both use the same token type. service AccountingService { - // Returns the amount of funds for the requested NeoFS account. + // Returns the amount of funds in GAS token for the requested NeoFS account. rpc Balance (BalanceRequest) returns (BalanceResponse); } -// Message defines the request body of Balance method. -// -// To indicate the account for which the balance is requested, it's identifier -// is used. -// -// To gain access to the requested information, the request body must be formed -// according to the requirements from the system specification. +// BalanceRequest message message BalanceRequest { - //Request body + // To indicate the account for which the balance is requested, it's identifier + // is used. It can be any existing account in NeoFS sidechain `Balance` smart + // contract. If omitted, client implementation MUST set it to the request's + // signer `OwnerID`. message Body { - // Carries user identifier in NeoFS system for which the balance - // is requested. + // Valid user identifier in `OwnerID` format for which the balance is + // requested. Required field. neo.fs.v2.refs.OwnerID owner_id = 1; } // Body of the balance request message. @@ -38,18 +38,17 @@ message BalanceRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Message defines the response body of Balance method. -// -// The amount of funds is calculated in decimal numbers. +// BalanceResponse message message BalanceResponse { - //Request body + // The amount of funds in GAS token for the `OwnerID`'s account requested. + // Balance is `Decimal` format to avoid precision issues with rounding. message Body { - // Carries the amount of funds on the account. + // Amount of funds in GAS token for the requested account. Decimal balance = 1; } // Body of the balance response message. @@ -60,7 +59,7 @@ message BalanceResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/accounting/types.proto b/accounting/types.proto index 6ebf289..e681cd1 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -5,11 +5,18 @@ package neo.fs.v2.accounting; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "NeoFS.API.v2.Accounting"; -// Decimal represents the decimal numbers. +// Standard floating point data type can't be used in NeoFS due to inexactness +// of the result when doing lots of small number operations. To solve the lost +// precision issue, special `Decimal` format is used for monetary computations. +// +// Please see [The General Decimal Arithmetic +// Specification](http://speleotrove.com/decimal/) for detailed problem +// description. message Decimal { - // value carries number value. + // Number in smallest Token fractions. int64 value = 1; - // precision carries value precision. + // Precision value indicating how many smallest fractions can be in one + // integer. uint32 precision = 2; -} \ No newline at end of file +} From c79350316760f4b10ec63ef3f5a4e9e64ebd0539 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 13 Oct 2020 18:29:09 +0300 Subject: [PATCH 198/440] Add well-known attributes for objects Adding the list of currently well-known object attributes. More to come later. Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/object/types.proto b/object/types.proto index 5741dec..0c44c89 100644 --- a/object/types.proto +++ b/object/types.proto @@ -79,7 +79,17 @@ message Header { // Need it to verify integrity and authenticity out of Request scope. neo.fs.v2.session.SessionToken session_token = 9; - // Attribute groups the user-defined Key-Value pairs attached to the object + // `Attribute` is a user-defined Key-Value metadata pair attached to the + // object. + // + // There are some "well-known" attributes starting with `__NEOFS__` prefix + // that affect system behaviour: + // + // * __NEOFS__UPLOAD_ID + // * __NEOFS__EXPIRATION_EPOCH + // + // For detailed description of each well-known attribute please see the + // corresponding section in NeoFS Technical specification. message Attribute { // string key to the object attribute string key = 1; From af909ec3ebc50b1208694dc0917c74b5d4dd103d Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 13 Oct 2020 19:37:14 +0300 Subject: [PATCH 199/440] Add well-known attributes for storage nodes Adding the list of currently well-known node attributes. More to come later. Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index e7f0ae7..dd5bfe3 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -121,7 +121,42 @@ message NodeInfo { // Ways to connect to a node string address = 2; - // Attributes of the NeoFS node. + // Administrator-defined Attributes of the NeoFS Storage Node. + // + // Node's attributes are mostly used during Storage Policy evaluation to + // calculate object's placement and find a set of nodes satisfying policy + // requirements. There are some "well-known" node attributes common to all the + // Storage Nodes in the network and used implicitly with default values if not + // explicitly set: + // + // * Capacity \ + // Total available disk space in Gigabytes. + // * Price \ + // Price in GAS tokens for storing one GB of data during one Epoch. In node + // attributes it's a string presenting floating point number with comma or + // point delimiter for decimal part. In the Network Map it will be saved as + // 64-bit unsigned integer representing number of minimal token fractions. + // * Subnet \ + // String ID of Node's storage subnet. There can be only one subnet served + // by the Storage Node. + // * Locode \ + // Node's geographic location in + // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) + // format approximated to the nearest point defined in standard. + // * Country \ + // Country code in + // [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + // format. Calculated automatically from `Locode` attribute + // * Region \ + // Country's administative subdivision where node is located. Calculated + // automatically from `Locode` attribute based on `SubDiv` field. Presented + // in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. + // * City \ + // City, town, village or rural area name where node is located written + // without diacritics . Calculated automatically from `Locode` attribute. + // + // For detailed description of each well-known attribute please see the + // corresponding section in NeoFS Technical specification. message Attribute { // Key of the node attribute. string key = 1; @@ -129,8 +164,8 @@ message NodeInfo { // Value of the node attribute. string value = 2; - // Parent keys, if any - // Example: For City it can be Region or Country + // Parent keys, if any. For example for `City` it could be `Region` and + // `Country`. repeated string parents = 3; } // Carries list of the NeoFS node attributes in a string key-value format. From cad80a2c86588ab06a5526ae69989ba4f42e73c6 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 13 Oct 2020 20:07:53 +0300 Subject: [PATCH 200/440] Add well-known attributes for containers Adding the list of currently well-known container attributes. More to come later. Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/container/types.proto b/container/types.proto index 85d89c6..552fa2c 100644 --- a/container/types.proto +++ b/container/types.proto @@ -27,7 +27,15 @@ message Container { // permission bits for bearer token and Extended ACL. uint32 basic_acl = 4; - // Attribute is a key-value pair of strings. + // `Attribute` is a user-defined Key-Value metadata pair attached to the + // container. Container attribute are immutable. They are set at container + // creation and cna never be added or updated. + // + // There are some "well-known" attributes affecting system behaviour: + // + // * Subnet \ + // String ID of container's storage subnet. Container can be attached to + // only one subnet. message Attribute { // Key of immutable container attribute. string key = 1; From d2f984eb57e9dbe1a5a321d75ebf3e8d6279b970 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 13 Oct 2020 23:29:04 +0300 Subject: [PATCH 201/440] Update acl package docs Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 80 +++++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 33 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index b19fbdc..2813931 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -9,17 +9,17 @@ import "refs/types.proto"; // Target role of the access control rule in access control list. enum Role { - // Unspecified role, default value. + // Unspecified role, default value ROLE_UNSPECIFIED= 0; - // User target rule is applied if sender is the owner of the container. + // User target rule is applied if sender is the owner of the container USER = 1; // System target rule is applied if sender is the storage node within the - // container or inner ring node. + // container or inner ring node SYSTEM = 2; - // Others target rule is applied if sender is not user or system target. + // Others target rule is applied if sender is not user nor system target OTHERS = 3; } @@ -35,9 +35,10 @@ enum MatchType { STRING_NOT_EQUAL = 2; } -// Operation is an enumeration of operation types. +// Request's operation type to match if the rule is applicable to a particular +// request. enum Operation { - // Unspecified operation, default value. + // Unspecified operation, default value OPERATION_UNSPECIFIED = 0; // Get @@ -62,9 +63,10 @@ enum Operation { GETRANGEHASH = 7; } -// Action is an enumeration of EACL actions. +// Rule execution result action. Either allows or denies access if the rule's +// filters match. enum Action { - // Unspecified action, default value. + // Unspecified action, default value ACTION_UNSPECIFIED = 0; // Allow action @@ -74,7 +76,7 @@ enum Action { DENY = 2; } -// Header is an enumeration of filtering header types. +// Enumeration of possible sources of Headers to apply filters. enum HeaderType { // Unspecified header, default value. HEADER_UNSPECIFIED = 0; @@ -86,69 +88,81 @@ enum HeaderType { OBJECT = 2; } -// EACLRecord groups information about extended ACL rule. +// Describes a single eACL rule. message EACLRecord { - // Operation carries type of operation. + // NeoFS request Verb to match Operation operation = 1 [json_name = "Operation"]; - // Action carries ACL target action. + // Rule execution result. Either allows or denies access if filters match. Action action = 2 [json_name = "Action"]; - // Filter definition + // Filter to check particular properties of the request or object. message Filter { - // Header carries type of header. + // Define if Object or Request header will be used HeaderType header_type = 1 [json_name = "HeaderType"]; - // MatchType carries type of match. + // Match operation type MatchType match_type = 2 [json_name = "MatchType"]; - // header_name carries name of filtering header. + // Name of the Header to use string header_name = 3 [json_name="Name"]; - // header_val carries value of filtering header. + // Expected Header Value or pattern to match string header_val = 4 [json_name="Value"]; } - // filters carries set of filters. + // List of filters to match and see if rule is applicable repeated Filter filters = 3 [json_name="Filters"]; - // Information about extended ACL target. + // Target to apply ACL rule. Can be a subject's role class or a list of public + // keys to match. message Target { - // target carries target of ACL rule. + // Target subject's role class Role role = 1 [json_name="Role"]; - // key_list carries public keys of ACL target. + // List of public keys to identify target subject repeated bytes key_list = 2 [json_name="Keys"]; } - // targets carries information about extended ACL target list. + // List of target subjects to apply ACL rule to repeated Target targets = 4 [json_name="Targets"]; } -// EACLRecord carries the information about extended ACL rules. +// Extended ACL rules table. Defined a list of ACL rules additionally to Basic +// ACL. Extended ACL rules can be attached to the container and can be updated +// or may be defined in `BearerToken` structure. Please see the corresponding +// NeoFS Technical Specification's section for detailed description. message EACLTable { - // eACL format version. - // Effectively the version of API library used to create eACL Table + // eACL format version. Effectively the version of API library used to create + // eACL Table. neo.fs.v2.refs.Version version = 1; - // Carries identifier of the container that should use given - // access control rules. + // Identifier of the container that should use given access control rules neo.fs.v2.refs.ContainerID container_id = 2 [json_name="ContainerID"]; - // Records carries list of extended ACL rule records. + // List of Extended ACL rules repeated EACLRecord records = 3 [json_name="Records"]; } -// BearerToken has information about request ACL rules with limited lifetime +// BearerToken allows to attach signed Extended ACL rules to the request in +// `RequestMetaHeader`. If container's Basic ACL rules allow, the attached rule +// set will be checked instead of one attached to the container itself. Just +// like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be +// used in the similar use cases, like providing authorisation to externally +// authenticated party. message BearerToken { - // Bearer Token body + // Bearer Token body structure contains Extended ACL table issued by container + // owner with additional information preventing token's abuse. message Body { - // EACLTable carries table of extended ACL rules + // Table of Extended ACL rules to use instead of the ones attached to the + // container EACLTable eacl_table = 1; - // OwnerID carries identifier of the token owner + // `OwnerID` to whom the token was issued. MUST match with the request + // originator's `OwnerID` neo.fs.v2.refs.OwnerID owner_id = 2; - // Lifetime parameters of the token. Filed names taken from rfc7519. + // Lifetime parameters of the token. Filed names taken from + // [rfc7519](https://tools.ietf.org/html/rfc7519). message TokenLifetime { // Expiration Epoch uint64 exp = 1; From f51ee1ba9deb3c5574687af98b8213a404d20d0d Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 14 Oct 2020 19:57:36 +0300 Subject: [PATCH 202/440] Update container package docs Signed-off-by: Stanislav Bogatyrev --- container/service.proto | 160 ++++++++++++++++++++++------------------ container/types.proto | 28 +++---- 2 files changed, 102 insertions(+), 86 deletions(-) diff --git a/container/service.proto b/container/service.proto index 0e89377..bb76839 100644 --- a/container/service.proto +++ b/container/service.proto @@ -10,46 +10,51 @@ import "container/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// ContainerService provides API to access container smart-contract in morph chain -// via NeoFS node. +// `ContainerService` provides API to interact with `Container` smart contract +// in NeoFS sidechain via other NeoFS nodes. All of those actions can be done +// equivalently by directly issuing transactions and RPC calls to sidechain +// nodes. service ContainerService { - // Put invokes 'Put' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // added into smart-contract storage. + // `Put` invokes `Container` smart contract's `Put` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, container + // is added into smart contract storage. rpc Put(PutRequest) returns (PutResponse); - // Delete invokes 'Delete' method in container smart-contract and returns - // response immediately. After new block in morph chain, request is verified - // by inner ring nodes. After one more block in morph chain, container - // removed from smart-contract storage. + // `Delete` invokes `Container` smart contract's `Delete` method and returns + // response immediately. After a new block is issued in sidechain, request is + // verified by Inner Ring nodes. After one more block in sidechain, container + // is added into smart contract storage. rpc Delete(DeleteRequest) returns (DeleteResponse); - // Get returns container from container smart-contract storage. + // Returns container structure from `Container` smart contract storage. rpc Get(GetRequest) returns (GetResponse); - // List returns all owner's containers from container smart-contract - // storage. + // Returns all owner's containers from 'Container` smart contract' storage. rpc List(ListRequest) returns (ListResponse); - // SetExtendedACL invokes 'SetEACL' method in container smart-contract and - // returns response immediately. After new block in morph chain, - // Extended ACL added into smart-contract storage. + // Invokes 'SetEACL' method of 'Container` smart contract and returns response + // immediately. After one more block in sidechain, Extended ACL changes are + // added into smart contract storage. rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); - // GetExtendedACL returns Extended ACL table and signature from container - // smart-contract storage. + // Returns Extended ACL table and signature from `Container` smart contract + // storage. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } // New NeoFS Container creation request message PutRequest { - // Request body + // Container creation request has container structure's signature as a + // separate field. It's not stored in sidechain, just verified on container + // creation by `Container` smart contract. `ContainerID` is a SHA256 hash of + // the stable-marshalled container strucutre, hence there is no need for + // additional signature checks. message Body { - // Container to create in NeoFS. + // Container structure to register in NeoFS container.Container container = 1; - //Signature of stable-marshalled container according to RFC-6979. + // Signature of a stable-marshalled container according to RFC-6979 neo.fs.v2.refs.Signature signature =2; } // Body of container put request message. @@ -60,16 +65,19 @@ message PutRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // New NeoFS Container creation response message PutResponse { - // Response body + // Container put response body contains information about the newly registered + // container as seen by `Container` smart contract. `ContainerID` can be + // calculated beforehand from the container structure and compared to the one + // returned here to make sure everything was done as expected. message Body { - // container_id carries identifier of the new container. + // Unique identifier of the newly created container neo.fs.v2.refs.ContainerID container_id = 1; } // Body of container put response message. @@ -80,20 +88,21 @@ message PutResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Container removal request message DeleteRequest { - // Request body + // Container removal request body has a signed `ContainerID` as a proof of + // container owner's intent. The signature will be verified by `Container` + // smart contract, so signing algorithm must be supported by NeoVM. message Body { - // container_id carries identifier of the container to delete - // from NeoFS. + // Identifier of the container to delete from NeoFS neo.fs.v2.refs.ContainerID container_id = 1; - // Signature of container id according to RFC-6979. + // `ContainerID` signed with the container owner's key according to RFC-6979 neo.fs.v2.refs.Signature signature = 2; } // Body of container delete request message. @@ -104,15 +113,16 @@ message DeleteRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// DeleteResponse is empty because delete operation is asynchronous and done -// via consensus in inner ring nodes +// `DeleteResponse` has an empty body because delete operation is asynchronous +// and done via consensus in Inner Ring nodes. message DeleteResponse { - // Response body + // `DeleteResponse` has an empty body because delete operation is asynchronous + // and done via consensus in Inner Ring nodes. message Body {} // Body of container delete response message. Body body = 1; @@ -122,16 +132,16 @@ message DeleteResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get container structure message GetRequest { - // Request body + // Get container structure request body. message Body { - // container_id carries identifier of the container to get. + // Identifier of the container to get neo.fs.v2.refs.ContainerID container_id = 1; } // Body of container get request message. @@ -142,16 +152,17 @@ message GetRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get container structure message GetResponse { - // Response body + // Get container response body does not have container structure signature. It + // was already verified on container creation. message Body { - // Container that has been requested. + // Requested container structure Container container = 1; } // Body of container get response message. @@ -162,19 +173,19 @@ message GetResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // List containers message ListRequest { - // Request body + // List containers request body. message Body { - // owner_id carries identifier of the container owner. + // Identifier of the container owner neo.fs.v2.refs.OwnerID owner_id = 1; } - // Body of list containers request message. + // Body of list containers request message Body body = 1; // Carries request meta information. Header data is used only to regulate @@ -182,16 +193,16 @@ message ListRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // List containers message ListResponse { - // Response body + // List containers response body. message Body { - // ContainerIDs carries list of identifiers of the containers that belong to the owner. + // List of `ContainerID`s belonging to the requested `OwnerID` repeated refs.ContainerID container_ids = 1; } @@ -203,19 +214,20 @@ message ListResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Set Extended ACL message SetExtendedACLRequest { - // Request body + // Set Extended ACL request body does not have separate `ContainerID` + // reference. It will be taken from `EACLTable.container_id` field. message Body { - // Extended ACL to set for the container. + // Extended ACL table to set for container neo.fs.v2.acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. + // Signature of stable-marshalled Extended ACL table according to RFC-6979 neo.fs.v2.refs.Signature signature = 2; } // Body of set extended acl request message. @@ -226,14 +238,16 @@ message SetExtendedACLRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Set Extended ACL message SetExtendedACLResponse { - // Response body + // `SetExtendedACLResponse` has an empty body because the operation is + // asynchronous and update should be reflected in `Container` smart contract's + // storage after next block is issued in sidechain. message Body { } // Body of set extended acl response message. @@ -244,16 +258,16 @@ message SetExtendedACLResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get Extended ACL message GetExtendedACLRequest { - // Request body + // Get Extended ACL request body message Body { - // container_id carries identifier of the container that has Extended ACL. + // Identifier of the container having Extended ACL neo.fs.v2.refs.ContainerID container_id = 1; } @@ -265,19 +279,21 @@ message GetExtendedACLRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get Extended ACL message GetExtendedACLResponse { - // Response body + // Get Extended ACL Response body can be empty if the requested container did + // not have Extended ACL Table attached or Extended ACL was not allowed at + // container creation. message Body { - // Extended ACL that has been requested if it was set up. + // Extended ACL requested, if available neo.fs.v2.acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979. + // Signature of stable-marshalled Extended ACL according to RFC-6979 neo.fs.v2.refs.Signature signature = 2; } // Body of get extended acl response message. @@ -288,7 +304,7 @@ message GetExtendedACLResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/container/types.proto b/container/types.proto index 552fa2c..30eff1e 100644 --- a/container/types.proto +++ b/container/types.proto @@ -8,23 +8,23 @@ option csharp_namespace = "NeoFS.API.v2.Container"; import "netmap/types.proto"; import "refs/types.proto"; -// Container is a structure that defines object placement behaviour. Objects -// can be stored only within containers. They define placement rule, attributes -// and access control information. ID of the container is a 32 byte long -// SHA256 hash of stable-marshalled container message. +// Container is a structure that defines object placement behaviour. Objects can +// be stored only within containers. They define placement rule, attributes and +// access control information. ID of the container is a 32 byte long SHA256 hash +// of stable-marshalled container message. message Container { - // Container format version. - // Effectively the version of API library used to create container + // Container format version. Effectively the version of API library used to + // create container. neo.fs.v2.refs.Version version = 1; - // OwnerID carries identifier of the container owner. + // Identifier of the container owner neo.fs.v2.refs.OwnerID owner_id = 2; - // Nonce is a 16 byte UUID, used to avoid collisions of container id. + // Nonce is a 16 byte UUID, used to avoid collisions of container id bytes nonce = 3; - // BasicACL contains access control rules for owner, system, others groups and - // permission bits for bearer token and Extended ACL. + // `BasicACL` contains access control rules for owner, system, others groups + // and permission bits for `BearerToken` and `Extended ACL` uint32 basic_acl = 4; // `Attribute` is a user-defined Key-Value metadata pair attached to the @@ -37,15 +37,15 @@ message Container { // String ID of container's storage subnet. Container can be attached to // only one subnet. message Attribute { - // Key of immutable container attribute. + // Attribute name key string key = 1; - // Value of immutable container attribute. + // Attribute value string value = 2; } - // Attributes define any immutable characteristics of container. + // Attributes represent immutable container's meta data repeated Attribute attributes = 5; - // Placement policy for the object inside the container. + // Placement policy for the object inside the container neo.fs.v2.netmap.PlacementPolicy placement_policy = 6; } From 3f6c211fef002a507b61d737174f60bbaa260353 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 15 Oct 2020 10:50:36 +0300 Subject: [PATCH 203/440] Update netmap package docs Signed-off-by: Stanislav Bogatyrev --- netmap/service.proto | 33 ++++++++++++++++++++------------- netmap/types.proto | 40 ++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/netmap/service.proto b/netmap/service.proto index a388148..329cbb9 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -9,18 +9,25 @@ import "netmap/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// Methods to work with NetworkMap +// `NetmapService` provides methods to work with `Network Map` and information +// required to build it. The resulting `Network Map` is stored in sidechain +// `Netmap` smart contract, while related information can be obtained from other +// NeoFS nodes. service NetmapService { - // Return information about Node + // Get NodeInfo structure from the particular node directly. Node information + // can be taken from `Netmap` smart contract, but in some cases the one may + // want to get recent information directly, or to talk to the node not yet + // present in `Network Map` to find out what API version can be used for + // further communication. Can also be used to check if node is up and running. rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); } -// Get NodeInfo from the particular node directly +// Get NodeInfo structure from the particular node directly message LocalNodeInfoRequest { - //Request body + // LocalNodeInfo request body is empty. message Body { } - // Body of the balance request message. + // Body of the LocalNodeInfo request message Body body = 1; // Carries request meta information. Header data is used only to regulate @@ -28,19 +35,19 @@ message LocalNodeInfoRequest { neo.fs.v2.session.RequestMetaHeader meta_header = 2; // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Local nod Info, including API Version in use +// Local Node Info, including API Version in use message LocalNodeInfoResponse { - //Response body + // Local Node Info, including API Version in use. message Body { - // API version in use + // Latest NeoFS API version in use neo.fs.v2.refs.Version version = 1; - // NodeInfo from node itself + // NodeInfo structure with recent information from node itself NodeInfo node_info = 2; } // Body of the balance response message. @@ -51,7 +58,7 @@ message LocalNodeInfoResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/netmap/types.proto b/netmap/types.proto index dd5bfe3..ccfe546 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -35,9 +35,9 @@ enum Operation { AND = 8; } -// Selector modifier showing how the node set will be formed -// By default selector just groups by attribute into a bucket selecting nodes -// only by their hash distance. +// Selector modifier shows how the node set will be formed. By default selector +// just groups nodes into a bucket by attribute, selecting nodes only by their +// hash distance. enum Clause{ // No modifier defined. Will select nodes from bucket randomly. CLAUSE_UNSPECIFIED = 0; @@ -49,12 +49,13 @@ enum Clause{ DISTINCT = 2; } -// Filter +// Filter will return the subset of nodes from `NetworkMap` or another filter's +// results, that will satisfy filter's conditions. message Filter { - // Name of the filter or a reference to the named filter. - // '*' means application to the whole unfiltered NetworkMap - // At top level it's used as a filter name. At lower levels it's considered to - // be a reference to another named filter + // Name of the filter or a reference to the named filter. '*' means + // application to the whole unfiltered NetworkMap. At top level it's used as a + // filter name. At lower levels it's considered to be a reference to another + // named filter string name = 1; // Key to filter @@ -66,16 +67,18 @@ message Filter { // Value to match string value = 4; - // List of inner filters. Top level operation will be applied to the whole list. + // List of inner filters. Top level operation will be applied to the whole + // list. repeated Filter filters = 5; } -// Selector +// Selector chooses a number of nodes from the bucket taking the nearest nodes +// to the provided `ContainerID` by hash distance. message Selector { // Selector name to reference in object placement section string name = 1; - // How many nodes to select from bucket + // How many nodes to select from the bucket uint32 count = 2; // Selector modifier showing how to form a bucket @@ -88,22 +91,27 @@ message Selector { string filter = 5; } -// Exact bucket for each replica +// Number of object replicas in a set of nodes from the defined selector. If no +// selector set the root bucket containing all possible nodes will be used by +// default. message Replica { // How many object replicas to put uint32 count = 1; - // Named selector bucket to put in + // Named selector bucket to put replicas string selector = 2; } -// Set of rules to select a subset of nodes able to store container's objects +// Set of rules to select a subset of nodes from `NetworkMap` able to store +// container's objects. The format is simple enough to transpile from different +// storage policy definition languages. message PlacementPolicy { - // Rules to set number of object replicas and place each one into a particular bucket + // Rules to set number of object replicas and place each one into a named + // bucket repeated Replica replicas = 1; // Container backup factor controls how deep NeoFS will search for nodes - // alternatives to include into container. + // alternatives to include into container's nodes subset uint32 container_backup_factor = 2; // Set of Selectors to form the container's nodes subset From 27f4b1ad63740745a7093d000b198136c75f270b Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 15 Oct 2020 21:28:19 +0300 Subject: [PATCH 204/440] Update object package docs Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 293 +++++++++++++++++++++++-------------------- object/types.proto | 45 +++---- 2 files changed, 177 insertions(+), 161 deletions(-) diff --git a/object/service.proto b/object/service.proto index 020e1d5..4ce47ed 100644 --- a/object/service.proto +++ b/object/service.proto @@ -9,93 +9,98 @@ import "object/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// Object service provides API for manipulating with the object. +// `ObjectService` provides API for manipulating objects. Object operations do +// not interact with sidechain and are only served by nodes in p2p style. service ObjectService { - // Get the object from container. Response uses gRPC stream. First response - // message carry object of requested address. Chunk messages are parts of - // the object's payload if it is needed. All messages except first carry - // chunks. Requested object can be restored by concatenation of object - // message payload and all chunks keeping receiving order. + // Receive full object structure, including Headers and payload. Response uses + // gRPC stream. First response message carries object with requested address. + // Chunk messages are parts of the object's payload if it is needed. All + // messages, except the first one, carry payload chunks. Requested object can + // be restored by concatenation of object message payload and all chunks + // keeping receiving order. rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message - // SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD - // BE set. Session token SHOULD BE obtained before put operation (see - // session package). Chunk messages considered by server as part of object - // payload. All messages except first SHOULD BE chunks. Chunk messages - // SHOULD BE sent in direct order of fragmentation. + // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object + // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see + // session package). Chunk messages are considered by server as a part of an + // object payload. All messages, except first one, SHOULD be payload chunks. + // Chunk messages SHOULD be sent in direct order of fragmentation. rpc Put(stream PutRequest) returns (PutResponse); - // Delete the object from a container + // Delete the object from a container. There is no immediate removal + // guarantee. Object will be marked for removal and deleted eventually. rpc Delete(DeleteRequest) returns (DeleteResponse); - // Head returns the object without data payload. Object in the - // response has system header only. If full headers flag is set, extended - // headers are also present. + // Returns the object Headers without data payload. By default full header is + // returned. If `main_only` request field is set, the short header with only + // the very minimal information would be returned instead. rpc Head(HeadRequest) returns (HeadResponse); - // Search objects in container. Version of query language format SHOULD BE - // set to 1. Search query represented in serialized format (see query - // package). + // Search objects in container. Search query allows to match by Object + // Header's filed values. Please see the corresponding NeoFS Technical + // Specification section for more details. rpc Search(SearchRequest) returns (stream SearchResponse); - // GetRange of data payload. Range is a pair (offset, length). - // Requested range can be restored by concatenation of all chunks - // keeping receiving order. + // Get byte range of data payload. Range is set as an (offset, length) tuple. + // Like in `Get` method, the response uses gRPC stream. Requested range can be + // restored by concatenation of all received payload chunks keeping receiving + // order. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); - // GetRangeHash returns homomorphic hash of object payload range after XOR - // operation. Ranges are set of pairs (offset, length). Hashes order in - // response corresponds to ranges order in request. Homomorphic hash is - // calculated for XORed data. + // Returns homomorphic or regular hash of object's payload range after + // applying XOR operation with the provided `salt`. Ranges are set of (offset, + // length) tuples. Hashes order in response corresponds to ranges order in + // request. Note that hash is calculated for XORed data. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } -// Get object request +// GET object request message GetRequest { - // Request body + // GET Object request body message Body { - // Address of the requested object. + // Address of the requested object neo.fs.v2.refs.Address address = 1; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the objects - // that are physically stored on the server. + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node bool raw = 2; } // Body of get object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// get object response +// GET object response message GetResponse { - // Response body + // GET Object Response body message Body { - // Initialization parameters of the object got from NeoFS. + // Initial part of the `Object` structure stream. Technically it's a + // set of all `Object` structure's fields except `payload`. message Init { - // Object ID + // Object's unique identifier. neo.fs.v2.refs.ObjectID object_id = 1; - // Object signature + // Signed `ObjectID` neo.fs.v2.refs.Signature signature = 2; - // Object header. + // Object metadata headers Header header = 3; } - // Carries the single message of the response stream. + // Single message in the response stream. oneof object_part { - // Initialization parameters of the object stream. + // Initial part of the object stream Init init = 1; - // Part of the object payload. + // Chunked object payload bytes chunk = 2; } } @@ -107,58 +112,58 @@ message GetResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Put object request +// PUT object request message PutRequest { - // Request body + // PUT request body message Body { - // Groups initialization parameters of object placement in NeoFS. + // Newly created object structure parameters. If some optional parameters + // are not set, they will be calculated by a peer node. message Init { - // Object ID, where available + // ObjectID if available. neo.fs.v2.refs.ObjectID object_id = 1; - // Object signature, were available + // Object signature if available neo.fs.v2.refs.Signature signature = 2; - // Header of the object to save in the system. + // Object's Header Header header = 3; - // Number of the object copies to store within the RPC call. - // Default zero value is processed according to the - // container placement rules. + // Number of the object copies to store within the RPC call. By default + // object is processed according to the container's placement policy. uint32 copies_number = 4; } - // Carries the single part of the query stream. + // Single message in the request stream. oneof object_part { - // Carries the initialization parameters of the object stream. + // Initial part of the object stream Init init = 1; - // Carries part of the object payload. + // Chunked object payload bytes chunk = 2; } } // Body of put object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Put object response +// PUT Object response message PutResponse { - // Response body + // PUT Object response body message Body { - // Carries identifier of the saved object. - // It is used to access an object in the container. + // Identifier of the saved object neo.fs.v2.refs.ObjectID object_id = 1; } // Body of put object response message. @@ -169,34 +174,35 @@ message PutResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Object Delete request +// Object DELETE request message DeleteRequest { - // Request body + // Object DELETE request body message Body { - // Carries the address of the object to be deleted. + // Address of the object to be deleted neo.fs.v2.refs.Address address = 1; } // Body of delete object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// DeleteResponse is empty because we cannot guarantee permanent object removal -// in distributed system. +// DeleteResponse body is empty because we cannot guarantee permanent object +// removal in distributed system. message DeleteResponse { - // Response body + // Object DELETE Response has an empty body. message Body { } // Body of delete object response message. @@ -207,57 +213,60 @@ message DeleteResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Object head request +// Object HEAD request message HeadRequest { - // Request body + // Object HEAD request body message Body { - // Address of the object with the requested header. + // Address of the object with the requested Header neo.fs.v2.refs.Address address = 1; // Return only minimal header subset bool main_only = 2; - // Carries the raw option flag of the request. - // Raw request is sent to receive only the headers of the objects - // that are physically stored on the server. + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node bool raw = 3; } // Body of head object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Tuple of full object header and signature of object ID. +// Tuple of full object header and signature of `ObjectID`. \ +// Signed `ObjectID` is present to verify full header's authenticity through the +// following steps: +// +// 1. Calculate `SHA-256` of marshalled `Header` structure +// 2. Check if the resulting hash matched `ObjectID` +// 3. Check if `ObjectID` signature in `signature` field is correct message HeaderWithSignature { // Full object header Header header = 1; - // Signed object_id to verify full header's authenticity through following steps: - // 1. Calculate SHA-256 of marshalled Headers structure. - // 2. Check if the resulting hash matched ObjectID - // 3. Check if ObjectID's signature in signature field is correct. + // Signed `ObjectID` to verify full header's authenticity neo.fs.v2.refs.Signature signature = 2; } -// Head response +// Object HEAD response message HeadResponse { - // Response body + // Object HEAD response body message Body { - // Carries the requested object header or it's part + // Requested object header or it's part. oneof head{ - // Full object header with object ID signature + // Full object's `Header` with `ObjectID` signature HeaderWithSignature header = 1; // Short object header @@ -272,16 +281,16 @@ message HeadResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Search objects request +// Object Search request message SearchRequest { - // Request body + // Object Search request body message Body { - // Carries search container identifier. + // Container identifier were to search neo.fs.v2.refs.ContainerID container_id = 1; // Version of the Query Language used @@ -303,20 +312,21 @@ message SearchRequest { // Body of search object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Search response message SearchResponse { - // Response body + // Object Search response body message Body { - // Carries list of object identifiers that match the search query + // List of `ObjectID`s that match the search query repeated neo.fs.v2.refs.ObjectID id_list = 1; } // Body of search object response message. @@ -327,48 +337,52 @@ message SearchResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Range groups the parameters of object payload range. +// Object payload range.Ranges of zero length SHOULD be considered as invalid. message Range { - // Carries the offset of the range from the object payload start. + // Offset of the range from the object payload start uint64 offset = 1; - // Carries the length of the object payload range. + // Length in bytes of the object payload range uint64 length = 2; } -// Request to get part of object's payload +// Request part of object's payload message GetRangeRequest { - // Request Body + // Byte range of object's payload request body message Body { - // Address carries address of the object that contains the requested payload range. + // Address of the object containing the requested payload range neo.fs.v2.refs.Address address = 1; - // Range carries the parameters of the requested payload range. + // Requested payload range Range range = 2; } // Body of get range object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get part of object's payload message GetRangeResponse { - // Response body + // Get Range response body uses streams to transfer the response. Because + // object payload considered a byte sequence, there is no need to have some + // initial preamble message. The requested byte range is sent as a series + // chunks. message Body { - // Carries part of the object payload. + // Chunked object payload's range bytes chunk = 1; } @@ -380,22 +394,22 @@ message GetRangeResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get hash of object's payload part message GetRangeHashRequest { - // Request body + // Get hash of object's payload part request body. message Body { - // Carries address of the object that contains the requested payload range. + // Address of the object that containing the requested payload range neo.fs.v2.refs.Address address = 1; - // Carries the list of object payload range to calculate homomorphic hash. + // List of object's payload ranges to calculate homomorphic hash repeated Range ranges = 2; - // Carries binary salt to XOR object payload ranges before hash calculation. + // Binary salt to XOR object's payload ranges before hash calculation bytes salt = 3; // Checksum algorithm type @@ -404,23 +418,24 @@ message GetRangeHashRequest { // Body of get range hash object request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Get hash of object's payload part message GetRangeHashResponse { - // Response body + // Get hash of object's payload part response body. message Body { // Checksum algorithm type neo.fs.v2.refs.ChecksumType type = 1; - // List of range hashes in a binary format. + // List of range hashes in a binary format repeated bytes hash_list = 2; } // Body of get range hash object response message. @@ -431,7 +446,7 @@ message GetRangeHashResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/object/types.proto b/object/types.proto index 0c44c89..b3fe8b9 100644 --- a/object/types.proto +++ b/object/types.proto @@ -8,7 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; import "session/types.proto"; -// Type of the object payload content +// Type of the object payload content. enum ObjectType { // Just a normal object REGULAR = 0; @@ -16,7 +16,7 @@ enum ObjectType { // Used internally to identify deleted objects TOMBSTONE = 1; - // Identifies that the object holds StorageGroup information + // StorageGroup information STORAGE_GROUP = 2; } @@ -30,7 +30,8 @@ enum MatchType { // Short header fields message ShortHeader { - // Object format version. + // Object format version. Effectively the version of API library used to + // create particular object neo.fs.v2.refs.Version version = 1; // Epoch when the object was created @@ -43,14 +44,14 @@ message ShortHeader { ObjectType object_type = 4; // Size of payload in bytes. - // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown uint64 payload_length = 5; } -// Object Headers +// Object Header message Header { - // Object format version. - // Effectively the version of API library used to create particular object + // Object format version. Effectively the version of API library used to + // create particular object neo.fs.v2.refs.Version version = 1; // Object's container @@ -63,20 +64,20 @@ message Header { uint64 creation_epoch = 4; // Size of payload in bytes. - // 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown uint64 payload_length = 5; // Hash of payload bytes neo.fs.v2.refs.Checksum payload_hash = 6; - // Special object type + // Type of the object payload content ObjectType object_type = 7; // Homomorphic hash of the object payload. neo.fs.v2.refs.Checksum homomorphic_hash = 8; - // Session token, if it was used during Object creation. - // Need it to verify integrity and authenticity out of Request scope. + // Session token, if it was used during Object creation. Need it to verify + // integrity and authenticity out of Request scope. neo.fs.v2.session.SessionToken session_token = 9; // `Attribute` is a user-defined Key-Value metadata pair attached to the @@ -99,14 +100,15 @@ message Header { // User-defined object attributes repeated Attribute attributes = 10; - // Information about spawning the objects through a payload splitting. + // Bigger objects can be split into a chain of smaller objects. Information + // about inter-dependencies between spawned objects and how to re-construct + // the original one is in the `Split` headers. Parent and children objects + // must be within the same container. message Split { - // Identifier of the origin object. - // Parent and children objects must be within the same container. - // Parent object_id is known only to the minor child. + // Identifier of the origin object. Known only to the minor child. neo.fs.v2.refs.ObjectID parent = 1; - // Previous carries identifier of the left split neighbor. + // Identifier of the left split neighbor neo.fs.v2.refs.ObjectID previous = 2; // `signature` field of the parent object. Used to reconstruct parent. @@ -115,19 +117,18 @@ message Header { // `header` field of the parent object. Used to reconstruct parent. Header parent_header = 4; - // Children carries list of identifiers of the objects generated by splitting the current. + // List of identifiers of the objects generated by splitting current one. repeated neo.fs.v2.refs.ObjectID children = 5; } - // Position of the object in the split hierarchy. + // Position of the object in the split hierarchy Split split = 11; } -// Object structure. +// Object structure. Object is immutable and content-addressed. It means +// `ObjectID` will change if header or payload changes. It's calculated as a +// hash of header field, which contains hash of object's payload. message Object { // Object's unique identifier. - // Object is content-addressed. It means id will change if header or payload - // changes. It's calculated as a hash of header field, which contains hash of - // object's payload neo.fs.v2.refs.ObjectID object_id = 1; // Signed object_id From 154f4aa5818371e2fc5e466d3d00c774aca7a2da Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 15 Oct 2020 23:50:40 +0300 Subject: [PATCH 205/440] Update refs package docs Signed-off-by: Stanislav Bogatyrev --- refs/types.proto | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/refs/types.proto b/refs/types.proto index 8debfae..d8d15cc 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -5,62 +5,70 @@ package neo.fs.v2.refs; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "NeoFS.API.v2.Refs"; -// Address of object (container id + object id) +// Object in NeoFS can be addressed by it's ContainerID and ObjectID. In string +// format there MUST be a '/' delimeter between them. message Address { - // container_id carries container identifier. + // Container identifier ContainerID container_id = 1; - // object_id carries object identifier. + // Object identifier ObjectID object_id = 2; } -// NeoFS object identifier. +// NeoFS Object unique identifier. Objects are immutable and content-addressed. +// It means `ObjectID` will change if `header` or `payload` changes. `ObjectID` +// is calculated as a hash of `header` field, which contains hash of object's +// payload. message ObjectID { - // value carries the object identifier in a binary format. + // Object identifier in a binary format bytes value = 1; } -// NeoFS container identifier. +// NeoFS container identifier. Container structures are immutable and +// content-addressed. `ContainerID` is a 32 byte long SHA256 hash of +// stable-marshalled container message. message ContainerID { - // value carries the container identifier in a binary format. + // Container identifier in a binary format. bytes value = 1; } -// OwnerID group information about the owner of the NeoFS container. +// OwnerID is a derivative of a user's main public key. The transformation +// algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can +// be directly used as `OwnerID`. message OwnerID { - // value carries the identifier of the container owner in a binary format. + // Identifier of the container owner in a binary format bytes value = 1; } -// Represents API version used by node. +// API version used by a node. message Version { - // Major API version. + // Major API version uint32 major = 1; - // Minor API version. + // Minor API version uint32 minor = 2; } -// Signature of something in NeoFS +// Signature of something in NeoFS. message Signature { - // Public key used for signing. + // Public key used for signing bytes key = 1; // Signature bytes sign = 2; } -// Checksum algorithm type +// Checksum algorithm type. enum ChecksumType { // Unknown. Not used CHECKSUM_TYPE_UNSPECIFIED = 0; - // Tillich-Zemor homomorphic hash funciton + // Tillich-Zemor homomorphic hash function TZ = 1; // SHA-256 SHA256 = 2; } -// Checksum message +// Checksum message. message Checksum { // Checksum algorithm type ChecksumType type = 1; From b72847006afadb19186f8a526125cd97f400fd7e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 16 Oct 2020 09:20:47 +0300 Subject: [PATCH 206/440] Update session package docs Signed-off-by: Stanislav Bogatyrev --- session/service.proto | 36 +++++++++++++---------- session/types.proto | 68 ++++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 49 deletions(-) diff --git a/session/service.proto b/session/service.proto index 5ecfe52..40c5255 100644 --- a/session/service.proto +++ b/session/service.proto @@ -8,41 +8,45 @@ option csharp_namespace = "NeoFS.API.v2.Session"; import "refs/types.proto"; import "session/types.proto"; -// Create Session record on Node side +// `SessionService` allows to establish a temporary trust relationship between +// two peer nodes and generate a `SessionToken` as the proof of trust to be +// attached in requests for further verification. Please see corresponding +// section of NeoFS Technical Specification for details. service SessionService { - // Create opens new session between the client and the server. + // Opens a new session between two peers. rpc Create (CreateRequest) returns (CreateResponse); } -// CreateRequest carries an information necessary for opening a session. +// Information necessary for opening a session. message CreateRequest { - // Request body + // Session creation request body message Body { - // Carries an identifier of a session initiator. + // Dession initiating user's or node's key derived `OwnerID`. neo.fs.v2.refs.OwnerID owner_id = 1; - // Expiration Epoch + // Session expiration `Epoch` uint64 expiration = 2; } // Body of create session token request message. Body body = 1; - // Carries request meta information. Header data is used only to regulate message - // transport and does not affect request execution. + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// CreateResponse carries an information about the opened session. +// Information about the opened session. message CreateResponse { - // Response body + // Session creation response body message Body { - // id carries an identifier of session token. + // Identifier of a newly created session bytes id = 1; - // session_key carries a session public key. + // Public key used for session bytes session_key = 2; } @@ -54,7 +58,7 @@ message CreateResponse { neo.fs.v2.session.ResponseMetaHeader meta_header = 2; // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness - // of transmission. + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/session/types.proto b/session/types.proto index 0f21b93..ed5442f 100644 --- a/session/types.proto +++ b/session/types.proto @@ -36,21 +36,21 @@ message ObjectSessionContext { // Refers to object.GetRangeHash RPC call RANGEHASH = 7; } - // Verb is a type of request for which the token is issued + // Type of request for which the token is issued Verb verb = 1; // Related Object address neo.fs.v2.refs.Address address = 2; } -// NeoFS session token. +// NeoFS Session Token. message SessionToken { - // Session token body + // Session Token body message Body { - // ID is a token identifier. valid UUIDv4 represented in bytes + // Token identifier is a valid UUIDv4 in binary form bytes id = 1; - // OwnerID carries identifier of the session initiator. + // Identifier of the session initiator neo.fs.v2.refs.OwnerID owner_id = 2; // Lifetime parameters of the token. Filed names taken from rfc7519. @@ -64,84 +64,86 @@ message SessionToken { // Issued at Epoch uint64 iat = 3; } - // Lifetime is a lifetime of the session + // Lifetime of the session TokenLifetime lifetime = 3; - // SessionKey is a public key of session key + // Public key used in session bytes session_key = 4; - // Carries context of the session. + // Session Context information oneof context { - // ObjectService session context. + // ObjectService session context ObjectSessionContext object = 5; } } - // Session Token body + // Session Token contains the proof of trust between peers to be attached in + // requests for further verification. Please see corresponding section of + // NeoFS Technical Specification for details. Body body = 1; - // Signature is a signature of session token information + // Signature of `SessionToken` information neo.fs.v2.refs.Signature signature = 2; } -// Extended headers for Request/Response +// Extended headers for Request/Response. message XHeader { - // Key of the X-Header. + // Key of the X-Header string key = 1; - // Value of the X-Header. + // Value of the X-Header string value = 2; } - -// Information about the request +// Meta information attached to the request. When forwarded between peers, +// request meta headers are folded in matryoshka style. message RequestMetaHeader { - // Client API version. + // Peer's API version used neo.fs.v2.refs.Version version = 1; - // Client local epoch number. Set to 0 if unknown. + // Peer's local epoch number. Set to 0 if unknown. uint64 epoch = 2; - // Maximum number of nodes in the request route. + // Maximum number of intermediate nodes in the request route uint32 ttl = 3; - // Request X-Headers. + // Request X-Headers repeated XHeader x_headers = 4; - // Token is a token of the session within which the request is sent + // Session token within which the request is sent SessionToken session_token = 5; - // Bearer is a Bearer token of the request + // `BearerToken` with eACL overrides for the request neo.fs.v2.acl.BearerToken bearer_token = 6; - // RequestMetaHeader of the origin request. + // `RequestMetaHeader` of the origin request RequestMetaHeader origin = 7; } // Information about the response message ResponseMetaHeader { - // Server API version. + // Peer's API version used neo.fs.v2.refs.Version version = 1; - // Server local epoch number. + // Peer's local epoch number uint64 epoch = 2; - // Maximum number of nodes in the response route. + // Maximum number of intermediate nodes in the request route uint32 ttl = 3; - // Response X-Headers. + // Response X-Headers repeated XHeader x_headers = 4; - // Carries response meta header of the origin response. + // `ResponseMetaHeader` of the origin request ResponseMetaHeader origin = 5; } -// Verification info for request signed by all intermediate nodes +// Verification info for request signed by all intermediate nodes. message RequestVerificationHeader { // Request Body signature. Should be generated once by request initiator. neo.fs.v2.refs.Signature body_signature = 1; - // Request Meta signature is added and signed by any intermediate node + // Request Meta signature is added and signed by each intermediate node neo.fs.v2.refs.Signature meta_signature = 2; - // Sign previous hops + // Signature of previous hops neo.fs.v2.refs.Signature origin_signature = 3; // Chain of previous hops signatures @@ -152,9 +154,9 @@ message RequestVerificationHeader { message ResponseVerificationHeader { // Response Body signature. Should be generated once by answering node. neo.fs.v2.refs.Signature body_signature = 1; - // Response Meta signature is added and signed by any intermediate node + // Response Meta signature is added and signed by each intermediate node neo.fs.v2.refs.Signature meta_signature = 2; - // Sign previous hops + // Signature of previous hops neo.fs.v2.refs.Signature origin_signature = 3; // Chain of previous hops signatures From bfe43818ebfdf400484f83c552f075b6edbe3c96 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 16 Oct 2020 11:05:19 +0300 Subject: [PATCH 207/440] Update storagegroup package docs Signed-off-by: Stanislav Bogatyrev --- storagegroup/types.proto | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 5f17662..66e23e5 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -7,24 +7,22 @@ option csharp_namespace = "NeoFS.API.v2.StorageGroup"; import "refs/types.proto"; -// StorageGroup groups the information about the NeoFS storage group. -// The storage group consists of objects from single container. +// StorageGroup keeps verification information for Data Audit sessions. Objects +// that require payed storage guaranties are gathered in `StorageGroups` with +// additional information used for proof of storage. `StorageGroup` only +// contains objects from the same container. message StorageGroup { - // validation_data_size carries the total size of the payloads of the storage - // group members. + // Total size of the payloads of objects in the storage group uint64 validation_data_size = 1; - // validation_hash carries homomorphic hash from the concatenation of the - // payloads of the storage group members - // The order of concatenation is the same as the order of the members in the - // Members field. + // Homomorphic hash from the concatenation of the payloads of the storage + // group members. The order of concatenation is the same as the order of the + // members in the `members` field. neo.fs.v2.refs.Checksum validation_hash = 2; - // expiration_epoch carries last NeoFS epoch number of the storage group - // lifetime. + // Last NeoFS epoch number of the storage group lifetime uint64 expiration_epoch = 3; - // Members carries the list of identifiers of the object storage group members. - // The list is strictly ordered. + // Strictly ordered list of storage group member objects repeated neo.fs.v2.refs.ObjectID members = 4; } From 095a6cb0431af81bf1b0fbd15cf5ae7c4acdfc46 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 16 Oct 2020 11:23:18 +0300 Subject: [PATCH 208/440] Remove `docs` directory Human-written API documentation is now in NeoFS Specification. Signed-off-by: Stanislav Bogatyrev --- README.md | 1 - docs/.gitkeep | 0 2 files changed, 1 deletion(-) delete mode 100644 docs/.gitkeep diff --git a/README.md b/README.md index f87fccb..ab60b0f 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ This repository contains: - protocol buffers packages - [auto-generated docs](proto-docs) for protocol buffers -- [manually written docs](docs) for developers (to be done) ## Contributing diff --git a/docs/.gitkeep b/docs/.gitkeep deleted file mode 100644 index e69de29..0000000 From a6ecab41b839a5a3bb0f72278fccc5220d48bab3 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 16 Oct 2020 14:40:12 +0300 Subject: [PATCH 209/440] Update auto-generated docs Signed-off-by: Stanislav Bogatyrev --- proto-docs/accounting.md | 45 ++++---- proto-docs/acl.md | 75 +++++++----- proto-docs/container.md | 145 +++++++++++++---------- proto-docs/netmap.md | 96 ++++++++++++---- proto-docs/object.md | 228 +++++++++++++++++++++---------------- proto-docs/refs.md | 42 ++++--- proto-docs/session.md | 86 +++++++------- proto-docs/storagegroup.md | 14 ++- 8 files changed, 433 insertions(+), 298 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 202d639..8050a1a 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -35,8 +35,11 @@ ### Service "neo.fs.v2.accounting.AccountingService" -The service provides methods for obtaining information -about the account balance in NeoFS system. +Accounting service provides methods for interaction with NeoFS sidechain via +other NeoFS nodes to get information about the account balance. Deposit and +Withdraw operations can't be implemented here, as they require Mainnet NeoFS +smart contract invocation. Transfer operations between internal NeoFS +accounts are possible, if both use the same token type. ``` rpc Balance(BalanceRequest) returns (BalanceResponse); @@ -45,7 +48,7 @@ rpc Balance(BalanceRequest) returns (BalanceResponse); #### Method Balance -Returns the amount of funds for the requested NeoFS account. +Returns the amount of funds in GAS token for the requested NeoFS account. | Name | Input | Output | | ---- | ----- | ------ | @@ -56,13 +59,7 @@ Returns the amount of funds for the requested NeoFS account. ### Message BalanceRequest -Message defines the request body of Balance method. - -To indicate the account for which the balance is requested, it's identifier -is used. - -To gain access to the requested information, the request body must be formed -according to the requirements from the system specification. +BalanceRequest message | Field | Type | Label | Description | @@ -75,20 +72,21 @@ according to the requirements from the system specification. ### Message BalanceRequest.Body -Request body +To indicate the account for which the balance is requested, it's identifier +is used. It can be any existing account in NeoFS sidechain `Balance` smart +contract. If omitted, client implementation MUST set it to the request's +signer `OwnerID`. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries user identifier in NeoFS system for which the balance is requested. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Valid user identifier in `OwnerID` format for which the balance is requested. Required field. | ### Message BalanceResponse -Message defines the response body of Balance method. - -The amount of funds is calculated in decimal numbers. +BalanceResponse message | Field | Type | Label | Description | @@ -101,12 +99,13 @@ The amount of funds is calculated in decimal numbers. ### Message BalanceResponse.Body -Request body +The amount of funds in GAS token for the `OwnerID`'s account requested. +Balance is `Decimal` format to avoid precision issues with rounding. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| balance | [Decimal](#neo.fs.v2.accounting.Decimal) | | Carries the amount of funds on the account. | +| balance | [Decimal](#neo.fs.v2.accounting.Decimal) | | Amount of funds in GAS token for the requested account. | @@ -126,13 +125,19 @@ Request body ### Message Decimal -Decimal represents the decimal numbers. +Standard floating point data type can't be used in NeoFS due to inexactness +of the result when doing lots of small number operations. To solve the lost +precision issue, special `Decimal` format is used for monetary computations. + +Please see [The General Decimal Arithmetic +Specification](http://speleotrove.com/decimal/) for detailed problem +description. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| value | [int64](#int64) | | value carries number value. | -| precision | [uint32](#uint32) | | precision carries value precision. | +| value | [int64](#int64) | | Number in smallest Token fractions. | +| precision | [uint32](#uint32) | | Precision value indicating how many smallest fractions can be in one integer. | diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 9707195..39653fa 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -31,7 +31,12 @@ ### Message BearerToken -BearerToken has information about request ACL rules with limited lifetime +BearerToken allows to attach signed Extended ACL rules to the request in +`RequestMetaHeader`. If container's Basic ACL rules allow, the attached rule +set will be checked instead of one attached to the container itself. Just +like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be +used in the similar use cases, like providing authorisation to externally +authenticated party. | Field | Type | Label | Description | @@ -43,20 +48,22 @@ BearerToken has information about request ACL rules with limited lifetime ### Message BearerToken.Body -Bearer Token body +Bearer Token body structure contains Extended ACL table issued by container +owner with additional information preventing token's abuse. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | EACLTable carries table of extended ACL rules | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the token owner | +| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` to whom the token was issued. MUST match with the request originator's `OwnerID` | | lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | ### Message BearerToken.Body.TokenLifetime -Lifetime parameters of the token. Filed names taken from rfc7519. +Lifetime parameters of the token. Filed names taken from +[rfc7519](https://tools.ietf.org/html/rfc7519). | Field | Type | Label | Description | @@ -69,54 +76,58 @@ Lifetime parameters of the token. Filed names taken from rfc7519. ### Message EACLRecord -EACLRecord groups information about extended ACL rule. +Describes a single eACL rule. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| operation | [Operation](#neo.fs.v2.acl.Operation) | | Operation carries type of operation. | -| action | [Action](#neo.fs.v2.acl.Action) | | Action carries ACL target action. | -| filters | [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) | repeated | filters carries set of filters. | -| targets | [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) | repeated | targets carries information about extended ACL target list. | +| operation | [Operation](#neo.fs.v2.acl.Operation) | | NeoFS request Verb to match | +| action | [Action](#neo.fs.v2.acl.Action) | | Rule execution result. Either allows or denies access if filters match. | +| filters | [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) | repeated | List of filters to match and see if rule is applicable | +| targets | [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) | repeated | List of target subjects to apply ACL rule to | ### Message EACLRecord.Filter -Filter definition +Filter to check particular properties of the request or object. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header_type | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Header carries type of header. | -| match_type | [MatchType](#neo.fs.v2.acl.MatchType) | | MatchType carries type of match. | -| header_name | [string](#string) | | header_name carries name of filtering header. | -| header_val | [string](#string) | | header_val carries value of filtering header. | +| header_type | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Define if Object or Request header will be used | +| match_type | [MatchType](#neo.fs.v2.acl.MatchType) | | Match operation type | +| header_name | [string](#string) | | Name of the Header to use | +| header_val | [string](#string) | | Expected Header Value or pattern to match | ### Message EACLRecord.Target -Information about extended ACL target. +Target to apply ACL rule. Can be a subject's role class or a list of public +keys to match. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| role | [Role](#neo.fs.v2.acl.Role) | | target carries target of ACL rule. | -| key_list | [bytes](#bytes) | repeated | key_list carries public keys of ACL target. | +| role | [Role](#neo.fs.v2.acl.Role) | | Target subject's role class | +| key_list | [bytes](#bytes) | repeated | List of public keys to identify target subject | ### Message EACLTable -EACLRecord carries the information about extended ACL rules. +Extended ACL rules table. Defined a list of ACL rules additionally to Basic +ACL. Extended ACL rules can be attached to the container and can be updated +or may be defined in `BearerToken` structure. Please see the corresponding +NeoFS Technical Specification's section for detailed description. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | eACL format version. Effectively the version of API library used to create eACL Table | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Carries identifier of the container that should use given access control rules. | -| records | [EACLRecord](#neo.fs.v2.acl.EACLRecord) | repeated | Records carries list of extended ACL rule records. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | eACL format version. Effectively the version of API library used to create eACL Table. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container that should use given access control rules | +| records | [EACLRecord](#neo.fs.v2.acl.EACLRecord) | repeated | List of Extended ACL rules | @@ -124,11 +135,12 @@ EACLRecord carries the information about extended ACL rules. ### Action -Action is an enumeration of EACL actions. +Rule execution result action. Either allows or denies access if the rule's +filters match. | Name | Number | Description | | ---- | ------ | ----------- | -| ACTION_UNSPECIFIED | 0 | Unspecified action, default value. | +| ACTION_UNSPECIFIED | 0 | Unspecified action, default value | | ALLOW | 1 | Allow action | | DENY | 2 | Deny action | @@ -137,7 +149,7 @@ Action is an enumeration of EACL actions. ### HeaderType -Header is an enumeration of filtering header types. +Enumeration of possible sources of Headers to apply filters. | Name | Number | Description | | ---- | ------ | ----------- | @@ -163,11 +175,12 @@ MatchType is an enumeration of match types. ### Operation -Operation is an enumeration of operation types. +Request's operation type to match if the rule is applicable to a particular +request. | Name | Number | Description | | ---- | ------ | ----------- | -| OPERATION_UNSPECIFIED | 0 | Unspecified operation, default value. | +| OPERATION_UNSPECIFIED | 0 | Unspecified operation, default value | | GET | 1 | Get | | HEAD | 2 | Head | | PUT | 3 | Put | @@ -185,10 +198,10 @@ Target role of the access control rule in access control list. | Name | Number | Description | | ---- | ------ | ----------- | -| ROLE_UNSPECIFIED | 0 | Unspecified role, default value. | -| USER | 1 | User target rule is applied if sender is the owner of the container. | -| SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node. | -| OTHERS | 3 | Others target rule is applied if sender is not user or system target. | +| ROLE_UNSPECIFIED | 0 | Unspecified role, default value | +| USER | 1 | User target rule is applied if sender is the owner of the container | +| SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node | +| OTHERS | 3 | Others target rule is applied if sender is not user nor system target | diff --git a/proto-docs/container.md b/proto-docs/container.md index 587ddb2..28982fb 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -56,8 +56,10 @@ ### Service "neo.fs.v2.container.ContainerService" -ContainerService provides API to access container smart-contract in morph chain -via NeoFS node. +`ContainerService` provides API to interact with `Container` smart contract +in NeoFS sidechain via other NeoFS nodes. All of those actions can be done +equivalently by directly issuing transactions and RPC calls to sidechain +nodes. ``` rpc Put(PutRequest) returns (PutResponse); @@ -71,52 +73,51 @@ rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); #### Method Put -Put invokes 'Put' method in container smart-contract and returns -response immediately. After new block in morph chain, request is verified -by inner ring nodes. After one more block in morph chain, container -added into smart-contract storage. +`Put` invokes `Container` smart contract's `Put` method and returns +response immediately. After a new block is issued in sidechain, request is +verified by Inner Ring nodes. After one more block in sidechain, container +is added into smart contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Put | [PutRequest](#neo.fs.v2.container.PutRequest) | [PutResponse](#neo.fs.v2.container.PutResponse) | #### Method Delete -Delete invokes 'Delete' method in container smart-contract and returns -response immediately. After new block in morph chain, request is verified -by inner ring nodes. After one more block in morph chain, container -removed from smart-contract storage. +`Delete` invokes `Container` smart contract's `Delete` method and returns +response immediately. After a new block is issued in sidechain, request is +verified by Inner Ring nodes. After one more block in sidechain, container +is added into smart contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Delete | [DeleteRequest](#neo.fs.v2.container.DeleteRequest) | [DeleteResponse](#neo.fs.v2.container.DeleteResponse) | #### Method Get -Get returns container from container smart-contract storage. +Returns container structure from `Container` smart contract storage. | Name | Input | Output | | ---- | ----- | ------ | | Get | [GetRequest](#neo.fs.v2.container.GetRequest) | [GetResponse](#neo.fs.v2.container.GetResponse) | #### Method List -List returns all owner's containers from container smart-contract -storage. +Returns all owner's containers from 'Container` smart contract' storage. | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) | #### Method SetExtendedACL -SetExtendedACL invokes 'SetEACL' method in container smart-contract and -returns response immediately. After new block in morph chain, -Extended ACL added into smart-contract storage. +Invokes 'SetEACL' method of 'Container` smart contract and returns response +immediately. After one more block in sidechain, Extended ACL changes are +added into smart contract storage. | Name | Input | Output | | ---- | ----- | ------ | | SetExtendedACL | [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) | [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) | #### Method GetExtendedACL -GetExtendedACL returns Extended ACL table and signature from container -smart-contract storage. +Returns Extended ACL table and signature from `Container` smart contract +storage. | Name | Input | Output | | ---- | ----- | ------ | @@ -140,20 +141,22 @@ Container removal request ### Message DeleteRequest.Body -Request body +Container removal request body has a signed `ContainerID` as a proof of +container owner's intent. The signature will be verified by `Container` +smart contract, so signing algorithm must be supported by NeoVM. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to delete from NeoFS. | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of container id according to RFC-6979. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to delete from NeoFS | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `ContainerID` signed with the container owner's key according to RFC-6979 | ### Message DeleteResponse -DeleteResponse is empty because delete operation is asynchronous and done -via consensus in inner ring nodes +`DeleteResponse` has an empty body because delete operation is asynchronous +and done via consensus in Inner Ring nodes. | Field | Type | Label | Description | @@ -166,7 +169,8 @@ via consensus in inner ring nodes ### Message DeleteResponse.Body -Response body +`DeleteResponse` has an empty body because delete operation is asynchronous +and done via consensus in Inner Ring nodes. @@ -186,12 +190,12 @@ Get Extended ACL ### Message GetExtendedACLRequest.Body -Request body +Get Extended ACL request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container that has Extended ACL. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container having Extended ACL | @@ -210,13 +214,15 @@ Get Extended ACL ### Message GetExtendedACLResponse.Body -Response body +Get Extended ACL Response body can be empty if the requested container did +not have Extended ACL Table attached or Extended ACL was not allowed at +container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL that has been requested if it was set up. | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL requested, if available | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979 | @@ -235,12 +241,12 @@ Get container structure ### Message GetRequest.Body -Request body +Get container structure request body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the container to get. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to get | @@ -259,12 +265,13 @@ Get container structure ### Message GetResponse.Body -Response body +Get container response body does not have container structure signature. It +was already verified on container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container | [Container](#neo.fs.v2.container.Container) | | Container that has been requested. | +| container | [Container](#neo.fs.v2.container.Container) | | Requested container structure | @@ -275,7 +282,7 @@ List containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) | | Body of list containers request message. | +| body | [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) | | Body of list containers request message | | meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -283,12 +290,12 @@ List containers ### Message ListRequest.Body -Request body +List containers request body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | owner_id carries identifier of the container owner. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the container owner | @@ -307,12 +314,12 @@ List containers ### Message ListResponse.Body -Response body +List containers response body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_ids | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | repeated | ContainerIDs carries list of identifiers of the containers that belong to the owner. | +| container_ids | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | repeated | List of `ContainerID`s belonging to the requested `OwnerID` | @@ -331,13 +338,17 @@ New NeoFS Container creation request ### Message PutRequest.Body -Request body +Container creation request has container structure's signature as a +separate field. It's not stored in sidechain, just verified on container +creation by `Container` smart contract. `ContainerID` is a SHA256 hash of +the stable-marshalled container strucutre, hence there is no need for +additional signature checks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container | [Container](#neo.fs.v2.container.Container) | | Container to create in NeoFS. | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled container according to RFC-6979. | +| container | [Container](#neo.fs.v2.container.Container) | | Container structure to register in NeoFS | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979 | @@ -356,12 +367,15 @@ New NeoFS Container creation response ### Message PutResponse.Body -Response body +Container put response body contains information about the newly registered +container as seen by `Container` smart contract. `ContainerID` can be +calculated beforehand from the container structure and compared to the one +returned here to make sure everything was done as expected. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries identifier of the new container. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Unique identifier of the newly created container | @@ -380,13 +394,14 @@ Set Extended ACL ### Message SetExtendedACLRequest.Body -Request body +Set Extended ACL request body does not have separate `ContainerID` +reference. It will be taken from `EACLTable.container_id` field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL to set for the container. | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | +| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for container | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL table according to RFC-6979 | @@ -405,7 +420,9 @@ Set Extended ACL ### Message SetExtendedACLResponse.Body -Response body +`SetExtendedACLResponse` has an empty body because the operation is +asynchronous and update should be reflected in `Container` smart contract's +storage after next block is issued in sidechain. @@ -426,32 +443,40 @@ Response body ### Message Container -Container is a structure that defines object placement behaviour. Objects -can be stored only within containers. They define placement rule, attributes -and access control information. ID of the container is a 32 byte long -SHA256 hash of stable-marshalled container message. +Container is a structure that defines object placement behaviour. Objects can +be stored only within containers. They define placement rule, attributes and +access control information. ID of the container is a 32 byte long SHA256 hash +of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively the version of API library used to create container | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the container owner. | -| nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | -| basic_acl | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | -| attributes | [Container.Attribute](#neo.fs.v2.container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. | -| placement_policy | [neo.fs.v2.netmap.PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) | | Placement policy for the object inside the container. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively the version of API library used to create container. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the container owner | +| nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id | +| basic_acl | [uint32](#uint32) | | `BasicACL` contains access control rules for owner, system, others groups and permission bits for `BearerToken` and `Extended ACL` | +| attributes | [Container.Attribute](#neo.fs.v2.container.Container.Attribute) | repeated | Attributes represent immutable container's meta data | +| placement_policy | [neo.fs.v2.netmap.PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) | | Placement policy for the object inside the container | ### Message Container.Attribute -Attribute is a key-value pair of strings. +`Attribute` is a user-defined Key-Value metadata pair attached to the +container. Container attribute are immutable. They are set at container +creation and cna never be added or updated. + +There are some "well-known" attributes affecting system behaviour: + +* Subnet \ + String ID of container's storage subnet. Container can be attached to + only one subnet. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Key of immutable container attribute. | -| value | [string](#string) | | Value of immutable container attribute. | +| key | [string](#string) | | Attribute name key | +| value | [string](#string) | | Attribute value | diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index efe659e..30386ec 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -40,7 +40,10 @@ ### Service "neo.fs.v2.netmap.NetmapService" -Methods to work with NetworkMap +`NetmapService` provides methods to work with `Network Map` and information +required to build it. The resulting `Network Map` is stored in sidechain +`Netmap` smart contract, while related information can be obtained from other +NeoFS nodes. ``` rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); @@ -49,7 +52,11 @@ rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); #### Method LocalNodeInfo -Return information about Node +Get NodeInfo structure from the particular node directly. Node information +can be taken from `Netmap` smart contract, but in some cases the one may +want to get recent information directly, or to talk to the node not yet +present in `Network Map` to find out what API version can be used for +further communication. Can also be used to check if node is up and running. | Name | Input | Output | | ---- | ----- | ------ | @@ -60,12 +67,12 @@ Return information about Node ### Message LocalNodeInfoRequest -Get NodeInfo from the particular node directly +Get NodeInfo structure from the particular node directly | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) | | Body of the balance request message. | +| body | [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) | | Body of the LocalNodeInfo request message | | meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -73,14 +80,14 @@ Get NodeInfo from the particular node directly ### Message LocalNodeInfoRequest.Body -Request body +LocalNodeInfo request body is empty. ### Message LocalNodeInfoResponse -Local nod Info, including API Version in use +Local Node Info, including API Version in use | Field | Type | Label | Description | @@ -93,13 +100,13 @@ Local nod Info, including API Version in use ### Message LocalNodeInfoResponse.Body -Response body +Local Node Info, including API Version in use. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | API version in use | -| node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo from node itself | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Latest NeoFS API version in use | +| node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo structure with recent information from node itself | @@ -119,12 +126,13 @@ Response body ### Message Filter -Filter +Filter will return the subset of nodes from `NetworkMap` or another filter's +results, that will satisfy filter's conditions. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | Name of the filter or a reference to the named filter. '*' means application to the whole unfiltered NetworkMap At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | +| name | [string](#string) | | Name of the filter or a reference to the named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | | key | [string](#string) | | Key to filter | | op | [Operation](#neo.fs.v2.netmap.Operation) | | Filtering operation | | value | [string](#string) | | Value to match | @@ -148,26 +156,63 @@ NeoFS node description ### Message NodeInfo.Attribute -Attributes of the NeoFS node. +Administrator-defined Attributes of the NeoFS Storage Node. + +Node's attributes are mostly used during Storage Policy evaluation to +calculate object's placement and find a set of nodes satisfying policy +requirements. There are some "well-known" node attributes common to all the +Storage Nodes in the network and used implicitly with default values if not +explicitly set: + +* Capacity \ + Total available disk space in Gigabytes. +* Price \ + Price in GAS tokens for storing one GB of data during one Epoch. In node + attributes it's a string presenting floating point number with comma or + point delimiter for decimal part. In the Network Map it will be saved as + 64-bit unsigned integer representing number of minimal token fractions. +* Subnet \ + String ID of Node's storage subnet. There can be only one subnet served + by the Storage Node. +* Locode \ + Node's geographic location in + [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) + format approximated to the nearest point defined in standard. +* Country \ + Country code in + [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + format. Calculated automatically from `Locode` attribute +* Region \ + Country's administative subdivision where node is located. Calculated + automatically from `Locode` attribute based on `SubDiv` field. Presented + in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. +* City \ + City, town, village or rural area name where node is located written + without diacritics . Calculated automatically from `Locode` attribute. + +For detailed description of each well-known attribute please see the +corresponding section in NeoFS Technical specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | key | [string](#string) | | Key of the node attribute. | | value | [string](#string) | | Value of the node attribute. | -| parents | [string](#string) | repeated | Parent keys, if any Example: For City it can be Region or Country | +| parents | [string](#string) | repeated | Parent keys, if any. For example for `City` it could be `Region` and `Country`. | ### Message PlacementPolicy -Set of rules to select a subset of nodes able to store container's objects +Set of rules to select a subset of nodes from `NetworkMap` able to store +container's objects. The format is simple enough to transpile from different +storage policy definition languages. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a particular bucket | -| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container. | +| replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a named bucket | +| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset | | selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | @@ -175,25 +220,28 @@ Set of rules to select a subset of nodes able to store container's objects ### Message Replica -Exact bucket for each replica +Number of object replicas in a set of nodes from the defined selector. If no +selector set the root bucket containing all possible nodes will be used by +default. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | count | [uint32](#uint32) | | How many object replicas to put | -| selector | [string](#string) | | Named selector bucket to put in | +| selector | [string](#string) | | Named selector bucket to put replicas | ### Message Selector -Selector +Selector chooses a number of nodes from the bucket taking the nearest nodes +to the provided `ContainerID` by hash distance. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | name | [string](#string) | | Selector name to reference in object placement section | -| count | [uint32](#uint32) | | How many nodes to select from bucket | +| count | [uint32](#uint32) | | How many nodes to select from the bucket | | clause | [Clause](#neo.fs.v2.netmap.Clause) | | Selector modifier showing how to form a bucket | | attribute | [string](#string) | | Attribute bucket to select from | | filter | [string](#string) | | Filter reference to select from | @@ -204,13 +252,13 @@ Selector ### Clause -Selector modifier showing how the node set will be formed -By default selector just groups by attribute into a bucket selecting nodes -only by their hash distance. +Selector modifier shows how the node set will be formed. By default selector +just groups nodes into a bucket by attribute, selecting nodes only by their +hash distance. | Name | Number | Description | | ---- | ------ | ----------- | -| CLAUSE_UNSPECIFIED | 0 | No modifier defined | +| CLAUSE_UNSPECIFIED | 0 | No modifier defined. Will select nodes from bucket randomly. | | SAME | 1 | SAME will select only nodes having the same value of bucket attribute | | DISTINCT | 2 | DISTINCT will select nodes having different values of bucket attribute | diff --git a/proto-docs/object.md b/proto-docs/object.md index 941bca9..12d923a 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -68,7 +68,8 @@ ### Service "neo.fs.v2.object.ObjectService" -Object service provides API for manipulating with the object. +`ObjectService` provides API for manipulating objects. Object operations do +not interact with sidechain and are only served by nodes in p2p style. ``` rpc Get(GetRequest) returns (stream GetResponse); @@ -83,11 +84,12 @@ rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); #### Method Get -Get the object from container. Response uses gRPC stream. First response -message carry object of requested address. Chunk messages are parts of -the object's payload if it is needed. All messages except first carry -chunks. Requested object can be restored by concatenation of object -message payload and all chunks keeping receiving order. +Receive full object structure, including Headers and payload. Response uses +gRPC stream. First response message carries object with requested address. +Chunk messages are parts of the object's payload if it is needed. All +messages, except the first one, carry payload chunks. Requested object can +be restored by concatenation of object message payload and all chunks +keeping receiving order. | Name | Input | Output | | ---- | ----- | ------ | @@ -95,55 +97,57 @@ message payload and all chunks keeping receiving order. #### Method Put Put the object into container. Request uses gRPC stream. First message -SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD -BE set. Session token SHOULD BE obtained before put operation (see -session package). Chunk messages considered by server as part of object -payload. All messages except first SHOULD BE chunks. Chunk messages -SHOULD BE sent in direct order of fragmentation. +SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object +SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see +session package). Chunk messages are considered by server as a part of an +object payload. All messages, except first one, SHOULD be payload chunks. +Chunk messages SHOULD be sent in direct order of fragmentation. | Name | Input | Output | | ---- | ----- | ------ | | Put | [PutRequest](#neo.fs.v2.object.PutRequest) | [PutResponse](#neo.fs.v2.object.PutResponse) | #### Method Delete -Delete the object from a container +Delete the object from a container. There is no immediate removal +guarantee. Object will be marked for removal and deleted eventually. | Name | Input | Output | | ---- | ----- | ------ | | Delete | [DeleteRequest](#neo.fs.v2.object.DeleteRequest) | [DeleteResponse](#neo.fs.v2.object.DeleteResponse) | #### Method Head -Head returns the object without data payload. Object in the -response has system header only. If full headers flag is set, extended -headers are also present. +Returns the object Headers without data payload. By default full header is +returned. If `main_only` request field is set, the short header with only +the very minimal information would be returned instead. | Name | Input | Output | | ---- | ----- | ------ | | Head | [HeadRequest](#neo.fs.v2.object.HeadRequest) | [HeadResponse](#neo.fs.v2.object.HeadResponse) | #### Method Search -Search objects in container. Version of query language format SHOULD BE -set to 1. Search query represented in serialized format (see query -package). +Search objects in container. Search query allows to match by Object +Header's filed values. Please see the corresponding NeoFS Technical +Specification section for more details. | Name | Input | Output | | ---- | ----- | ------ | | Search | [SearchRequest](#neo.fs.v2.object.SearchRequest) | [SearchResponse](#neo.fs.v2.object.SearchResponse) | #### Method GetRange -GetRange of data payload. Range is a pair (offset, length). -Requested range can be restored by concatenation of all chunks -keeping receiving order. +Get byte range of data payload. Range is set as an (offset, length) tuple. +Like in `Get` method, the response uses gRPC stream. Requested range can be +restored by concatenation of all received payload chunks keeping receiving +order. | Name | Input | Output | | ---- | ----- | ------ | | GetRange | [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) | [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) | #### Method GetRangeHash -GetRangeHash returns homomorphic hash of object payload range after XOR -operation. Ranges are set of pairs (offset, length). Hashes order in -response corresponds to ranges order in request. Homomorphic hash is -calculated for XORed data. +Returns homomorphic or regular hash of object's payload range after +applying XOR operation with the provided `salt`. Ranges are set of (offset, +length) tuples. Hashes order in response corresponds to ranges order in +request. Note that hash is calculated for XORed data. | Name | Input | Output | | ---- | ----- | ------ | @@ -154,7 +158,7 @@ calculated for XORed data. ### Message DeleteRequest -Object Delete request +Object DELETE request | Field | Type | Label | Description | @@ -167,19 +171,19 @@ Object Delete request ### Message DeleteRequest.Body -Request body +Object DELETE request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries the address of the object to be deleted. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object to be deleted | ### Message DeleteResponse -DeleteResponse is empty because we cannot guarantee permanent object removal -in distributed system. +DeleteResponse body is empty because we cannot guarantee permanent object +removal in distributed system. | Field | Type | Label | Description | @@ -192,7 +196,7 @@ in distributed system. ### Message DeleteResponse.Body -Response body +Object DELETE Response has an empty body. @@ -212,14 +216,14 @@ Get hash of object's payload part ### Message GetRangeHashRequest.Body -Request body +Get hash of object's payload part request body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Carries address of the object that contains the requested payload range. | -| ranges | [Range](#neo.fs.v2.object.Range) | repeated | Carries the list of object payload range to calculate homomorphic hash. | -| salt | [bytes](#bytes) | | Carries binary salt to XOR object payload ranges before hash calculation. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object that containing the requested payload range | +| ranges | [Range](#neo.fs.v2.object.Range) | repeated | List of object's payload ranges to calculate homomorphic hash | +| salt | [bytes](#bytes) | | Binary salt to XOR object's payload ranges before hash calculation | | type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | @@ -239,19 +243,19 @@ Get hash of object's payload part ### Message GetRangeHashResponse.Body -Response body +Get hash of object's payload part response body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | type | [neo.fs.v2.refs.ChecksumType](#neo.fs.v2.refs.ChecksumType) | | Checksum algorithm type | -| hash_list | [bytes](#bytes) | repeated | List of range hashes in a binary format. | +| hash_list | [bytes](#bytes) | repeated | List of range hashes in a binary format | ### Message GetRangeRequest -Request to get part of object's payload +Request part of object's payload | Field | Type | Label | Description | @@ -264,13 +268,13 @@ Request to get part of object's payload ### Message GetRangeRequest.Body -Request Body +Byte range of object's payload request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address carries address of the object that contains the requested payload range. | -| range | [Range](#neo.fs.v2.object.Range) | | Range carries the parameters of the requested payload range. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object containing the requested payload range | +| range | [Range](#neo.fs.v2.object.Range) | | Requested payload range | @@ -289,18 +293,21 @@ Get part of object's payload ### Message GetRangeResponse.Body -Response body +Get Range response body uses streams to transfer the response. Because +object payload considered a byte sequence, there is no need to have some +initial preamble message. The requested byte range is sent as a series +chunks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| chunk | [bytes](#bytes) | | Carries part of the object payload. | +| chunk | [bytes](#bytes) | | Chunked object payload's range | ### Message GetRequest -Get object request +GET object request | Field | Type | Label | Description | @@ -313,19 +320,19 @@ Get object request ### Message GetRequest.Body -Request body +GET Object request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the requested object. | -| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the objects that are physically stored on the server. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the requested object | +| raw | [bool](#bool) | | If `raw` flag is set, request will work only with objects that are physically stored on the peer node | ### Message GetResponse -get object response +GET object response | Field | Type | Label | Description | @@ -338,32 +345,33 @@ get object response ### Message GetResponse.Body -Response body +GET Object Response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| init | [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) | | Initialization parameters of the object stream. | -| chunk | [bytes](#bytes) | | Part of the object payload. | +| init | [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) | | Initial part of the object stream | +| chunk | [bytes](#bytes) | | Chunked object payload | ### Message GetResponse.Body.Init -Initialization parameters of the object got from NeoFS. +Initial part of the `Object` structure stream. Technically it's a +set of all `Object` structure's fields except `payload`. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature | -| header | [Header](#neo.fs.v2.object.Header) | | Object header. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed `ObjectID` | +| header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | ### Message HeadRequest -Object head request +Object HEAD request | Field | Type | Label | Description | @@ -376,20 +384,20 @@ Object head request ### Message HeadRequest.Body -Request body +Object HEAD request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object with the requested header. | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object with the requested Header | | main_only | [bool](#bool) | | Return only minimal header subset | -| raw | [bool](#bool) | | Carries the raw option flag of the request. Raw request is sent to receive only the headers of the objects that are physically stored on the server. | +| raw | [bool](#bool) | | If `raw` flag is set, request will work only with objects that are physically stored on the peer node | ### Message HeadResponse -Head response +Object HEAD response | Field | Type | Label | Description | @@ -402,31 +410,37 @@ Head response ### Message HeadResponse.Body -Response body +Object HEAD response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object header with object ID signature | +| header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object's `Header` with `ObjectID` signature | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | ### Message HeaderWithSignature -Tuple of full object header and signature of object ID. +Tuple of full object header and signature of `ObjectID`. \ +Signed `ObjectID` is present to verify full header's authenticity through the +following steps: + +1. Calculate `SHA-256` of marshalled `Header` structure +2. Check if the resulting hash matched `ObjectID` +3. Check if `ObjectID` signature in `signature` field is correct | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | header | [Header](#neo.fs.v2.object.Header) | | Full object header | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id to verify full header's authenticity through following steps: 1. Calculate SHA-256 of marshalled Headers structure. 2. Check if the resulting hash matched ObjectID 3. Check if ObjectID's signature in signature field is correct. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed `ObjectID` to verify full header's authenticity | ### Message PutRequest -Put object request +PUT object request | Field | Type | Label | Description | @@ -439,33 +453,34 @@ Put object request ### Message PutRequest.Body -Request body +PUT request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| init | [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) | | Carries the initialization parameters of the object stream. | -| chunk | [bytes](#bytes) | | Carries part of the object payload. | +| init | [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) | | Initial part of the object stream | +| chunk | [bytes](#bytes) | | Chunked object payload | ### Message PutRequest.Body.Init -Groups initialization parameters of object placement in NeoFS. +Newly created object structure parameters. If some optional parameters +are not set, they will be calculated by a peer node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID, where available | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature, were available | -| header | [Header](#neo.fs.v2.object.Header) | | Header of the object to save in the system. | -| copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. Default zero value is processed according to the container placement rules. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | ObjectID if available. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature if available | +| header | [Header](#neo.fs.v2.object.Header) | | Object's Header | +| copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. By default object is processed according to the container's placement policy. | ### Message PutResponse -Put object response +PUT Object response | Field | Type | Label | Description | @@ -478,30 +493,30 @@ Put object response ### Message PutResponse.Body -Response body +PUT Object response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Carries identifier of the saved object. It is used to access an object in the container. | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the saved object | ### Message Range -Range groups the parameters of object payload range. +Object payload range.Ranges of zero length SHOULD be considered as invalid. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| offset | [uint64](#uint64) | | Carries the offset of the range from the object payload start. | -| length | [uint64](#uint64) | | Carries the length of the object payload range. | +| offset | [uint64](#uint64) | | Offset of the range from the object payload start | +| length | [uint64](#uint64) | | Length in bytes of the object payload range | ### Message SearchRequest -Search objects request +Object Search request | Field | Type | Label | Description | @@ -514,12 +529,12 @@ Search objects request ### Message SearchRequest.Body -Request body +Object Search request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Carries search container identifier. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Container identifier were to search | | version | [uint32](#uint32) | | Version of the Query Language used | | filters | [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) | repeated | List of search expressions | @@ -553,12 +568,12 @@ Search response ### Message SearchResponse.Body -Response body +Object Search response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id_list | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Carries list of object identifiers that match the search query | +| id_list | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of `ObjectID`s that match the search query | @@ -578,7 +593,7 @@ Response body ### Message Header -Object Headers +Object Header | Field | Type | Label | Description | @@ -587,19 +602,29 @@ Object Headers | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | -| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | | payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | -| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Special object type | +| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | | homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | -| split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy. | +| split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy | ### Message Header.Attribute -Attribute groups the user-defined Key-Value pairs attached to the object +`Attribute` is a user-defined Key-Value metadata pair attached to the +object. + +There are some "well-known" attributes starting with `__NEOFS__` prefix +that affect system behaviour: + +* __NEOFS__UPLOAD_ID +* __NEOFS__EXPIRATION_EPOCH + +For detailed description of each well-known attribute please see the +corresponding section in NeoFS Technical specification. | Field | Type | Label | Description | @@ -611,27 +636,32 @@ Attribute groups the user-defined Key-Value pairs attached to the object ### Message Header.Split -Information about spawning the objects through a payload splitting. +Bigger objects can be split into a chain of smaller objects. Information +about inter-dependencies between spawned objects and how to re-construct +the original one is in the `Split` headers. Parent and children objects +must be within the same container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| parent | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the origin object. Parent and children objects must be within the same container. Parent object_id is known only to the minor child. | -| previous | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Previous carries identifier of the left split neighbor. | +| parent | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the origin object. Known only to the minor child. | +| previous | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the left split neighbor | | parent_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | | parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | -| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. | +| children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of identifiers of the objects generated by splitting current one. | ### Message Object -Object structure. +Object structure. Object is immutable and content-addressed. It means +`ObjectID` will change if header or payload changes. It's calculated as a +hash of header field, which contains hash of object's payload. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. Object is content-addressed. It means id will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id | | header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | | payload | [bytes](#bytes) | | Payload bytes. | @@ -645,11 +675,11 @@ Short header fields | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | -| payload_length | [uint64](#uint64) | | Size of payload in bytes. 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | @@ -669,13 +699,13 @@ Type of match expression ### ObjectType -Type of the object payload content +Type of the object payload content. | Name | Number | Description | | ---- | ------ | ----------- | | REGULAR | 0 | Just a normal object | | TOMBSTONE | 1 | Used internally to identify deleted objects | -| STORAGE_GROUP | 2 | Identifies that the object holds StorageGroup information | +| STORAGE_GROUP | 2 | StorageGroup information | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 57d5157..f53d36a 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -31,19 +31,20 @@ ### Message Address -Address of object (container id + object id) +Object in NeoFS can be addressed by it's ContainerID and ObjectID. In string +format there MUST be a '/' delimeter between them. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [ContainerID](#neo.fs.v2.refs.ContainerID) | | container_id carries container identifier. | -| object_id | [ObjectID](#neo.fs.v2.refs.ObjectID) | | object_id carries object identifier. | +| container_id | [ContainerID](#neo.fs.v2.refs.ContainerID) | | Container identifier | +| object_id | [ObjectID](#neo.fs.v2.refs.ObjectID) | | Object identifier | ### Message Checksum -Checksum message +Checksum message. | Field | Type | Label | Description | @@ -55,58 +56,65 @@ Checksum message ### Message ContainerID -NeoFS container identifier. +NeoFS container identifier. Container structures are immutable and +content-addressed. `ContainerID` is a 32 byte long SHA256 hash of +stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| value | [bytes](#bytes) | | value carries the container identifier in a binary format. | +| value | [bytes](#bytes) | | Container identifier in a binary format. | ### Message ObjectID -NeoFS object identifier. +NeoFS Object unique identifier. Objects are immutable and content-addressed. +It means `ObjectID` will change if `header` or `payload` changes. `ObjectID` +is calculated as a hash of `header` field, which contains hash of object's +payload. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| value | [bytes](#bytes) | | value carries the object identifier in a binary format. | +| value | [bytes](#bytes) | | Object identifier in a binary format | ### Message OwnerID -OwnerID group information about the owner of the NeoFS container. +OwnerID is a derivative of a user's main public key. The transformation +algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can +be directly used as `OwnerID`. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| value | [bytes](#bytes) | | value carries the identifier of the container owner in a binary format. | +| value | [bytes](#bytes) | | Identifier of the container owner in a binary format | ### Message Signature -Signature of something in NeoFS +Signature of something in NeoFS. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | Public key used for signing. | +| key | [bytes](#bytes) | | Public key used for signing | | sign | [bytes](#bytes) | | Signature | ### Message Version -Represents API version used by node. +API version used by a node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| major | [uint32](#uint32) | | Major API version. | -| minor | [uint32](#uint32) | | Minor API version. | +| major | [uint32](#uint32) | | Major API version | +| minor | [uint32](#uint32) | | Minor API version | @@ -114,12 +122,12 @@ Represents API version used by node. ### ChecksumType -Checksum algorithm type +Checksum algorithm type. | Name | Number | Description | | ---- | ------ | ----------- | | CHECKSUM_TYPE_UNSPECIFIED | 0 | Unknown. Not used | -| TZ | 1 | Tillich-Zemor homomorphic hash funciton | +| TZ | 1 | Tillich-Zemor homomorphic hash function | | SHA256 | 2 | SHA-256 | diff --git a/proto-docs/session.md b/proto-docs/session.md index 9a6ee57..c61855d 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -43,7 +43,10 @@ ### Service "neo.fs.v2.session.SessionService" -Create Session record on Node side +`SessionService` allows to establish a temporary trust relationship between +two peer nodes and generate a `SessionToken` as the proof of trust to be +attached in requests for further verification. Please see corresponding +section of NeoFS Technical Specification for details. ``` rpc Create(CreateRequest) returns (CreateResponse); @@ -52,7 +55,7 @@ rpc Create(CreateRequest) returns (CreateResponse); #### Method Create -Create opens new session between the client and the server. +Opens a new session between two peers. | Name | Input | Output | | ---- | ----- | ------ | @@ -63,7 +66,7 @@ Create opens new session between the client and the server. ### Message CreateRequest -CreateRequest carries an information necessary for opening a session. +Information necessary for opening a session. | Field | Type | Label | Description | @@ -76,19 +79,19 @@ CreateRequest carries an information necessary for opening a session. ### Message CreateRequest.Body -Request body +Session creation request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Carries an identifier of a session initiator. | -| expiration | [uint64](#uint64) | | Expiration Epoch | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Dession initiating user's or node's key derived `OwnerID`. | +| expiration | [uint64](#uint64) | | Session expiration `Epoch` | ### Message CreateResponse -CreateResponse carries an information about the opened session. +Information about the opened session. | Field | Type | Label | Description | @@ -101,13 +104,13 @@ CreateResponse carries an information about the opened session. ### Message CreateResponse.Body -Response body +Session creation response body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [bytes](#bytes) | | id carries an identifier of session token. | -| session_key | [bytes](#bytes) | | session_key carries a session public key. | +| id | [bytes](#bytes) | | Identifier of a newly created session | +| session_key | [bytes](#bytes) | | Public key used for session | @@ -132,38 +135,39 @@ Context information for Session Tokens related to ObjectService requests | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| verb | [ObjectSessionContext.Verb](#neo.fs.v2.session.ObjectSessionContext.Verb) | | Verb is a type of request for which the token is issued | +| verb | [ObjectSessionContext.Verb](#neo.fs.v2.session.ObjectSessionContext.Verb) | | Type of request for which the token is issued | | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | ### Message RequestMetaHeader -Information about the request +Meta information attached to the request. When forwarded between peers, +request meta headers are folded in matryoshka style. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Client API version. | -| epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | -| ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | -| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Request X-Headers. | -| session_token | [SessionToken](#neo.fs.v2.session.SessionToken) | | Token is a token of the session within which the request is sent | -| bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | Bearer is a Bearer token of the request | -| origin | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | RequestMetaHeader of the origin request. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Peer's API version used | +| epoch | [uint64](#uint64) | | Peer's local epoch number. Set to 0 if unknown. | +| ttl | [uint32](#uint32) | | Maximum number of intermediate nodes in the request route | +| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Request X-Headers | +| session_token | [SessionToken](#neo.fs.v2.session.SessionToken) | | Session token within which the request is sent | +| bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | `BearerToken` with eACL overrides for the request | +| origin | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | `RequestMetaHeader` of the origin request | ### Message RequestVerificationHeader -Verification info for request signed by all intermediate nodes +Verification info for request signed by all intermediate nodes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by request initiator. | -| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by any intermediate node | -| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by each intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of previous hops | | origin | [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Chain of previous hops signatures | @@ -175,11 +179,11 @@ Information about the response | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Server API version. | -| epoch | [uint64](#uint64) | | Server local epoch number. | -| ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | -| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Response X-Headers. | -| origin | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta header of the origin response. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Peer's API version used | +| epoch | [uint64](#uint64) | | Peer's local epoch number | +| ttl | [uint32](#uint32) | | Maximum number of intermediate nodes in the request route | +| x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Response X-Headers | +| origin | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | `ResponseMetaHeader` of the origin request | @@ -191,36 +195,36 @@ Verification info for response signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by answering node. | -| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by any intermediate node | -| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | +| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by each intermediate node | +| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of previous hops | | origin | [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Chain of previous hops signatures | ### Message SessionToken -NeoFS session token. +NeoFS Session Token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) | | Session Token body | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature is a signature of session token information | +| body | [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) | | Session Token contains the proof of trust between peers to be attached in requests for further verification. Please see corresponding section of NeoFS Technical Specification for details. | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of `SessionToken` information | ### Message SessionToken.Body -Session token body +Session Token body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | OwnerID carries identifier of the session initiator. | -| lifetime | [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) | | Lifetime is a lifetime of the session | -| session_key | [bytes](#bytes) | | SessionKey is a public key of session key | -| object | [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) | | ObjectService session context. | +| id | [bytes](#bytes) | | Token identifier is a valid UUIDv4 in binary form | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the session initiator | +| lifetime | [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) | | Lifetime of the session | +| session_key | [bytes](#bytes) | | Public key used in session | +| object | [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) | | ObjectService session context | @@ -239,13 +243,13 @@ Lifetime parameters of the token. Filed names taken from rfc7519. ### Message XHeader -Extended headers for Request/Response +Extended headers for Request/Response. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Key of the X-Header. | -| value | [string](#string) | | Value of the X-Header. | +| key | [string](#string) | | Key of the X-Header | +| value | [string](#string) | | Value of the X-Header | diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index 46dafdc..beb0811 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -25,16 +25,18 @@ ### Message StorageGroup -StorageGroup groups the information about the NeoFS storage group. -The storage group consists of objects from single container. +StorageGroup keeps verification information for Data Audit sessions. Objects +that require payed storage guaranties are gathered in `StorageGroups` with +additional information used for proof of storage. `StorageGroup` only +contains objects from the same container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| validation_data_size | [uint64](#uint64) | | validation_data_size carries the total size of the payloads of the storage group members. | -| validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | validation_hash carries homomorphic hash from the concatenation of the payloads of the storage group members The order of concatenation is the same as the order of the members in the Members field. | -| expiration_epoch | [uint64](#uint64) | | expiration_epoch carries last NeoFS epoch number of the storage group lifetime. | -| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Members carries the list of identifiers of the object storage group members. The list is strictly ordered. | +| validation_data_size | [uint64](#uint64) | | Total size of the payloads of objects in the storage group | +| validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the `members` field. | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the storage group lifetime | +| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Strictly ordered list of storage group member objects | From 4f01f4b9026667e33d833685e8f46a12bffb9f36 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 16 Oct 2020 16:17:49 +0300 Subject: [PATCH 210/440] [#73] Add json field names to oblect struct Signed-off-by: Evgenii Stratonikov --- object/types.proto | 54 +++++++++++++++++++++++----------------------- refs/types.proto | 22 +++++++++---------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/object/types.proto b/object/types.proto index b3fe8b9..6b9792e 100644 --- a/object/types.proto +++ b/object/types.proto @@ -32,53 +32,53 @@ enum MatchType { message ShortHeader { // Object format version. Effectively the version of API library used to // create particular object - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Epoch when the object was created - uint64 creation_epoch = 2; + uint64 creation_epoch = 2 [json_name = "creationEpoch"]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3; + neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; // Type of the object payload content - ObjectType object_type = 4; + ObjectType object_type = 4 [json_name = "type"]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5; + uint64 payload_length = 5 [json_name = "payloadSize"]; } // Object Header message Header { // Object format version. Effectively the version of API library used to // create particular object - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Object's container - neo.fs.v2.refs.ContainerID container_id = 2; + neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "container"]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3; + neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; // Object creation Epoch - uint64 creation_epoch = 4; + uint64 creation_epoch = 4 [json_name = "creationEpoch"]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5; + uint64 payload_length = 5 [json_name = "payloadSize"]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6; + neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; // Type of the object payload content - ObjectType object_type = 7; + ObjectType object_type = 7 [json_name = "type"]; // Homomorphic hash of the object payload. - neo.fs.v2.refs.Checksum homomorphic_hash = 8; + neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homoHash"]; // Session token, if it was used during Object creation. Need it to verify // integrity and authenticity out of Request scope. - neo.fs.v2.session.SessionToken session_token = 9; + neo.fs.v2.session.SessionToken session_token = 9 [json_name = "token"]; // `Attribute` is a user-defined Key-Value metadata pair attached to the // object. @@ -93,12 +93,12 @@ message Header { // corresponding section in NeoFS Technical specification. message Attribute { // string key to the object attribute - string key = 1; + string key = 1 [json_name = "key"]; // string value of the object attribute - string value = 2; + string value = 2 [json_name = "value"]; } // User-defined object attributes - repeated Attribute attributes = 10; + repeated Attribute attributes = 10 [json_name = "attributes"]; // Bigger objects can be split into a chain of smaller objects. Information // about inter-dependencies between spawned objects and how to re-construct @@ -106,22 +106,22 @@ message Header { // must be within the same container. message Split { // Identifier of the origin object. Known only to the minor child. - neo.fs.v2.refs.ObjectID parent = 1; + neo.fs.v2.refs.ObjectID parent = 1 [json_name = "parent"]; // Identifier of the left split neighbor - neo.fs.v2.refs.ObjectID previous = 2; + neo.fs.v2.refs.ObjectID previous = 2[json_name = "previous"]; // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.refs.Signature parent_signature = 3; + neo.fs.v2.refs.Signature parent_signature = 3[json_name = "parentSignature"]; // `header` field of the parent object. Used to reconstruct parent. - Header parent_header = 4; + Header parent_header = 4 [json_name = "header"]; // List of identifiers of the objects generated by splitting current one. - repeated neo.fs.v2.refs.ObjectID children = 5; + repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; } // Position of the object in the split hierarchy - Split split = 11; + Split split = 11 [json_name = "Split"]; } // Object structure. Object is immutable and content-addressed. It means @@ -129,14 +129,14 @@ message Header { // hash of header field, which contains hash of object's payload. message Object { // Object's unique identifier. - neo.fs.v2.refs.ObjectID object_id = 1; + neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "id"]; // Signed object_id - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; // Object metadata headers - Header header = 3; + Header header = 3 [json_name = "header"]; // Payload bytes. - bytes payload = 4; + bytes payload = 4 [json_name = "payload"]; } diff --git a/refs/types.proto b/refs/types.proto index d8d15cc..37e3e80 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -9,9 +9,9 @@ option csharp_namespace = "NeoFS.API.v2.Refs"; // format there MUST be a '/' delimeter between them. message Address { // Container identifier - ContainerID container_id = 1; + ContainerID container_id = 1 [json_name = "container"]; // Object identifier - ObjectID object_id = 2; + ObjectID object_id = 2 [json_name = "object"]; } // NeoFS Object unique identifier. Objects are immutable and content-addressed. @@ -20,7 +20,7 @@ message Address { // payload. message ObjectID { // Object identifier in a binary format - bytes value = 1; + bytes value = 1 [json_name = "value"]; } // NeoFS container identifier. Container structures are immutable and @@ -28,7 +28,7 @@ message ObjectID { // stable-marshalled container message. message ContainerID { // Container identifier in a binary format. - bytes value = 1; + bytes value = 1 [json_name = "value"]; } // OwnerID is a derivative of a user's main public key. The transformation @@ -36,24 +36,24 @@ message ContainerID { // be directly used as `OwnerID`. message OwnerID { // Identifier of the container owner in a binary format - bytes value = 1; + bytes value = 1 [json_name = "value"]; } // API version used by a node. message Version { // Major API version - uint32 major = 1; + uint32 major = 1 [json_name = "major"]; // Minor API version - uint32 minor = 2; + uint32 minor = 2 [json_name = "minor"]; } // Signature of something in NeoFS. message Signature { // Public key used for signing - bytes key = 1; + bytes key = 1 [json_name = "key"]; // Signature - bytes sign = 2; + bytes sign = 2 [json_name = "signature"]; } // Checksum algorithm type. @@ -71,8 +71,8 @@ enum ChecksumType { // Checksum message. message Checksum { // Checksum algorithm type - ChecksumType type = 1; + ChecksumType type = 1 [json_name = "type"]; // Checksum itself - bytes sum = 2; + bytes sum = 2 [json_name = "sum"]; } From 44d7f7a6227b49f1c92367a0798ce4f1fb5a1d10 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 09:32:00 +0300 Subject: [PATCH 211/440] [#73] Add JSON field names to accounting package Signed-off-by: Stanislav Bogatyrev --- accounting/types.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounting/types.proto b/accounting/types.proto index e681cd1..cc4fbf6 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -14,9 +14,9 @@ option csharp_namespace = "NeoFS.API.v2.Accounting"; // description. message Decimal { // Number in smallest Token fractions. - int64 value = 1; + int64 value = 1 [json_name = "value"]; // Precision value indicating how many smallest fractions can be in one // integer. - uint32 precision = 2; + uint32 precision = 2 [json_name = "precision"]; } From 98dab3f354e19233fd815f1307f9f16c383176e0 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 10:52:02 +0300 Subject: [PATCH 212/440] [#73] Change JSON field names in acl package Changing naming style to meet Protobuf and Goggle JSON style guides. https://google.github.io/styleguide/jsoncstyleguide.xml https://developers.google.com/protocol-buffers/docs/proto3#json Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 2813931..ba81439 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -10,7 +10,7 @@ import "refs/types.proto"; // Target role of the access control rule in access control list. enum Role { // Unspecified role, default value - ROLE_UNSPECIFIED= 0; + ROLE_UNSPECIFIED = 0; // User target rule is applied if sender is the owner of the container USER = 1; @@ -91,40 +91,40 @@ enum HeaderType { // Describes a single eACL rule. message EACLRecord { // NeoFS request Verb to match - Operation operation = 1 [json_name = "Operation"]; + Operation operation = 1 [json_name = "operation"]; // Rule execution result. Either allows or denies access if filters match. - Action action = 2 [json_name = "Action"]; + Action action = 2 [json_name = "action"]; // Filter to check particular properties of the request or object. message Filter { // Define if Object or Request header will be used - HeaderType header_type = 1 [json_name = "HeaderType"]; + HeaderType header_type = 1 [json_name = "headerType"]; // Match operation type - MatchType match_type = 2 [json_name = "MatchType"]; + MatchType match_type = 2 [json_name = "matchType"]; // Name of the Header to use - string header_name = 3 [json_name="Name"]; + string header_name = 3 [json_name="headerName"]; // Expected Header Value or pattern to match - string header_val = 4 [json_name="Value"]; + string header_val = 4 [json_name="value"]; } // List of filters to match and see if rule is applicable - repeated Filter filters = 3 [json_name="Filters"]; + repeated Filter filters = 3 [json_name="filters"]; // Target to apply ACL rule. Can be a subject's role class or a list of public // keys to match. message Target { // Target subject's role class - Role role = 1 [json_name="Role"]; + Role role = 1 [json_name="role"]; // List of public keys to identify target subject - repeated bytes key_list = 2 [json_name="Keys"]; + repeated bytes keys = 2 [json_name="keys"]; } // List of target subjects to apply ACL rule to - repeated Target targets = 4 [json_name="Targets"]; + repeated Target targets = 4 [json_name="targets"]; } // Extended ACL rules table. Defined a list of ACL rules additionally to Basic @@ -137,10 +137,10 @@ message EACLTable { neo.fs.v2.refs.Version version = 1; // Identifier of the container that should use given access control rules - neo.fs.v2.refs.ContainerID container_id = 2 [json_name="ContainerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"]; // List of Extended ACL rules - repeated EACLRecord records = 3 [json_name="Records"]; + repeated EACLRecord records = 3 [json_name="records"]; } // BearerToken allows to attach signed Extended ACL rules to the request in @@ -155,30 +155,30 @@ message BearerToken { message Body { // Table of Extended ACL rules to use instead of the ones attached to the // container - EACLTable eacl_table = 1; + EACLTable eacl_table = 1 [json_name="eaclTable"]; // `OwnerID` to whom the token was issued. MUST match with the request // originator's `OwnerID` - neo.fs.v2.refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; // Lifetime parameters of the token. Filed names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). message TokenLifetime { // Expiration Epoch - uint64 exp = 1; + uint64 exp = 1 [json_name="exp"]; // Not valid before Epoch - uint64 nbf = 2; + uint64 nbf = 2 [json_name="nbf"]; // Issued at Epoch - uint64 iat = 3; + uint64 iat = 3 [json_name="iat"]; } // Token expiration and valid time period parameters - TokenLifetime lifetime = 3; + TokenLifetime lifetime = 3 [json_name="lifetime"]; } // Bearer Token body - Body body = 1; + Body body = 1 [json_name="body"]; // Signature of BearerToken body - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2 [json_name="signature"]; } From d0d74c3a2fb077d6e6c950c4e7933d54061dad19 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 11:04:18 +0300 Subject: [PATCH 213/440] [#73] Add JSON field names to container package Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/container/types.proto b/container/types.proto index 30eff1e..02ec6f1 100644 --- a/container/types.proto +++ b/container/types.proto @@ -15,17 +15,17 @@ import "refs/types.proto"; message Container { // Container format version. Effectively the version of API library used to // create container. - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Identifier of the container owner - neo.fs.v2.refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; // Nonce is a 16 byte UUID, used to avoid collisions of container id - bytes nonce = 3; + bytes nonce = 3 [json_name = "nonce"]; // `BasicACL` contains access control rules for owner, system, others groups // and permission bits for `BearerToken` and `Extended ACL` - uint32 basic_acl = 4; + uint32 basic_acl = 4 [json_name = "basicACL"]; // `Attribute` is a user-defined Key-Value metadata pair attached to the // container. Container attribute are immutable. They are set at container @@ -38,14 +38,14 @@ message Container { // only one subnet. message Attribute { // Attribute name key - string key = 1; + string key = 1 [json_name = "key"]; // Attribute value - string value = 2; + string value = 2 [json_name = "value"]; } // Attributes represent immutable container's meta data - repeated Attribute attributes = 5; + repeated Attribute attributes = 5 [json_name = "attributes"]; // Placement policy for the object inside the container - neo.fs.v2.netmap.PlacementPolicy placement_policy = 6; + neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 [json_name = "placementPolicy"]; } From 6ea8bc3214666ff994dd7ef5f9377b88223c6a88 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 11:24:58 +0300 Subject: [PATCH 214/440] [#73] Add JSON field names to netmap package Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index ccfe546..d15342b 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -56,39 +56,39 @@ message Filter { // application to the whole unfiltered NetworkMap. At top level it's used as a // filter name. At lower levels it's considered to be a reference to another // named filter - string name = 1; + string name = 1 [json_name = "name"]; // Key to filter - string key = 2; + string key = 2 [json_name = "key"]; // Filtering operation - Operation op = 3; + Operation op = 3 [json_name = "op"]; // Value to match - string value = 4; + string value = 4 [json_name = "value"]; // List of inner filters. Top level operation will be applied to the whole // list. - repeated Filter filters = 5; + repeated Filter filters = 5 [json_name = "filters"]; } // Selector chooses a number of nodes from the bucket taking the nearest nodes // to the provided `ContainerID` by hash distance. message Selector { // Selector name to reference in object placement section - string name = 1; + string name = 1 [json_name = "name"]; // How many nodes to select from the bucket - uint32 count = 2; + uint32 count = 2 [json_name = "count"]; // Selector modifier showing how to form a bucket - Clause clause = 3; + Clause clause = 3 [json_name = "clause"]; // Attribute bucket to select from - string attribute = 4; + string attribute = 4 [json_name = "attribute"]; // Filter reference to select from - string filter = 5; + string filter = 5 [json_name = "filter"]; } // Number of object replicas in a set of nodes from the defined selector. If no @@ -96,10 +96,10 @@ message Selector { // default. message Replica { // How many object replicas to put - uint32 count = 1; + uint32 count = 1 [json_name = "count"]; // Named selector bucket to put replicas - string selector = 2; + string selector = 2 [json_name = "selector"]; } // Set of rules to select a subset of nodes from `NetworkMap` able to store @@ -108,26 +108,26 @@ message Replica { message PlacementPolicy { // Rules to set number of object replicas and place each one into a named // bucket - repeated Replica replicas = 1; + repeated Replica replicas = 1 [json_name = "replicas"]; // Container backup factor controls how deep NeoFS will search for nodes // alternatives to include into container's nodes subset - uint32 container_backup_factor = 2; + uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"]; // Set of Selectors to form the container's nodes subset - repeated Selector selectors = 3; + repeated Selector selectors = 3 [json_name = "selectors"]; // List of named filters to reference in selectors - repeated Filter filters = 4; + repeated Filter filters = 4 [json_name = "filters"]; } // NeoFS node description message NodeInfo { // Public key of the NeoFS node in a binary format. - bytes public_key = 1; + bytes public_key = 1 [json_name = "publicKey"]; // Ways to connect to a node - string address = 2; + string address = 2 [json_name = "address"]; // Administrator-defined Attributes of the NeoFS Storage Node. // @@ -167,17 +167,17 @@ message NodeInfo { // corresponding section in NeoFS Technical specification. message Attribute { // Key of the node attribute. - string key = 1; + string key = 1 [json_name = "key"]; // Value of the node attribute. - string value = 2; + string value = 2 [json_name = "value"]; // Parent keys, if any. For example for `City` it could be `Region` and // `Country`. - repeated string parents = 3; + repeated string parents = 3 [json_name = "parents"]; } // Carries list of the NeoFS node attributes in a string key-value format. - repeated Attribute attributes = 3; + repeated Attribute attributes = 3 [json_name = "attributes"]; // Represents the enumeration of various states of the NeoFS node. enum State { @@ -192,5 +192,5 @@ message NodeInfo { } // Carries state of the NeoFS node. - State state = 4; + State state = 4 [json_name = "state"]; } From a1d9527f34e99f9b81e56fc9cb2121163af0e252 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 11:27:05 +0300 Subject: [PATCH 215/440] [#73] Add JSON field names to object package Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 4 ++-- object/types.proto | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/object/service.proto b/object/service.proto index 4ce47ed..7242949 100644 --- a/object/service.proto +++ b/object/service.proto @@ -254,10 +254,10 @@ message HeadRequest { // 3. Check if `ObjectID` signature in `signature` field is correct message HeaderWithSignature { // Full object header - Header header = 1; + Header header = 1 [json_name = "header"]; // Signed `ObjectID` to verify full header's authenticity - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; } // Object HEAD response diff --git a/object/types.proto b/object/types.proto index 6b9792e..6f0be21 100644 --- a/object/types.proto +++ b/object/types.proto @@ -24,6 +24,7 @@ enum ObjectType { enum MatchType { // Unknown. Not used MATCH_TYPE_UNSPECIFIED = 0; + // Full string match STRING_EQUAL = 1; } @@ -38,14 +39,14 @@ message ShortHeader { uint64 creation_epoch = 2 [json_name = "creationEpoch"]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; // Type of the object payload content - ObjectType object_type = 4 [json_name = "type"]; + ObjectType object_type = 4 [json_name = "objectType"]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5 [json_name = "payloadSize"]; + uint64 payload_length = 5 [json_name = "payloadLength"]; } // Object Header @@ -55,30 +56,30 @@ message Header { neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Object's container - neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "container"]; + neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "containerID"]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; // Object creation Epoch uint64 creation_epoch = 4 [json_name = "creationEpoch"]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5 [json_name = "payloadSize"]; + uint64 payload_length = 5 [json_name = "payloadLength"]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; // Type of the object payload content - ObjectType object_type = 7 [json_name = "type"]; + ObjectType object_type = 7 [json_name = "objectType"]; // Homomorphic hash of the object payload. - neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homoHash"]; + neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"]; // Session token, if it was used during Object creation. Need it to verify // integrity and authenticity out of Request scope. - neo.fs.v2.session.SessionToken session_token = 9 [json_name = "token"]; + neo.fs.v2.session.SessionToken session_token = 9 [json_name = "sessionToken"]; // `Attribute` is a user-defined Key-Value metadata pair attached to the // object. @@ -109,19 +110,19 @@ message Header { neo.fs.v2.refs.ObjectID parent = 1 [json_name = "parent"]; // Identifier of the left split neighbor - neo.fs.v2.refs.ObjectID previous = 2[json_name = "previous"]; + neo.fs.v2.refs.ObjectID previous = 2 [json_name = "previous"]; // `signature` field of the parent object. Used to reconstruct parent. neo.fs.v2.refs.Signature parent_signature = 3[json_name = "parentSignature"]; // `header` field of the parent object. Used to reconstruct parent. - Header parent_header = 4 [json_name = "header"]; + Header parent_header = 4 [json_name = "parentHeader"]; // List of identifiers of the objects generated by splitting current one. repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; } // Position of the object in the split hierarchy - Split split = 11 [json_name = "Split"]; + Split split = 11 [json_name = "split"]; } // Object structure. Object is immutable and content-addressed. It means @@ -129,7 +130,7 @@ message Header { // hash of header field, which contains hash of object's payload. message Object { // Object's unique identifier. - neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "id"]; + neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"]; // Signed object_id neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; From f7bd46baf804ae11696ae119a6763c3bb8293494 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 12:30:51 +0300 Subject: [PATCH 216/440] [#73] Add JSON field names to refs package Signed-off-by: Stanislav Bogatyrev --- refs/types.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/refs/types.proto b/refs/types.proto index 37e3e80..f56819e 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -9,9 +9,9 @@ option csharp_namespace = "NeoFS.API.v2.Refs"; // format there MUST be a '/' delimeter between them. message Address { // Container identifier - ContainerID container_id = 1 [json_name = "container"]; + ContainerID container_id = 1 [json_name = "containerID"]; // Object identifier - ObjectID object_id = 2 [json_name = "object"]; + ObjectID object_id = 2 [json_name = "objectID"]; } // NeoFS Object unique identifier. Objects are immutable and content-addressed. From b48723bd8cd476140b514f865bded9d778eaca38 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 12:42:24 +0300 Subject: [PATCH 217/440] [#73] Add JSON field names to session package Signed-off-by: Stanislav Bogatyrev --- session/types.proto | 68 ++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/session/types.proto b/session/types.proto index ed5442f..3def1bf 100644 --- a/session/types.proto +++ b/session/types.proto @@ -37,10 +37,10 @@ message ObjectSessionContext { RANGEHASH = 7; } // Type of request for which the token is issued - Verb verb = 1; + Verb verb = 1 [json_name = "verb"]; // Related Object address - neo.fs.v2.refs.Address address = 2; + neo.fs.v2.refs.Address address = 2 [json_name = "address"]; } // NeoFS Session Token. @@ -48,117 +48,117 @@ message SessionToken { // Session Token body message Body { // Token identifier is a valid UUIDv4 in binary form - bytes id = 1; + bytes id = 1 [json_name = "id"]; // Identifier of the session initiator - neo.fs.v2.refs.OwnerID owner_id = 2; + neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; // Lifetime parameters of the token. Filed names taken from rfc7519. message TokenLifetime { // Expiration Epoch - uint64 exp = 1; + uint64 exp = 1 [json_name = "exp"]; // Not valid before Epoch - uint64 nbf = 2; + uint64 nbf = 2 [json_name = "nbf"]; // Issued at Epoch - uint64 iat = 3; + uint64 iat = 3 [json_name = "iat"]; } // Lifetime of the session - TokenLifetime lifetime = 3; + TokenLifetime lifetime = 3 [json_name = "lifetime"]; // Public key used in session - bytes session_key = 4; + bytes session_key = 4 [json_name = "sessionKey"]; // Session Context information oneof context { // ObjectService session context - ObjectSessionContext object = 5; + ObjectSessionContext object = 5 [json_name = "object"]; } } // Session Token contains the proof of trust between peers to be attached in // requests for further verification. Please see corresponding section of // NeoFS Technical Specification for details. - Body body = 1; + Body body = 1 [json_name = "body"]; // Signature of `SessionToken` information - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; } // Extended headers for Request/Response. message XHeader { // Key of the X-Header - string key = 1; + string key = 1 [json_name = "key"]; // Value of the X-Header - string value = 2; + string value = 2 [json_name = "value"]; } // Meta information attached to the request. When forwarded between peers, // request meta headers are folded in matryoshka style. message RequestMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Peer's local epoch number. Set to 0 if unknown. - uint64 epoch = 2; + uint64 epoch = 2 [json_name = "epoch"]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3; + uint32 ttl = 3 [json_name = "ttl"]; // Request X-Headers - repeated XHeader x_headers = 4; + repeated XHeader x_headers = 4 [json_name = "xHeaders"]; // Session token within which the request is sent - SessionToken session_token = 5; + SessionToken session_token = 5 [json_name = "sessionToken"]; // `BearerToken` with eACL overrides for the request - neo.fs.v2.acl.BearerToken bearer_token = 6; + neo.fs.v2.acl.BearerToken bearer_token = 6 [json_name = "bearerToken"]; // `RequestMetaHeader` of the origin request - RequestMetaHeader origin = 7; + RequestMetaHeader origin = 7 [json_name = "origin"]; } // Information about the response message ResponseMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Peer's local epoch number - uint64 epoch = 2; + uint64 epoch = 2 [json_name = "epoch"]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3; + uint32 ttl = 3 [json_name = "ttl"]; // Response X-Headers - repeated XHeader x_headers = 4; + repeated XHeader x_headers = 4 [json_name = "xHeaders"]; // `ResponseMetaHeader` of the origin request - ResponseMetaHeader origin = 5; + ResponseMetaHeader origin = 5 [json_name = "origin"]; } // Verification info for request signed by all intermediate nodes. message RequestVerificationHeader { // Request Body signature. Should be generated once by request initiator. - neo.fs.v2.refs.Signature body_signature = 1; + neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; // Request Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2; + neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3; + neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; // Chain of previous hops signatures - RequestVerificationHeader origin = 4; + RequestVerificationHeader origin = 4 [json_name = "origin"]; } // Verification info for response signed by all intermediate nodes message ResponseVerificationHeader { // Response Body signature. Should be generated once by answering node. - neo.fs.v2.refs.Signature body_signature = 1; + neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; // Response Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2; + neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3; + neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; // Chain of previous hops signatures - ResponseVerificationHeader origin = 4; + ResponseVerificationHeader origin = 4 [json_name = "origin"]; } From eed8754aaa315f35a9a336ccf09bc7c28ef8eea4 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 13:07:58 +0300 Subject: [PATCH 218/440] [#73] Add JSON field names to storagegroup package Signed-off-by: Stanislav Bogatyrev --- storagegroup/types.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 66e23e5..0400f64 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -13,16 +13,16 @@ import "refs/types.proto"; // contains objects from the same container. message StorageGroup { // Total size of the payloads of objects in the storage group - uint64 validation_data_size = 1; + uint64 validation_data_size = 1 [json_name = "validationDataSize"]; // Homomorphic hash from the concatenation of the payloads of the storage // group members. The order of concatenation is the same as the order of the // members in the `members` field. - neo.fs.v2.refs.Checksum validation_hash = 2; + neo.fs.v2.refs.Checksum validation_hash = 2 [json_name = "validationHash"]; // Last NeoFS epoch number of the storage group lifetime - uint64 expiration_epoch = 3; + uint64 expiration_epoch = 3 [json_name = "expirationEpoch"]; // Strictly ordered list of storage group member objects - repeated neo.fs.v2.refs.ObjectID members = 4; + repeated neo.fs.v2.refs.ObjectID members = 4 [json_name = "members"]; } From 6123bbd0e18d1e4f6e159aaa90c7e83edbc783b0 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 17:14:32 +0300 Subject: [PATCH 219/440] [#73] Update auto-generated docs Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 39653fa..a90ec7e 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -111,7 +111,7 @@ keys to match. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | role | [Role](#neo.fs.v2.acl.Role) | | Target subject's role class | -| key_list | [bytes](#bytes) | repeated | List of public keys to identify target subject | +| keys | [bytes](#bytes) | repeated | List of public keys to identify target subject | From 0dd5b92edc004cff2811e83d5bbd3e493ee95309 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 19 Oct 2020 17:16:23 +0300 Subject: [PATCH 220/440] Release v2.0.1 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 094edf4..23af83b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.0.1] - 2020-10-19 + +Documentation updates and JSON field names definition + +### Added +- Added "well-known" attributes list for `netmap.NodeInfo` +- Added "well-known" attributes list for objects +- Added "well-known" attributes list for containers +- JSON field names defined for most of data structures + +### Changed +- Documentation updated for all packages fixing typos and minor inaccuracies +- `acl.EACLRecord.Target.key_list` field renamed to `keys` for consistency + +### Removed +- Human-written documentation will now be only in [NeoFS + Specification](https://github.com/nspcc-dev/neofs-spec) + ## [2.0.0] - 2020-09-07 - Jindo (진도, 珍島) Major API refactoring and simplification. @@ -164,3 +182,4 @@ Bump major release [1.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.0.0...v1.1.0 [1.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.1.0...v1.2.0 [2.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.2.0...v2.0.0 +[2.0.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.0...v2.0.1 From bcc6f68eda3cfda7e2e512eaef898127114f4ce4 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 20 Oct 2020 22:44:00 +0300 Subject: [PATCH 221/440] [#75] Add clarification for BearerToken.body.owner_id Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index ba81439..6af62db 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -149,6 +149,9 @@ message EACLTable { // like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be // used in the similar use cases, like providing authorisation to externally // authenticated party. +// +// BearerToken can be issued only by container's owner and must be signed using +// the key associated with container's `OwnerID`. message BearerToken { // Bearer Token body structure contains Extended ACL table issued by container // owner with additional information preventing token's abuse. @@ -157,8 +160,8 @@ message BearerToken { // container EACLTable eacl_table = 1 [json_name="eaclTable"]; - // `OwnerID` to whom the token was issued. MUST match with the request - // originator's `OwnerID` + // `OwnerID` to whom the token was issued. Must match the request + // originator's `OwnerID`. If empty, any token bearer will be accepted. neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; // Lifetime parameters of the token. Filed names taken from From 31e1801c4af10e7efe28e8cbf3aa98ad1f06277c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 20 Oct 2020 23:09:51 +0300 Subject: [PATCH 222/440] Add more well-known attributes Resolves nspcc-dev/neofs-api-go#172 Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 9 ++++++++- object/types.proto | 15 +++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/container/types.proto b/container/types.proto index 02ec6f1..2de3713 100644 --- a/container/types.proto +++ b/container/types.proto @@ -33,9 +33,16 @@ message Container { // // There are some "well-known" attributes affecting system behaviour: // - // * Subnet \ + // * __NEOFS__SUBNET \ // String ID of container's storage subnet. Container can be attached to // only one subnet. + // + // And some well-known attributes used by applications only: + // + // * Name \ + // Human-friendly name + // * Timestamp \ + // User-defined local time of container creation in Unix Timestamp format message Attribute { // Attribute name key string key = 1 [json_name = "key"]; diff --git a/object/types.proto b/object/types.proto index 6f0be21..d0ed2fd 100644 --- a/object/types.proto +++ b/object/types.proto @@ -87,8 +87,19 @@ message Header { // There are some "well-known" attributes starting with `__NEOFS__` prefix // that affect system behaviour: // - // * __NEOFS__UPLOAD_ID - // * __NEOFS__EXPIRATION_EPOCH + // * __NEOFS__UPLOAD_ID \ + // Marks smaller parts of a split bigger object + // * __NEOFS__EXPIRATION_EPOCH \ + // Tells GC to delete object after that epoch + // + // And some well-known attributes used by applications only: + // + // * Name \ + // Human-friendly name + // * FileName \ + // File name to be associated with the object on saving + // * Timestamp \ + // User-defined local time of object creation in Unix Timestamp format // // For detailed description of each well-known attribute please see the // corresponding section in NeoFS Technical specification. From 8056035132c2a2300ceffff422108c03b9ed548d Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 21 Oct 2020 19:41:24 +0300 Subject: [PATCH 223/440] Clarify object search filter header name usage Related: nspcc-dev/neofs-spec#12 Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 23 +++++++++++++++++++++++ object/service.proto | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 3 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index 6af62db..d0f756b 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -97,6 +97,29 @@ message EACLRecord { Action action = 2 [json_name = "action"]; // Filter to check particular properties of the request or object. + // + // By default `header_name` field refers to the corresponding object's + // `Attribute`. Some Object's header fields can also be accessed by adding + // `$Object:` prefix to the name. Here is the list of fields available via + // this prefix: + // + // * $Object:version \ + // version + // * $Object:containerID \ + // container_id + // * $Object:ownerID \ + // owner_id + // * $Object:creationEpoch \ + // creation_epoch + // * $Object:payloadLength \ + // payload_length + // * $Object:payloadHash \ + // payload_hash + // * $Object:objectType \ + // object_type + // * $Object:homomorphicHash \ + // homomorphic_hash + // message Filter { // Define if Object or Request header will be used HeaderType header_type = 1 [json_name = "headerType"]; diff --git a/object/service.proto b/object/service.proto index 7242949..34c024e 100644 --- a/object/service.proto +++ b/object/service.proto @@ -295,15 +295,52 @@ message SearchRequest { // Version of the Query Language used uint32 version = 2; - // Filter structure + // Filter structure checks if object header field or attribute content + // matches a value. + // + // By default `name` field refers to the corresponding object's `Attribute`. + // Some Object's header fields can also be accessed by adding `$Object:` + // prefix to the name. Here is the list of fields available via this prefix: + // + // * $Object:version \ + // version + // * $Object:containerID \ + // container_id + // * $Object:ownerID \ + // owner_id + // * $Object:creationEpoch \ + // creation_epoch + // * $Object:payloadLength \ + // payload_length + // * $Object:payloadHash \ + // payload_hash + // * $Object:objectType \ + // object_type + // * $Object:homomorphicHash \ + // homomorphic_hash + // + // There are some well-known filter aliases to match objects by certain + // properties: + // + // * $Object:ROOT \ + // With the `value` set to `true` checks if an object is a top object in a + // split hierarchy. With other values returns non-root objects. + // * $Object:LEAF \ + // With the `value` set to `true` checks if an object is a leaf in a split + // hierarchy. With other values returns non-leaf objects. + // * $Object:PARENT \ + // With the `value` set to `true` checks if an object has any child + // objects is `Split` header or there are objects known to reference this + // object as a parent. If set to `false` returns object without child + // objects in `Split` header or any objects known to reference them. message Filter { // Match type to use MatchType match_type = 1; - // Header name to match + // Attribute or Header fields to match string name = 2; - // Header value to match + // Value to match string value = 3; } // List of search expressions From f1acb8c14fc1cfdd2183406b17a7b19b2409a978 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 21 Oct 2020 19:46:26 +0300 Subject: [PATCH 224/440] Typo fix Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object/types.proto b/object/types.proto index d0ed2fd..8b24389 100644 --- a/object/types.proto +++ b/object/types.proto @@ -124,7 +124,7 @@ message Header { neo.fs.v2.refs.ObjectID previous = 2 [json_name = "previous"]; // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.refs.Signature parent_signature = 3[json_name = "parentSignature"]; + neo.fs.v2.refs.Signature parent_signature = 3 [json_name = "parentSignature"]; // `header` field of the parent object. Used to reconstruct parent. Header parent_header = 4 [json_name = "parentHeader"]; From b063e5b91026a978da339c1b0c08d3e9e7bfd8c7 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 23 Oct 2020 15:38:31 +0300 Subject: [PATCH 225/440] Rename object search and ACL filters fields for consistency Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 11 +++++------ object/service.proto | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index d0f756b..c767b19 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -98,10 +98,9 @@ message EACLRecord { // Filter to check particular properties of the request or object. // - // By default `header_name` field refers to the corresponding object's - // `Attribute`. Some Object's header fields can also be accessed by adding - // `$Object:` prefix to the name. Here is the list of fields available via - // this prefix: + // By default `key` field refers to the corresponding object's `Attribute`. + // Some Object's header fields can also be accessed by adding `$Object:` + // prefix to the name. Here is the list of fields available via this prefix: // // * $Object:version \ // version @@ -128,10 +127,10 @@ message EACLRecord { MatchType match_type = 2 [json_name = "matchType"]; // Name of the Header to use - string header_name = 3 [json_name="headerName"]; + string key = 3 [json_name="key"]; // Expected Header Value or pattern to match - string header_val = 4 [json_name="value"]; + string value = 4 [json_name="value"]; } // List of filters to match and see if rule is applicable diff --git a/object/service.proto b/object/service.proto index 34c024e..4cf2aa2 100644 --- a/object/service.proto +++ b/object/service.proto @@ -298,7 +298,7 @@ message SearchRequest { // Filter structure checks if object header field or attribute content // matches a value. // - // By default `name` field refers to the corresponding object's `Attribute`. + // By default `key` field refers to the corresponding object's `Attribute`. // Some Object's header fields can also be accessed by adding `$Object:` // prefix to the name. Here is the list of fields available via this prefix: // @@ -338,7 +338,7 @@ message SearchRequest { MatchType match_type = 1; // Attribute or Header fields to match - string name = 2; + string key = 2; // Value to match string value = 3; From 63215a6302918b7a76d92d66c79264d16fb60f21 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 23 Oct 2020 15:40:32 +0300 Subject: [PATCH 226/440] Update auto-generated docs Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 30 ++++++++++++++++++--- proto-docs/container.md | 9 ++++++- proto-docs/object.md | 58 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 88 insertions(+), 9 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index a90ec7e..da4f946 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -38,6 +38,9 @@ like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be used in the similar use cases, like providing authorisation to externally authenticated party. +BearerToken can be issued only by container's owner and must be signed using +the key associated with container's `OwnerID`. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -55,7 +58,7 @@ owner with additional information preventing token's abuse. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` to whom the token was issued. MUST match with the request originator's `OwnerID` | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` to whom the token was issued. Must match the request originator's `OwnerID`. If empty, any token bearer will be accepted. | | lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | @@ -92,13 +95,34 @@ Describes a single eACL rule. ### Message EACLRecord.Filter Filter to check particular properties of the request or object. +By default `key` field refers to the corresponding object's `Attribute`. +Some Object's header fields can also be accessed by adding `$Object:` +prefix to the name. Here is the list of fields available via this prefix: + +* $Object:version \ + version +* $Object:containerID \ + container_id +* $Object:ownerID \ + owner_id +* $Object:creationEpoch \ + creation_epoch +* $Object:payloadLength \ + payload_length +* $Object:payloadHash \ + payload_hash +* $Object:objectType \ + object_type +* $Object:homomorphicHash \ + homomorphic_hash + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | header_type | [HeaderType](#neo.fs.v2.acl.HeaderType) | | Define if Object or Request header will be used | | match_type | [MatchType](#neo.fs.v2.acl.MatchType) | | Match operation type | -| header_name | [string](#string) | | Name of the Header to use | -| header_val | [string](#string) | | Expected Header Value or pattern to match | +| key | [string](#string) | | Name of the Header to use | +| value | [string](#string) | | Expected Header Value or pattern to match | diff --git a/proto-docs/container.md b/proto-docs/container.md index 28982fb..25ac837 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -468,10 +468,17 @@ creation and cna never be added or updated. There are some "well-known" attributes affecting system behaviour: -* Subnet \ +* __NEOFS__SUBNET \ String ID of container's storage subnet. Container can be attached to only one subnet. +And some well-known attributes used by applications only: + +* Name \ + Human-friendly name +* Timestamp \ + User-defined local time of container creation in Unix Timestamp format + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | diff --git a/proto-docs/object.md b/proto-docs/object.md index 12d923a..d420338 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -542,14 +542,51 @@ Object Search request body ### Message SearchRequest.Body.Filter -Filter structure +Filter structure checks if object header field or attribute content +matches a value. + +By default `key` field refers to the corresponding object's `Attribute`. +Some Object's header fields can also be accessed by adding `$Object:` +prefix to the name. Here is the list of fields available via this prefix: + +* $Object:version \ + version +* $Object:containerID \ + container_id +* $Object:ownerID \ + owner_id +* $Object:creationEpoch \ + creation_epoch +* $Object:payloadLength \ + payload_length +* $Object:payloadHash \ + payload_hash +* $Object:objectType \ + object_type +* $Object:homomorphicHash \ + homomorphic_hash + +There are some well-known filter aliases to match objects by certain +properties: + +* $Object:ROOT \ + With the `value` set to `true` checks if an object is a top object in a + split hierarchy. With other values returns non-root objects. +* $Object:LEAF \ + With the `value` set to `true` checks if an object is a leaf in a split + hierarchy. With other values returns non-leaf objects. +* $Object:PARENT \ + With the `value` set to `true` checks if an object has any child + objects is `Split` header or there are objects known to reference this + object as a parent. If set to `false` returns object without child + objects in `Split` header or any objects known to reference them. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | match_type | [MatchType](#neo.fs.v2.object.MatchType) | | Match type to use | -| name | [string](#string) | | Header name to match | -| value | [string](#string) | | Header value to match | +| key | [string](#string) | | Attribute or Header fields to match | +| value | [string](#string) | | Value to match | @@ -620,8 +657,19 @@ object. There are some "well-known" attributes starting with `__NEOFS__` prefix that affect system behaviour: -* __NEOFS__UPLOAD_ID -* __NEOFS__EXPIRATION_EPOCH +* __NEOFS__UPLOAD_ID \ + Marks smaller parts of a split bigger object +* __NEOFS__EXPIRATION_EPOCH \ + Tells GC to delete object after that epoch + +And some well-known attributes used by applications only: + +* Name \ + Human-friendly name +* FileName \ + File name to be associated with the object on saving +* Timestamp \ + User-defined local time of object creation in Unix Timestamp format For detailed description of each well-known attribute please see the corresponding section in NeoFS Technical specification. From 5916eb1170187103c8bf86847be4aa2c48052a4e Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 23 Oct 2020 17:50:04 +0300 Subject: [PATCH 227/440] [#80] Clarify well-known object filters `parent` and `childfree` Signed-off-by: Alex Vanin --- object/service.proto | 11 ++++++----- proto-docs/object.md | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/object/service.proto b/object/service.proto index 4cf2aa2..cf550fe 100644 --- a/object/service.proto +++ b/object/service.proto @@ -318,6 +318,8 @@ message SearchRequest { // object_type // * $Object:homomorphicHash \ // homomorphic_hash + // * $Object:split.parent \ + // object_id of parent // // There are some well-known filter aliases to match objects by certain // properties: @@ -328,11 +330,10 @@ message SearchRequest { // * $Object:LEAF \ // With the `value` set to `true` checks if an object is a leaf in a split // hierarchy. With other values returns non-leaf objects. - // * $Object:PARENT \ - // With the `value` set to `true` checks if an object has any child - // objects is `Split` header or there are objects known to reference this - // object as a parent. If set to `false` returns object without child - // objects in `Split` header or any objects known to reference them. + // * $Object:CHILDFREE \ + // With the `value` set to `true` checks if an object has empty + // children list in `Split` header. With other values returns + // non-childfree objects. message Filter { // Match type to use MatchType match_type = 1; diff --git a/proto-docs/object.md b/proto-docs/object.md index d420338..4072fa4 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -565,6 +565,8 @@ prefix to the name. Here is the list of fields available via this prefix: object_type * $Object:homomorphicHash \ homomorphic_hash +* $Object:split.parent \ + object_id of parent There are some well-known filter aliases to match objects by certain properties: @@ -575,11 +577,10 @@ properties: * $Object:LEAF \ With the `value` set to `true` checks if an object is a leaf in a split hierarchy. With other values returns non-leaf objects. -* $Object:PARENT \ - With the `value` set to `true` checks if an object has any child - objects is `Split` header or there are objects known to reference this - object as a parent. If set to `false` returns object without child - objects in `Split` header or any objects known to reference them. +* $Object:CHILDFREE \ + With the `value` set to `true` checks if an object has empty + children list in `Split` header. With other values returns + non-childfree objects. | Field | Type | Label | Description | From 35baf1ebfb4d804256e2833cb292131fabf14040 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 27 Oct 2020 10:44:06 +0300 Subject: [PATCH 228/440] Release v2.0.2 Signed-off-by: Alex Vanin --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23af83b..22fddf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [2.0.2] - 2020-10-27 + +More "well-known" application attributes and documentation updates. + +### Added +- Added "well-known" attributes list for extended ACL and object search filters +- Added `Name`, `Timestamp` "well-known" application attributes for container +- Added `Name`, `FileName`, `Timestamp` "well-known" application attributes for object + +### Changed +- `BearerToken.owner_id` field description changed +- `Subnet` container attribute now has `__NEOFS__` prefix +- Search and ACL filters now have `key` and `value` fields + ## [2.0.1] - 2020-10-19 Documentation updates and JSON field names definition @@ -183,3 +197,4 @@ Bump major release [1.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.1.0...v1.2.0 [2.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.2.0...v2.0.0 [2.0.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.0...v2.0.1 +[2.0.2]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.1...v2.0.2 From 9a319905bea6a5de29fea1216be3ff4cc21f368a Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 9 Nov 2020 16:56:58 +0300 Subject: [PATCH 229/440] [#87] Add object ID key in extended ACL filters Extended ACL description lacks `objectID` key in filters. It's useful to control access to specific object. Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 2 ++ object/service.proto | 2 ++ 2 files changed, 4 insertions(+) diff --git a/acl/types.proto b/acl/types.proto index c767b19..ea866f8 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -104,6 +104,8 @@ message EACLRecord { // // * $Object:version \ // version + // * $Object:objectID \ + // object_id // * $Object:containerID \ // container_id // * $Object:ownerID \ diff --git a/object/service.proto b/object/service.proto index cf550fe..14eabba 100644 --- a/object/service.proto +++ b/object/service.proto @@ -304,6 +304,8 @@ message SearchRequest { // // * $Object:version \ // version + // * $Object:objectID \ + // object_id // * $Object:containerID \ // container_id // * $Object:ownerID \ From 261367055323a2a40a6b4bc225e1c1d1b7331e02 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 9 Nov 2020 13:03:49 +0300 Subject: [PATCH 230/440] [nspcc-dev/neofs-node#151] Clarify $Object:ROOT filter description * It's expected by app developers that ROOT filter will return the list of objects created by user, without supplementary objects like split object parts, tombstones and storage groups. * Rename LEAF to PHY as it's purpose it to return physically existing objects. Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/object/service.proto b/object/service.proto index 14eabba..c4f6931 100644 --- a/object/service.proto +++ b/object/service.proto @@ -327,11 +327,17 @@ message SearchRequest { // properties: // // * $Object:ROOT \ - // With the `value` set to `true` checks if an object is a top object in a - // split hierarchy. With other values returns non-root objects. - // * $Object:LEAF \ - // With the `value` set to `true` checks if an object is a leaf in a split - // hierarchy. With other values returns non-leaf objects. + // Returns only `REGULAR` type objects that are not split or are the top + // level root objects in a split hierarchy. This includes objects not + // present physically, like large objects split into smaller objects + // without separate top-level root object. Other type objects like + // StorageGroups and Tombstones will not be shown. This filter may be + // useful for listing objects like `ls` command of some virtual file + // system. This filter is activated if the `key` exists, disregarding the + // value and matcher type. + // * $Object:PHY \ + // Returns only objects physically stored in the system. This filter is + // activated if the `key` exists, disregarding the value and matcher type. // * $Object:CHILDFREE \ // With the `value` set to `true` checks if an object has empty // children list in `Split` header. With other values returns From 3cdde6492b51733162ba060dd896bbc4b377fee8 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 9 Nov 2020 23:29:52 +0300 Subject: [PATCH 231/440] Mention object split limitation by type Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/object/types.proto b/object/types.proto index 8b24389..cdfe6d2 100644 --- a/object/types.proto +++ b/object/types.proto @@ -8,7 +8,9 @@ option csharp_namespace = "NeoFS.API.v2.Object"; import "refs/types.proto"; import "session/types.proto"; -// Type of the object payload content. +// Type of the object payload content. Only `REGULAR` type objects can be split, +// hence `TOMBSTONE` and `STORAGEGROUP` payload is limited by maximal object +// size. enum ObjectType { // Just a normal object REGULAR = 0; From 55c04e485ec5f614ef5c2307ae6bd91a8d013d14 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 17 Nov 2020 09:37:12 +0300 Subject: [PATCH 232/440] Add `header.split.split_id` header to object In some cases like nspcc-dev/neofs-node#167 there is no simple way to identify where does the object part belongs to. Adding `split_id` as the required field will simplify split object processing. Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/object/types.proto b/object/types.proto index cdfe6d2..3fea559 100644 --- a/object/types.proto +++ b/object/types.proto @@ -133,6 +133,12 @@ message Header { // List of identifiers of the objects generated by splitting current one. repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; + + // 16 byte UUID used to identify the split object hierarchy parts. Must be + // unique inside container. All objects participaiting in the split must + // have the same `split_id` value. + bytes split_id = 6 [json_name = "splitID"]; + } // Position of the object in the split hierarchy Split split = 11 [json_name = "split"]; From f4215add9e61eb39a1417affa379bff66f7f34f2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 24 Nov 2020 11:01:58 +0300 Subject: [PATCH 233/440] [#94] acl: Add json_name notation to EACLTable.Version field Signed-off-by: Leonard Lyubich --- acl/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acl/types.proto b/acl/types.proto index ea866f8..ca57598 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -158,7 +158,7 @@ message EACLRecord { message EACLTable { // eACL format version. Effectively the version of API library used to create // eACL Table. - neo.fs.v2.refs.Version version = 1; + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Identifier of the container that should use given access control rules neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"]; From 71469da6028053f055130c4dc9e4f5296dc8890c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 25 Nov 2020 13:16:52 +0300 Subject: [PATCH 234/440] Typo fixes Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 2 +- object/types.proto | 2 +- session/types.proto | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index ca57598..e531e5f 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -188,7 +188,7 @@ message BearerToken { // originator's `OwnerID`. If empty, any token bearer will be accepted. neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; - // Lifetime parameters of the token. Filed names taken from + // Lifetime parameters of the token. Field names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). message TokenLifetime { // Expiration Epoch diff --git a/object/types.proto b/object/types.proto index 3fea559..f8119ca 100644 --- a/object/types.proto +++ b/object/types.proto @@ -135,7 +135,7 @@ message Header { repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; // 16 byte UUID used to identify the split object hierarchy parts. Must be - // unique inside container. All objects participaiting in the split must + // unique inside container. All objects participating in the split must // have the same `split_id` value. bytes split_id = 6 [json_name = "splitID"]; diff --git a/session/types.proto b/session/types.proto index 3def1bf..afc5ff3 100644 --- a/session/types.proto +++ b/session/types.proto @@ -53,7 +53,7 @@ message SessionToken { // Identifier of the session initiator neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; - // Lifetime parameters of the token. Filed names taken from rfc7519. + // Lifetime parameters of the token. Field names taken from rfc7519. message TokenLifetime { // Expiration Epoch uint64 exp = 1 [json_name = "exp"]; From 73143ac3623e58bef16f8aa72647c94510905aa7 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 25 Nov 2020 13:31:02 +0300 Subject: [PATCH 235/440] Add split_id search attribute and remove childfree After adding `split_id` there is no need to have $Object:CHILDFREE. Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/object/service.proto b/object/service.proto index c4f6931..7092635 100644 --- a/object/service.proto +++ b/object/service.proto @@ -304,7 +304,7 @@ message SearchRequest { // // * $Object:version \ // version - // * $Object:objectID \ + // * $Object:objectID \ // object_id // * $Object:containerID \ // container_id @@ -322,6 +322,8 @@ message SearchRequest { // homomorphic_hash // * $Object:split.parent \ // object_id of parent + // * $Object:split.split_id \ + // 16 byte UUID used to identify the split object hierarchy parts // // There are some well-known filter aliases to match objects by certain // properties: @@ -338,10 +340,6 @@ message SearchRequest { // * $Object:PHY \ // Returns only objects physically stored in the system. This filter is // activated if the `key` exists, disregarding the value and matcher type. - // * $Object:CHILDFREE \ - // With the `value` set to `true` checks if an object has empty - // children list in `Split` header. With other values returns - // non-childfree objects. message Filter { // Match type to use MatchType match_type = 1; From 29c9e1d68b6a945e0f763ba9221af72ab42c7c5b Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 25 Nov 2020 16:36:58 +0300 Subject: [PATCH 236/440] typo fix Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object/service.proto b/object/service.proto index 7092635..c87517d 100644 --- a/object/service.proto +++ b/object/service.proto @@ -322,7 +322,7 @@ message SearchRequest { // homomorphic_hash // * $Object:split.parent \ // object_id of parent - // * $Object:split.split_id \ + // * $Object:split.splitID \ // 16 byte UUID used to identify the split object hierarchy parts // // There are some well-known filter aliases to match objects by certain From 063ec430d181a07132f5e58147370cf3b6c2270b Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 8 Dec 2020 13:48:51 +0300 Subject: [PATCH 237/440] [#86] Clarify that Attributes can't have empty values In case there is a need to set flag-like attributes, the value should be set to something like `true` or `1`. Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 6 ++++-- netmap/types.proto | 3 +++ object/types.proto | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/container/types.proto b/container/types.proto index 2de3713..b098680 100644 --- a/container/types.proto +++ b/container/types.proto @@ -28,8 +28,10 @@ message Container { uint32 basic_acl = 4 [json_name = "basicACL"]; // `Attribute` is a user-defined Key-Value metadata pair attached to the - // container. Container attribute are immutable. They are set at container - // creation and cna never be added or updated. + // container. Container attributes are immutable. They are set at container + // creation and can never be added or updated. + // + // Key name must be a valid UTF-8 string. Value can't be empty. // // There are some "well-known" attributes affecting system behaviour: // diff --git a/netmap/types.proto b/netmap/types.proto index d15342b..d470bb5 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -131,6 +131,9 @@ message NodeInfo { // Administrator-defined Attributes of the NeoFS Storage Node. // + // `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 + // string. Value can't be empty. + // // Node's attributes are mostly used during Storage Policy evaluation to // calculate object's placement and find a set of nodes satisfying policy // requirements. There are some "well-known" node attributes common to all the diff --git a/object/types.proto b/object/types.proto index f8119ca..6c4eb56 100644 --- a/object/types.proto +++ b/object/types.proto @@ -86,6 +86,8 @@ message Header { // `Attribute` is a user-defined Key-Value metadata pair attached to the // object. // + // Key name must be a valid UTF-8 string. Value can't be empty. + // // There are some "well-known" attributes starting with `__NEOFS__` prefix // that affect system behaviour: // From b930782fd3abb3bdcb5f5a66a53f47313edb1560 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 8 Dec 2020 18:08:32 +0300 Subject: [PATCH 238/440] [#84] Clarify various types encoding formats Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 20 +++++++++++++------- refs/types.proto | 39 +++++++++++++++++++++++++++++++-------- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/container/types.proto b/container/types.proto index b098680..d09d446 100644 --- a/container/types.proto +++ b/container/types.proto @@ -20,7 +20,7 @@ message Container { // Identifier of the container owner neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; - // Nonce is a 16 byte UUID, used to avoid collisions of container id + // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s bytes nonce = 3 [json_name = "nonce"]; // `BasicACL` contains access control rules for owner, system, others groups diff --git a/object/service.proto b/object/service.proto index c87517d..4a30bf7 100644 --- a/object/service.proto +++ b/object/service.proto @@ -323,7 +323,7 @@ message SearchRequest { // * $Object:split.parent \ // object_id of parent // * $Object:split.splitID \ - // 16 byte UUID used to identify the split object hierarchy parts + // 16 byte UUIDv4 used to identify the split object hierarchy parts // // There are some well-known filter aliases to match objects by certain // properties: diff --git a/object/types.proto b/object/types.proto index 6c4eb56..cf52a09 100644 --- a/object/types.proto +++ b/object/types.proto @@ -11,6 +11,12 @@ import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, // hence `TOMBSTONE` and `STORAGEGROUP` payload is limited by maximal object // size. +// +// String presentation of object type is PascalCased `ObjectType` enumeration +// item name: +// * Regular +// * Tombstone +// * StorageGroup enum ObjectType { // Just a normal object REGULAR = 0; @@ -34,7 +40,7 @@ enum MatchType { // Short header fields message ShortHeader { // Object format version. Effectively the version of API library used to - // create particular object + // create particular object. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Epoch when the object was created @@ -67,7 +73,7 @@ message Header { uint64 creation_epoch = 4 [json_name = "creationEpoch"]; // Size of payload in bytes. - // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown + // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. uint64 payload_length = 5 [json_name = "payloadLength"]; // Hash of payload bytes @@ -76,7 +82,7 @@ message Header { // Type of the object payload content ObjectType object_type = 7 [json_name = "objectType"]; - // Homomorphic hash of the object payload. + // Homomorphic hash of the object payload neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"]; // Session token, if it was used during Object creation. Need it to verify @@ -136,9 +142,9 @@ message Header { // List of identifiers of the objects generated by splitting current one. repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; - // 16 byte UUID used to identify the split object hierarchy parts. Must be - // unique inside container. All objects participating in the split must - // have the same `split_id` value. + // 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be + // unique inside container. All objects participating in the split must have + // the same `split_id` value. bytes split_id = 6 [json_name = "splitID"]; } @@ -159,6 +165,6 @@ message Object { // Object metadata headers Header header = 3 [json_name = "header"]; - // Payload bytes. + // Payload bytes bytes payload = 4 [json_name = "payload"]; } diff --git a/refs/types.proto b/refs/types.proto index f56819e..a0716e4 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -5,8 +5,10 @@ package neo.fs.v2.refs; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "NeoFS.API.v2.Refs"; -// Object in NeoFS can be addressed by it's ContainerID and ObjectID. In string -// format there MUST be a '/' delimeter between them. +// Objects in NeoFS are addressed by their ContainerID and ObjectID. +// +// String presentation of `Address` is the concatenation of string encoded +// `ContainerID` and `ObjectID` delimited by '/' character. message Address { // Container identifier ContainerID container_id = 1 [json_name = "containerID"]; @@ -15,31 +17,46 @@ message Address { } // NeoFS Object unique identifier. Objects are immutable and content-addressed. -// It means `ObjectID` will change if `header` or `payload` changes. `ObjectID` -// is calculated as a hash of `header` field, which contains hash of object's -// payload. +// It means `ObjectID` will change if `header` or `payload` changes. +// +// `ObjectID` is a 32 byte long SHA256 hash of object's `header` field, which, +// in it's turn, contains hash of object's payload. +// +// String presentation is base58 encoded string. message ObjectID { // Object identifier in a binary format bytes value = 1 [json_name = "value"]; } // NeoFS container identifier. Container structures are immutable and -// content-addressed. `ContainerID` is a 32 byte long SHA256 hash of -// stable-marshalled container message. +// content-addressed. +// +// `ContainerID` is a 32 byte long SHA256 hash of stable-marshalled container +// message. +// +// String presentation is base58 encoded string. message ContainerID { // Container identifier in a binary format. bytes value = 1 [json_name = "value"]; } -// OwnerID is a derivative of a user's main public key. The transformation +// `OwnerID` is a derivative of a user's main public key. The transformation // algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can // be directly used as `OwnerID`. +// +// `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte +// followed by 20 bytes of ScrptHash and 4 bytes of checksum. +// +// String presentation is Base58 Check Encoded string. message OwnerID { // Identifier of the container owner in a binary format bytes value = 1 [json_name = "value"]; } // API version used by a node. +// +// String presentation is a Semantic Versioning 2.0.0 compatible version string +// with 'v' prefix. I.e. `vX.Y`, where `X` - major number, `Y` - minor number. message Version { // Major API version uint32 major = 1 [json_name = "major"]; @@ -69,6 +86,12 @@ enum ChecksumType { } // Checksum message. +// Depending on checksum algorithm type the string presentation may vary: +// +// * TZ \ +// Hex encoded string without `0x` prefix +// * SHA256 \ +// Hex encoded string without `0x` prefix message Checksum { // Checksum algorithm type ChecksumType type = 1 [json_name = "type"]; From 289a6366fadaecccc6df9cf69bb904e7f6058656 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 9 Dec 2020 11:47:38 +0300 Subject: [PATCH 239/440] [#51] Define Tombstone type and return it's address on object delete - Define payload structure for Tombstone object type. - Return address of the created TS on object delete. Useful for testing Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 5 ++++- tombstone/types.proto | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tombstone/types.proto diff --git a/object/service.proto b/object/service.proto index 4a30bf7..5ad84e2 100644 --- a/object/service.proto +++ b/object/service.proto @@ -203,7 +203,10 @@ message DeleteRequest { // removal in distributed system. message DeleteResponse { // Object DELETE Response has an empty body. - message Body { } + message Body { + // Address of the tombstone created for the deleted object + neo.fs.v2.refs.Address tombstone = 1; + } // Body of delete object response message. Body body = 1; diff --git a/tombstone/types.proto b/tombstone/types.proto new file mode 100644 index 0000000..84b0d4c --- /dev/null +++ b/tombstone/types.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package neo.fs.v2.tombstone; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/tombstone/grpc;tombstone"; +option csharp_namespace = "NeoFS.API.v2.Tombstone"; + +import "refs/types.proto"; + +// Tombstone keeps record of deleted objects for few epochs until they are +// purged from the NeoFS network. +message Tombstone { + // Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone + // creator depending on current NeoFS network settings. + uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; + + // 16 byte UUID used to identify the split object hierarchy parts. Must be + // unique inside container. All objects participating in the split must + // have the same `split_id` value. + bytes split_id = 2 [json_name = "splitID"]; + + // List of objects to be deleted. + repeated neo.fs.v2.refs.ObjectID members = 3 [json_name = "members"]; +} From a5a39257fced517639179f713c90f09c30e49bc2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 2 Dec 2020 11:33:15 +0300 Subject: [PATCH 240/440] Add split_info field in object.GetResponse body SplitInfo structure from split_info field contains meta information to assembly the object that has been split into parts. Signed-off-by: Alex Vanin --- object/service.proto | 3 +++ object/types.proto | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/object/service.proto b/object/service.proto index 5ad84e2..6679fdd 100644 --- a/object/service.proto +++ b/object/service.proto @@ -102,6 +102,9 @@ message GetResponse { // Chunked object payload bytes chunk = 2; + + // Meta information of split hierarchy for object assembly. + SplitInfo split_info = 3; } } // Body of get object response message. diff --git a/object/types.proto b/object/types.proto index cf52a09..94c8538 100644 --- a/object/types.proto +++ b/object/types.proto @@ -168,3 +168,21 @@ message Object { // Payload bytes bytes payload = 4 [json_name = "payload"]; } + +// Meta information of split hierarchy for object assembly. With last part +// one can traverse linked list of split hierarchy back to first part and +// assemble original object. With linking object one can assembly object +// straight away from the object parts. +message SplitInfo { + // 16 byte UUID used to identify the split object hierarchy parts. + bytes split_id = 1; + + // Identifier of the last object in split hierarchy parts. It contains + // split header with original object header. + neo.fs.v2.refs.ObjectID last_part = 2; + + // Identifier of linking object for split hierarchy parts. It contains + // split header with original object header and sorted list of + // object parts. + neo.fs.v2.refs.ObjectID link = 3; +} From 7995020a9d290d74236ce05536cacf980fea1a67 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 7 Dec 2020 15:02:20 +0300 Subject: [PATCH 241/440] Add split_info field in object.HeadResponse body Head operation returns SplitInfo structure if request has raw flag and ID of virtual object. Signed-off-by: Alex Vanin --- object/service.proto | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/object/service.proto b/object/service.proto index 6679fdd..0ebc544 100644 --- a/object/service.proto +++ b/object/service.proto @@ -270,13 +270,17 @@ message HeaderWithSignature { message HeadResponse { // Object HEAD response body message Body { - // Requested object header or it's part. + // Requested object header, it's part or meta information about split + // object. oneof head{ // Full object's `Header` with `ObjectID` signature HeaderWithSignature header = 1; // Short object header ShortHeader short_header = 2; + + // Meta information of split hierarchy. + SplitInfo split_info = 3; } } // Body of head object response message. From 7f26542813c02783222c760c2a00e610755e0a88 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 7 Dec 2020 15:06:44 +0300 Subject: [PATCH 242/440] Add split_info field in object.GetRangeResponse body Signed-off-by: Alex Vanin --- object/service.proto | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/object/service.proto b/object/service.proto index 0ebc544..f8476a7 100644 --- a/object/service.proto +++ b/object/service.proto @@ -436,8 +436,14 @@ message GetRangeResponse { // initial preamble message. The requested byte range is sent as a series // chunks. message Body { - // Chunked object payload's range - bytes chunk = 1; + // Requested object range or meta information about split object. + oneof range_part{ + // Chunked object payload's range. + bytes chunk = 1; + + // Meta information of split hierarchy. + SplitInfo split_info = 2; + } } // Body of get range object response message. From 75dd1261e35fcf4d119aa1adb5f9f508ea903a01 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 7 Dec 2020 16:15:01 +0300 Subject: [PATCH 243/440] Add raw flag in object.GetRangeRequest Raw flag used to get range of physically stored objects and ignoring split objects. In case of split object node should return SplitInfo message. Signed-off-by: Alex Vanin --- object/service.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/object/service.proto b/object/service.proto index f8476a7..4116de6 100644 --- a/object/service.proto +++ b/object/service.proto @@ -414,6 +414,10 @@ message GetRangeRequest { // Requested payload range Range range = 2; + + // If `raw` flag is set, request will work only with objects that are + // physically stored on the peer node. + bool raw = 3; } // Body of get range object request message. From 99a537ea658d55bc34490c86107c637cc36fd436 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 10 Dec 2020 19:02:28 +0300 Subject: [PATCH 244/440] Add 2.1.0 release changelog Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22fddf6..d67bfea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## [2.1.0] - 2020-12-XX - Modo (모도, 茅島) + +Object split and deletion improvements, documentation clarifications. + +### Added +- `$Object:objectID` added to the list of available ACL and Search filters +- `split_id` field added in `object.Object.header` +- `$Object:split.splitID` search filter added +- json_name notation added to `acl.EACLTable.Version` field +- Adding `tombstone` field with newly created tombstone address field to + `object.DeleteResponse.Body` +- `tombstone` package added +- Tombstone payload definition added as `tombstone.Tombstone` message +- `SplitInfo` message added to `object` package +- `split_info` field added to `object.GetResponse.Body` +- `split_info` field added to `object.HeadResponse.Body` +- `split_info` field added to `object.GetRangeResponse.Body` +- `raw` flag added in `object.GetRangeRequest.Body` + +### Changed +- Clarified special search index descriptions +- Clarified various types encoding formats descriptions + +### Removed +- `$Object:CHILDFREE` filter description removed from well-known list +- `$Object:LEAF` filter description removed from well-known list + ## [2.0.2] - 2020-10-27 More "well-known" application attributes and documentation updates. @@ -198,3 +225,4 @@ Bump major release [2.0.0]: https://github.com/nspcc-dev/neofs-api/compare/v1.2.0...v2.0.0 [2.0.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.0...v2.0.1 [2.0.2]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.1...v2.0.2 +[2.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.2...v2.1.0 From a8c1779690de8380f28c736e8cecaa78bd4a7b44 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 11 Dec 2020 09:46:00 +0300 Subject: [PATCH 245/440] [#81] Clarify that attribute names must be unique All types of attribute keys must be unique and can't be repeated in the same entity. - Containers with duplicated attribute keys must not be accepted by InnerRing on creation. - Nodes with duplicated attribute keys can't be accepted to NetMap by InnerRing - Objects with duplicated attribute keys must be considered invalid and not accepted in PUT operations Signed-off-by: Stanislav Bogatyrev --- container/types.proto | 4 +++- netmap/types.proto | 5 ++++- object/types.proto | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/container/types.proto b/container/types.proto index d09d446..f412a28 100644 --- a/container/types.proto +++ b/container/types.proto @@ -31,7 +31,9 @@ message Container { // container. Container attributes are immutable. They are set at container // creation and can never be added or updated. // - // Key name must be a valid UTF-8 string. Value can't be empty. + // Key name must be a container-unique valid UTF-8 string. Value can't be + // empty. Containers with duplicated attribute names or attributes with empty + // values will be considered invalid. // // There are some "well-known" attributes affecting system behaviour: // diff --git a/netmap/types.proto b/netmap/types.proto index d470bb5..3f819b1 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -179,7 +179,10 @@ message NodeInfo { // `Country`. repeated string parents = 3 [json_name = "parents"]; } - // Carries list of the NeoFS node attributes in a string key-value format. + // Carries list of the NeoFS node attributes in a key-value form. Key name + // must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo + // structures with duplicated attribute names or attributes with empty values + // will be considered invalid. repeated Attribute attributes = 3 [json_name = "attributes"]; // Represents the enumeration of various states of the NeoFS node. diff --git a/object/types.proto b/object/types.proto index 94c8538..3a94559 100644 --- a/object/types.proto +++ b/object/types.proto @@ -92,7 +92,9 @@ message Header { // `Attribute` is a user-defined Key-Value metadata pair attached to the // object. // - // Key name must be a valid UTF-8 string. Value can't be empty. + // Key name must be a object-unique valid UTF-8 string. Value can't be empty. + // Objects with duplicated attribute names or attributes with empty values + // will be considered invalid. // // There are some "well-known" attributes starting with `__NEOFS__` prefix // that affect system behaviour: From baa02d45703043ded4f95066f88bdbb5b98829f7 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 11 Dec 2020 10:20:21 +0300 Subject: [PATCH 246/440] Update auto-generated documentation Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 4 ++- proto-docs/container.md | 10 ++++-- proto-docs/netmap.md | 5 ++- proto-docs/object.md | 74 ++++++++++++++++++++++++++++++++--------- proto-docs/refs.md | 39 +++++++++++++++++----- proto-docs/session.md | 2 +- proto-docs/tombstone.md | 63 +++++++++++++++++++++++++++++++++++ 7 files changed, 168 insertions(+), 29 deletions(-) create mode 100644 proto-docs/tombstone.md diff --git a/proto-docs/acl.md b/proto-docs/acl.md index da4f946..6bf0176 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -65,7 +65,7 @@ owner with additional information preventing token's abuse. ### Message BearerToken.Body.TokenLifetime -Lifetime parameters of the token. Filed names taken from +Lifetime parameters of the token. Field names taken from [rfc7519](https://tools.ietf.org/html/rfc7519). @@ -101,6 +101,8 @@ prefix to the name. Here is the list of fields available via this prefix: * $Object:version \ version +* $Object:objectID \ + object_id * $Object:containerID \ container_id * $Object:ownerID \ diff --git a/proto-docs/container.md b/proto-docs/container.md index 25ac837..c5dbe82 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -453,7 +453,7 @@ of stable-marshalled container message. | ----- | ---- | ----- | ----------- | | version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively the version of API library used to create container. | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the container owner | -| nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id | +| nonce | [bytes](#bytes) | | Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s | | basic_acl | [uint32](#uint32) | | `BasicACL` contains access control rules for owner, system, others groups and permission bits for `BearerToken` and `Extended ACL` | | attributes | [Container.Attribute](#neo.fs.v2.container.Container.Attribute) | repeated | Attributes represent immutable container's meta data | | placement_policy | [neo.fs.v2.netmap.PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) | | Placement policy for the object inside the container | @@ -463,8 +463,12 @@ of stable-marshalled container message. ### Message Container.Attribute `Attribute` is a user-defined Key-Value metadata pair attached to the -container. Container attribute are immutable. They are set at container -creation and cna never be added or updated. +container. Container attributes are immutable. They are set at container +creation and can never be added or updated. + +Key name must be a container-unique valid UTF-8 string. Value can't be +empty. Containers with duplicated attribute names or attributes with empty +values will be considered invalid. There are some "well-known" attributes affecting system behaviour: diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 30386ec..cc27c5a 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -149,7 +149,7 @@ NeoFS node description | ----- | ---- | ----- | ----------- | | public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format. | | address | [string](#string) | | Ways to connect to a node | -| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | +| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. | | state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node. | @@ -158,6 +158,9 @@ NeoFS node description ### Message NodeInfo.Attribute Administrator-defined Attributes of the NeoFS Storage Node. +`Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 +string. Value can't be empty. + Node's attributes are mostly used during Storage Policy evaluation to calculate object's placement and find a set of nodes satisfying policy requirements. There are some "well-known" node attributes common to all the diff --git a/proto-docs/object.md b/proto-docs/object.md index 4072fa4..1b0433f 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -51,6 +51,7 @@ - [Header.Split](#neo.fs.v2.object.Header.Split) - [Object](#neo.fs.v2.object.Object) - [ShortHeader](#neo.fs.v2.object.ShortHeader) + - [SplitInfo](#neo.fs.v2.object.SplitInfo) - [Scalar Value Types](#scalar-value-types) @@ -199,6 +200,10 @@ removal in distributed system. Object DELETE Response has an empty body. +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| tombstone | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the tombstone created for the deleted object | + @@ -275,6 +280,7 @@ Byte range of object's payload request body | ----- | ---- | ----- | ----------- | | address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Address of the object containing the requested payload range | | range | [Range](#neo.fs.v2.object.Range) | | Requested payload range | +| raw | [bool](#bool) | | If `raw` flag is set, request will work only with objects that are physically stored on the peer node. | @@ -301,7 +307,8 @@ chunks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| chunk | [bytes](#bytes) | | Chunked object payload's range | +| chunk | [bytes](#bytes) | | Chunked object payload's range. | +| split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. | @@ -352,6 +359,7 @@ GET Object Response body | ----- | ---- | ----- | ----------- | | init | [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) | | Initial part of the object stream | | chunk | [bytes](#bytes) | | Chunked object payload | +| split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy for object assembly. | @@ -417,6 +425,7 @@ Object HEAD response body | ----- | ---- | ----- | ----------- | | header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object's `Header` with `ObjectID` signature | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | +| split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. | @@ -551,6 +560,8 @@ prefix to the name. Here is the list of fields available via this prefix: * $Object:version \ version +* $Object:objectID \ + object_id * $Object:containerID \ container_id * $Object:ownerID \ @@ -567,20 +578,24 @@ prefix to the name. Here is the list of fields available via this prefix: homomorphic_hash * $Object:split.parent \ object_id of parent +* $Object:split.splitID \ + 16 byte UUIDv4 used to identify the split object hierarchy parts There are some well-known filter aliases to match objects by certain properties: * $Object:ROOT \ - With the `value` set to `true` checks if an object is a top object in a - split hierarchy. With other values returns non-root objects. -* $Object:LEAF \ - With the `value` set to `true` checks if an object is a leaf in a split - hierarchy. With other values returns non-leaf objects. -* $Object:CHILDFREE \ - With the `value` set to `true` checks if an object has empty - children list in `Split` header. With other values returns - non-childfree objects. + Returns only `REGULAR` type objects that are not split or are the top + level root objects in a split hierarchy. This includes objects not + present physically, like large objects split into smaller objects + without separate top-level root object. Other type objects like + StorageGroups and Tombstones will not be shown. This filter may be + useful for listing objects like `ls` command of some virtual file + system. This filter is activated if the `key` exists, disregarding the + value and matcher type. +* $Object:PHY \ + Returns only objects physically stored in the system. This filter is + activated if the `key` exists, disregarding the value and matcher type. | Field | Type | Label | Description | @@ -640,10 +655,10 @@ Object Header | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | -| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | +| payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. | | payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | -| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload. | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy | @@ -655,6 +670,10 @@ Object Header `Attribute` is a user-defined Key-Value metadata pair attached to the object. +Key name must be a object-unique valid UTF-8 string. Value can't be empty. +Objects with duplicated attribute names or attributes with empty values +will be considered invalid. + There are some "well-known" attributes starting with `__NEOFS__` prefix that affect system behaviour: @@ -698,6 +717,7 @@ must be within the same container. | parent_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `signature` field of the parent object. Used to reconstruct parent. | | parent_header | [Header](#neo.fs.v2.object.Header) | | `header` field of the parent object. Used to reconstruct parent. | | children | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of identifiers of the objects generated by splitting current one. | +| split_id | [bytes](#bytes) | | 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. | @@ -713,7 +733,7 @@ hash of header field, which contains hash of object's payload. | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object's unique identifier. | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed object_id | | header | [Header](#neo.fs.v2.object.Header) | | Object metadata headers | -| payload | [bytes](#bytes) | | Payload bytes. | +| payload | [bytes](#bytes) | | Payload bytes | @@ -724,12 +744,28 @@ Short header fields | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object. | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | | payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | + + + +### Message SplitInfo +Meta information of split hierarchy for object assembly. With last part +one can traverse linked list of split hierarchy back to first part and +assemble original object. With linking object one can assembly object +straight away from the object parts. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. | +| last_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the last object in split hierarchy parts. It contains split header with original object header. | +| link | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of linking object for split hierarchy parts. It contains split header with original object header and sorted list of object parts. | + @@ -748,7 +784,15 @@ Type of match expression ### ObjectType -Type of the object payload content. +Type of the object payload content. Only `REGULAR` type objects can be split, +hence `TOMBSTONE` and `STORAGEGROUP` payload is limited by maximal object +size. + +String presentation of object type is PascalCased `ObjectType` enumeration +item name: +* Regular +* Tombstone +* StorageGroup | Name | Number | Description | | ---- | ------ | ----------- | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index f53d36a..5280c23 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -31,8 +31,10 @@ ### Message Address -Object in NeoFS can be addressed by it's ContainerID and ObjectID. In string -format there MUST be a '/' delimeter between them. +Objects in NeoFS are addressed by their ContainerID and ObjectID. + +String presentation of `Address` is the concatenation of string encoded +`ContainerID` and `ObjectID` delimited by '/' character. | Field | Type | Label | Description | @@ -45,6 +47,12 @@ format there MUST be a '/' delimeter between them. ### Message Checksum Checksum message. +Depending on checksum algorithm type the string presentation may vary: + +* TZ \ + Hex encoded string without `0x` prefix +* SHA256 \ + Hex encoded string without `0x` prefix | Field | Type | Label | Description | @@ -57,8 +65,12 @@ Checksum message. ### Message ContainerID NeoFS container identifier. Container structures are immutable and -content-addressed. `ContainerID` is a 32 byte long SHA256 hash of -stable-marshalled container message. +content-addressed. + +`ContainerID` is a 32 byte long SHA256 hash of stable-marshalled container +message. + +String presentation is base58 encoded string. | Field | Type | Label | Description | @@ -70,9 +82,12 @@ stable-marshalled container message. ### Message ObjectID NeoFS Object unique identifier. Objects are immutable and content-addressed. -It means `ObjectID` will change if `header` or `payload` changes. `ObjectID` -is calculated as a hash of `header` field, which contains hash of object's -payload. +It means `ObjectID` will change if `header` or `payload` changes. + +`ObjectID` is a 32 byte long SHA256 hash of object's `header` field, which, +in it's turn, contains hash of object's payload. + +String presentation is base58 encoded string. | Field | Type | Label | Description | @@ -83,10 +98,15 @@ payload. ### Message OwnerID -OwnerID is a derivative of a user's main public key. The transformation +`OwnerID` is a derivative of a user's main public key. The transformation algorithm is the same as for Neo3 wallet addresses. Neo3 wallet address can be directly used as `OwnerID`. +`OwnerID` is a 25 bytes sequence starting with Neo version prefix byte +followed by 20 bytes of ScrptHash and 4 bytes of checksum. + +String presentation is Base58 Check Encoded string. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -110,6 +130,9 @@ Signature of something in NeoFS. ### Message Version API version used by a node. +String presentation is a Semantic Versioning 2.0.0 compatible version string +with 'v' prefix. I.e. `vX.Y`, where `X` - major number, `Y` - minor number. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | diff --git a/proto-docs/session.md b/proto-docs/session.md index c61855d..e1340c9 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -230,7 +230,7 @@ Session Token body ### Message SessionToken.Body.TokenLifetime -Lifetime parameters of the token. Filed names taken from rfc7519. +Lifetime parameters of the token. Field names taken from rfc7519. | Field | Type | Label | Description | diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md new file mode 100644 index 0000000..e43a212 --- /dev/null +++ b/proto-docs/tombstone.md @@ -0,0 +1,63 @@ +# Protocol Documentation + + +## Table of Contents + +- [tombstone/types.proto](#tombstone/types.proto) + + - Messages + - [Tombstone](#neo.fs.v2.tombstone.Tombstone) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## tombstone/types.proto + + + + + + + +### Message Tombstone +Tombstone keeps record of deleted objects for few epochs until they are +purged from the NeoFS network. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone creator depending on current NeoFS network settings. | +| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. | +| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From 953b2750a23a8bd54ad67dd0dd2de5add081707c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 11 Dec 2020 14:09:43 +0300 Subject: [PATCH 247/440] =?UTF-8?q?Release=20v2.1.0=20-=20Modo=20(?= =?UTF-8?q?=EB=AA=A8=EB=8F=84,=20=E8=8C=85=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Object split and deletion improvements, documentation clarifications. Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 8 ++++---- README.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d67bfea..4fea3de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.1.0] - 2020-12-XX - Modo (모도, 茅島) +## [2.1.0] - 2020-12-11 - Modo (모도, 茅島) Object split and deletion improvements, documentation clarifications. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 60bd875..5d02d3c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,7 +25,7 @@ Start by forking the `neofs-api` repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: -### Setup your GitHub Repository +### Set up your GitHub Repository Fork [NeoFS node upstream](https://github.com/nspcc-dev/neofs-api/fork) source repository to your own personal repository. Copy the URL of your fork (you will need it for the `git clone` command below). @@ -48,7 +48,7 @@ Before making code changes, make sure you create a separate branch for these changes. Maybe you will find it convenient to name branch in `/-` format. -``` +```sh $ git checkout -b feature/123-something_awesome ``` @@ -75,7 +75,7 @@ Description ``` -``` +```sh $ git commit -am '[#123] Add some feature' ``` @@ -109,7 +109,7 @@ Signed-off-by: Samii Sakisaka This can easily be done with the `--signoff` option to `git commit`. By doing this you state that you can certify the following (from [The Developer -Certificate of Origin](https://developercertificate.org/): +Certificate of Origin](https://developercertificate.org/)): ``` Developer Certificate of Origin diff --git a/README.md b/README.md index ab60b0f..7a68acd 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This repository contains: Feel free to contribute to this project after reading the [contributing guidelines](CONTRIBUTING.md). -Before starting to work on a certain topic, create an new issue first, +Before starting to work on a certain topic, create a new issue first, describing the feature/topic you are going to implement. ## License From 47c7452eb22c864d57a83ce7233882176b284a6c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 14 Dec 2020 19:40:12 +0300 Subject: [PATCH 248/440] [#84] Clarify JSON encoding for OID, CID and OwnerID Signed-off-by: Stanislav Bogatyrev --- refs/types.proto | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/refs/types.proto b/refs/types.proto index a0716e4..84bab73 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -19,10 +19,19 @@ message Address { // NeoFS Object unique identifier. Objects are immutable and content-addressed. // It means `ObjectID` will change if `header` or `payload` changes. // -// `ObjectID` is a 32 byte long SHA256 hash of object's `header` field, which, -// in it's turn, contains hash of object's payload. +// `ObjectID` is a 32 byte long +// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +// object's `header` field, which, in it's turn, contains hash of object's +// payload. // -// String presentation is base58 encoded string. +// String presentation is +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be the data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. message ObjectID { // Object identifier in a binary format bytes value = 1 [json_name = "value"]; @@ -31,10 +40,18 @@ message ObjectID { // NeoFS container identifier. Container structures are immutable and // content-addressed. // -// `ContainerID` is a 32 byte long SHA256 hash of stable-marshalled container -// message. +// `ContainerID` is a 32 byte long +// [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +// stable-marshalled container message. // -// String presentation is base58 encoded string. +// String presentation is +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be the data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. message ContainerID { // Container identifier in a binary format. bytes value = 1 [json_name = "value"]; @@ -47,7 +64,14 @@ message ContainerID { // `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte // followed by 20 bytes of ScrptHash and 4 bytes of checksum. // -// String presentation is Base58 Check Encoded string. +// String presentation is [Base58 +// Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. +// +// JSON value will be the data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. message OwnerID { // Identifier of the container owner in a binary format bytes value = 1 [json_name = "value"]; From 73ccd17adbde70a372a95511525d80115512b8be Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 15 Dec 2020 17:09:07 +0300 Subject: [PATCH 249/440] Clarify object field usage in some requests' eACL filters Signed-off-by: Stanislav Bogatyrev --- acl/types.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/acl/types.proto b/acl/types.proto index e531e5f..3ca0a2e 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -121,6 +121,11 @@ message EACLRecord { // * $Object:homomorphicHash \ // homomorphic_hash // + // Please note, that if request or response does not have object's headers or + // full object (Range, RangeHash, Search, Delete), it will not be possible to + // filter by object header fields or user attributes. From the well-known list + // only `$Object:objectID` and `$Object:containerID` will be available, as + // it's possible to take that information from the requested address. message Filter { // Define if Object or Request header will be used HeaderType header_type = 1 [json_name = "headerType"]; From 974a99e6c2b803c194a5bacd81772f6a5929149e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 17 Dec 2020 10:28:02 +0300 Subject: [PATCH 250/440] Update changelog for v2.1.1 Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fea3de..618872e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.1.1] - 2020-12-17 + +Minor documentation fixes + +### Changed +- Clarify JSON encoding for `ObjectID`, `ContainerID` and `OwnerID` +- Clarify object field usage in some requests' eACL filters + ## [2.1.0] - 2020-12-11 - Modo (모도, 茅島) Object split and deletion improvements, documentation clarifications. From c5612b01cc7b0439b8f770b3b53dbef346a7db86 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 17 Dec 2020 10:53:40 +0300 Subject: [PATCH 251/440] [#110] Add hashes to ShortHeader structure Hashes in ShortHeader are needed for Data Audit process. Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/object/types.proto b/object/types.proto index 3a94559..097d2db 100644 --- a/object/types.proto +++ b/object/types.proto @@ -55,6 +55,12 @@ message ShortHeader { // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown uint64 payload_length = 5 [json_name = "payloadLength"]; + + // Hash of payload bytes + neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + + // Homomorphic hash of the object payload + neo.fs.v2.refs.Checksum homomorphic_hash = 7 [json_name = "homomorphicHash"]; } // Object Header From bee986c72cb671ccbbd20b79f296ac1a42cedefc Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 17 Dec 2020 17:55:53 +0300 Subject: [PATCH 252/440] [#109] Define data audit result structure Inner ring nodes conduct data audit and submit audit results. Results are then saved in audit smart contract for settlement routines to transfer payments. We don't need to save the full detailed audit report, but only provide enough information for other subsystems to reward or punish storage nodes. Signed-off-by: Stanislav Bogatyrev --- audit/types.proto | 59 ++++++++++++++++++++++++++++++++++++ proto-docs/audit.md | 74 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 audit/types.proto create mode 100644 proto-docs/audit.md diff --git a/audit/types.proto b/audit/types.proto new file mode 100644 index 0000000..551e8c2 --- /dev/null +++ b/audit/types.proto @@ -0,0 +1,59 @@ +syntax = "proto3"; + +package neo.fs.v2.audit; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/audit/grpc;audit"; +option csharp_namespace = "NeoFS.API.v2.Audit"; + +import "refs/types.proto"; + +// DataAuditResult keeps record of conducted Data Audits. The detailed report is +// generated separately. +message DataAuditResult { + // Data Audit Result format version. Effectively the version of API library + // used to report DataAuditResult structure. + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + + // Epoch number when the Data Audit was conducted + fixed64 audit_epoch = 2 [json_name = "auditEpoch"]; + + // Container under audit + neo.fs.v2.refs.ContainerID container_id = 3 [json_name = "containerID"]; + + // Public key of the auditing InnerRing node in a binary format + bytes public_key = 4 [json_name = "publicKey"]; + + // Shows if Data Audit process was complete in time or if it was cancelled + bool complete = 5 [json_name = "complete"]; + + // Number of request done at PoR stage + uint32 requests = 6 [json_name = "requests"]; + + // Number of retries done at PoR stage + uint32 retries = 7 [json_name = "retries"]; + + // List of Storage Groups that passed audit PoR stage + repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [json_name = "passSG"]; + + // List of Storage Groups that failed audit PoR stage + repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [json_name = "failSG"]; + + // Number of sampled objects under audit placed in an optimal way according to + // the containers placement policy when checking PoP + uint32 hit = 10 [json_name = "hit"]; + + // Number of sampled objects under audit placed in suboptimal way according to + // the containers placement policy, but still at a satisfactory level when + // checking PoP + uint32 miss = 11 [json_name = "miss"]; + + // Number of sampled objects under audit stored in a way not confirming + // placement policy or not found at all when checking PoP + uint32 fail = 12 [json_name = "fail"]; + + // List of storage node public keys that passed at least one PDP + repeated bytes pass_nodes = 13 [json_name = "passNodes"]; + + // List of storage node public keys that failed at least one PDP + repeated bytes fail_nodes = 14 [json_name = "failNodes"]; +} diff --git a/proto-docs/audit.md b/proto-docs/audit.md new file mode 100644 index 0000000..073c2cb --- /dev/null +++ b/proto-docs/audit.md @@ -0,0 +1,74 @@ +# Protocol Documentation + + +## Table of Contents + +- [audit/types.proto](#audit/types.proto) + + - Messages + - [DataAuditResult](#neo.fs.v2.audit.DataAuditResult) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## audit/types.proto + + + + + + + +### Message DataAuditResult +DataAuditResult keeps record of conducted Data Audits. The detailed report is +generated separately. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Data Audit Result format version. Effectively the version of API library used to report DataAuditResult structure. | +| audit_epoch | [fixed64](#fixed64) | | Epoch number when the Data Audit was conducted | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Container under audit | +| public_key | [bytes](#bytes) | | Public key of the auditing InnerRing node in a binary format | +| complete | [bool](#bool) | | Shows if Data Audit process was complete in time or if it was cancelled | +| requests | [uint32](#uint32) | | Number of request done at PoR stage | +| retries | [uint32](#uint32) | | Number of retries done at PoR stage | +| pass_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that passed audit PoR stage | +| fail_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that failed audit PoR stage | +| hit | [uint32](#uint32) | | Number of sampled objects under audit placed in an optimal way according to the containers placement policy when checking PoP | +| miss | [uint32](#uint32) | | Number of sampled objects under audit placed in suboptimal way according to the containers placement policy, but still at a satisfactory level when checking PoP | +| fail | [uint32](#uint32) | | Number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking PoP | +| pass_nodes | [bytes](#bytes) | repeated | List of storage node public keys that passed at least one PDP | +| fail_nodes | [bytes](#bytes) | repeated | List of storage node public keys that failed at least one PDP | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From d7ca10d468a4cbbed0021a76cb5e4f7610f5bb14 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 25 Dec 2020 15:16:10 +0300 Subject: [PATCH 253/440] docs: Update auto-generated documentation Signed-off-by: Stanislav Bogatyrev --- proto-docs/acl.md | 6 ++++++ proto-docs/object.md | 2 ++ proto-docs/refs.md | 38 +++++++++++++++++++++++++++++++------- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 6bf0176..dc2375a 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -118,6 +118,12 @@ prefix to the name. Here is the list of fields available via this prefix: * $Object:homomorphicHash \ homomorphic_hash +Please note, that if request or response does not have object's headers or +full object (Range, RangeHash, Search, Delete), it will not be possible to +filter by object header fields or user attributes. From the well-known list +only `$Object:objectID` and `$Object:containerID` will be available, as +it's possible to take that information from the requested address. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | diff --git a/proto-docs/object.md b/proto-docs/object.md index 1b0433f..fdf3001 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -749,6 +749,8 @@ Short header fields | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | | payload_length | [uint64](#uint64) | | Size of payload in bytes. `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown | +| payload_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Hash of payload bytes | +| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 5280c23..d423de5 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -67,10 +67,18 @@ Depending on checksum algorithm type the string presentation may vary: NeoFS container identifier. Container structures are immutable and content-addressed. -`ContainerID` is a 32 byte long SHA256 hash of stable-marshalled container -message. +`ContainerID` is a 32 byte long +[SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +stable-marshalled container message. -String presentation is base58 encoded string. +String presentation is +[base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. + +JSON value will be the data encoded as a string using standard base64 +encoding with paddings. Either +[standard](https://tools.ietf.org/html/rfc4648#section-4) or +[URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +with/without paddings are accepted. | Field | Type | Label | Description | @@ -84,10 +92,19 @@ String presentation is base58 encoded string. NeoFS Object unique identifier. Objects are immutable and content-addressed. It means `ObjectID` will change if `header` or `payload` changes. -`ObjectID` is a 32 byte long SHA256 hash of object's `header` field, which, -in it's turn, contains hash of object's payload. +`ObjectID` is a 32 byte long +[SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of +object's `header` field, which, in it's turn, contains hash of object's +payload. -String presentation is base58 encoded string. +String presentation is +[base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. + +JSON value will be the data encoded as a string using standard base64 +encoding with paddings. Either +[standard](https://tools.ietf.org/html/rfc4648#section-4) or +[URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +with/without paddings are accepted. | Field | Type | Label | Description | @@ -105,7 +122,14 @@ be directly used as `OwnerID`. `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte followed by 20 bytes of ScrptHash and 4 bytes of checksum. -String presentation is Base58 Check Encoded string. +String presentation is [Base58 +Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. + +JSON value will be the data encoded as a string using standard base64 +encoding with paddings. Either +[standard](https://tools.ietf.org/html/rfc4648#section-4) or +[URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +with/without paddings are accepted. | Field | Type | Label | Description | From 9aeea57083fe1c60b9ec241a9a4b17593de587de Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 25 Dec 2020 15:29:16 +0300 Subject: [PATCH 254/440] Update Changelog for Yeouido Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 618872e..6640ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.2.0] - 2020-12-XX - Yeouido (여의도, 汝矣島) + +Storage Groups based Data Audit updates + +### Added +- `audit.DataAuditResult` message for recording audit result is added + +### Changed +- `object.ShortHeader` now has `payload_hash` and `homomorphic_hash` fields + ## [2.1.1] - 2020-12-17 Minor documentation fixes @@ -234,3 +244,5 @@ Bump major release [2.0.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.0...v2.0.1 [2.0.2]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.1...v2.0.2 [2.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.2...v2.1.0 +[2.1.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.0...v2.1.1 +[2.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.1...v2.2.0 From 7f8a4f25bac3b52551374c471b71bf7d70a89f44 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 30 Dec 2020 10:22:32 +0300 Subject: [PATCH 255/440] =?UTF-8?q?Release=20v2.2.0=20-=20Yeouido=20(?= =?UTF-8?q?=EC=97=AC=EC=9D=98=EB=8F=84,=20=E6=B1=9D=E7=9F=A3=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Storage Groups based Data Audit updates Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6640ae7..8cb72f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.2.0] - 2020-12-XX - Yeouido (여의도, 汝矣島) +## [2.2.0] - 2020-12-30 - Yeouido (여의도, 汝矣島) Storage Groups based Data Audit updates From fac353b9a43d90e7fba019d60e6e39d18e45468e Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 11 Jan 2021 17:11:36 +0300 Subject: [PATCH 256/440] [#117] Describe well-known X-Headers When object can't be found using current network map, there is a chance to find it using netmap versions from previous epochs. By default only current netmap is used. Well-known X-Headers can be used to set the specific netmap version and limit how deep into the past the node can go in the search of an object. Signed-off-by: Stanislav Bogatyrev --- session/service.proto | 2 +- session/types.proto | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/session/service.proto b/session/service.proto index 40c5255..e3c0cc2 100644 --- a/session/service.proto +++ b/session/service.proto @@ -21,7 +21,7 @@ service SessionService { message CreateRequest { // Session creation request body message Body { - // Dession initiating user's or node's key derived `OwnerID`. + // Session initiating user's or node's key derived `OwnerID` neo.fs.v2.refs.OwnerID owner_id = 1; // Session expiration `Epoch` uint64 expiration = 2; diff --git a/session/types.proto b/session/types.proto index afc5ff3..b73d27a 100644 --- a/session/types.proto +++ b/session/types.proto @@ -85,7 +85,25 @@ message SessionToken { neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; } -// Extended headers for Request/Response. +// Extended headers for Request/Response. May contain any user-defined headers +// to be interpreted on application level. +// +// Key name must be unique valid UTF-8 string. Value can't be empty. Requests or +// Responses with duplicated header names or headers with empty values will be +// considered invalid. +// +// There are some "well-known" headers starting with `__NEOFS__` prefix that +// affect system behaviour: +// +// * __NEOFS__NETMAP_EPOCH \ +// Netmap epoch to use for object placement calculation. The `value` is string +// encoded `uint64` in decimal presentation. If set to '0' or not set, the +// current epoch only will be used. +// * __NEOFS__NETMAP_LOOKUP_DEPTH \ +// If object can't be found using current epoch's netmap, this header limits +// how many past epochs back the node can lookup. The `value` is string +// encoded `uint64` in decimal presentation. If set to '0' or not set, the +// current epoch only will be used. message XHeader { // Key of the X-Header string key = 1 [json_name = "key"]; From 113c7d97d1951d140c26509000b6ff8df7d1ec64 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 15 Jan 2021 15:01:13 +0300 Subject: [PATCH 257/440] Update changelog for v2.2.1 Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb72f8..4a82f44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.2.1] - 2021-01-15 + +Define "well-known" X-headers + +### Added +- Description of the format of "well-known" X-headers that affect system behavior +- X-header key to netmap epoch value +- X-header key to netmap lookup depth value + ## [2.2.0] - 2020-12-30 - Yeouido (여의도, 汝矣島) Storage Groups based Data Audit updates @@ -246,3 +255,4 @@ Bump major release [2.1.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.0.2...v2.1.0 [2.1.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.0...v2.1.1 [2.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.1...v2.2.0 +[2.2.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.0...v2.2.1 From 3a129a2557735cf27160dd90a73a130ef83dabb2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 20 Jan 2021 19:50:29 +0300 Subject: [PATCH 258/440] [#122] container: Add AnnounceUsedSpace method Signed-off-by: Alex Vanin --- container/service.proto | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/container/service.proto b/container/service.proto index bb76839..9869478 100644 --- a/container/service.proto +++ b/container/service.proto @@ -41,6 +41,9 @@ service ContainerService { // Returns Extended ACL table and signature from `Container` smart contract // storage. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); + + // Announce container used space values for P2P synchronization. + rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); } // New NeoFS Container creation request @@ -308,3 +311,54 @@ message GetExtendedACLResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +// Announce container used space +message AnnounceUsedSpaceRequest { + // Container used space announcement body. + message Body { + // Announcement contains used space information about single container. + message Announcement { + // Identifier of the container + neo.fs.v2.refs.ContainerID container_id = 1; + + // used_space is a sum of object payused space sizes of specified + // container, stored in the node. It must not include inhumed objects. + uint64 used_space = 2; + } + + // List of announcements. If nodes share several containers, then + // announcements transferred in a batch. + repeated Announcement announcements = 1; + } + + // Body of announce used space request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Announce container used space +message AnnounceUsedSpaceResponse { + // `AnnounceUsedSpaceResponse` has an empty body because announcements are + // one way communication. + message Body { } + + // Body of announce used space response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} From c51f4cd314b229e0b71b454cdef79b2d999b3147 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 26 Jan 2021 21:22:39 +0300 Subject: [PATCH 259/440] [#122] container: Add epoch field to size announcement Nodes aggregate size estimation based on container id and epoch number. Estimations are not valid forever. Signed-off-by: Alex Vanin --- container/service.proto | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/container/service.proto b/container/service.proto index 9869478..5e4295b 100644 --- a/container/service.proto +++ b/container/service.proto @@ -318,12 +318,15 @@ message AnnounceUsedSpaceRequest { message Body { // Announcement contains used space information about single container. message Announcement { - // Identifier of the container - neo.fs.v2.refs.ContainerID container_id = 1; + // Epoch number for which container size estimation was produced. + uint64 epoch = 1; - // used_space is a sum of object payused space sizes of specified + // Identifier of the container. + neo.fs.v2.refs.ContainerID container_id = 2; + + // Used space is a sum of object payload sizes of specified // container, stored in the node. It must not include inhumed objects. - uint64 used_space = 2; + uint64 used_space = 3; } // List of announcements. If nodes share several containers, then From ad4a9142ab2e438c02aa7d8e992edff590e7b7ed Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 1 Feb 2021 20:27:00 +0300 Subject: [PATCH 260/440] [#119] object: Define STRING_NOT_EQUAL value in MatchType enum Signed-off-by: Leonard Lyubich --- object/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/types.proto b/object/types.proto index 097d2db..5407aca 100644 --- a/object/types.proto +++ b/object/types.proto @@ -35,6 +35,9 @@ enum MatchType { // Full string match STRING_EQUAL = 1; + + // Full string mismatch + STRING_NOT_EQUAL = 2; } // Short header fields From 90160db0ac05ecf007c333339336d37d6c8d0efb Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 2 Feb 2021 11:49:27 +0300 Subject: [PATCH 261/440] [#120] object: Define NOT_PRESENT value in MatchType enum Signed-off-by: Leonard Lyubich --- object/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/types.proto b/object/types.proto index 5407aca..3b26c69 100644 --- a/object/types.proto +++ b/object/types.proto @@ -38,6 +38,9 @@ enum MatchType { // Full string mismatch STRING_NOT_EQUAL = 2; + + // Lack of key + NOT_PRESENT = 3; } // Short header fields From 3b6f5d70ecac096a70a661a6e9f1011c0ef6c34f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 2 Feb 2021 12:03:40 +0300 Subject: [PATCH 262/440] [#120] object: Document processing of filters with match type NOT_PRESENT The behavior of the node when processing system search filters with match type NOT_PRESENT is declared undefined. Signed-off-by: Leonard Lyubich --- object/service.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/object/service.proto b/object/service.proto index 4116de6..d31422a 100644 --- a/object/service.proto +++ b/object/service.proto @@ -350,6 +350,10 @@ message SearchRequest { // * $Object:PHY \ // Returns only objects physically stored in the system. This filter is // activated if the `key` exists, disregarding the value and matcher type. + // + // Note: using filters with a key with prefix `$Object:` and match type + // `NOT_PRESENT `is not recommended since this is not a cross-version approach. + // Behavior when processing this kind of filters is undefined. message Filter { // Match type to use MatchType match_type = 1; From 0f8fb259695e4526923b90fef2b0f875e8daa710 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 01:45:38 +0300 Subject: [PATCH 263/440] [#128] object: Add json_name tags to fields of SearchRequest.Body.Filter Signed-off-by: Leonard Lyubich --- object/service.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index d31422a..b975945 100644 --- a/object/service.proto +++ b/object/service.proto @@ -356,13 +356,13 @@ message SearchRequest { // Behavior when processing this kind of filters is undefined. message Filter { // Match type to use - MatchType match_type = 1; + MatchType match_type = 1 [json_name = "matchType"]; // Attribute or Header fields to match - string key = 2; + string key = 2 [json_name = "key"]; // Value to match - string value = 3; + string value = 3 [json_name = "value"]; } // List of search expressions repeated Filter filters = 3; From b61b7d2f3001750d846425f2f6e8459153c83385 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:38:06 +0300 Subject: [PATCH 264/440] [#129] netmap: Rename key to LOCODE attribute of the node Rename `Locode` attribute to `UN-LOCODE`. Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netmap/types.proto b/netmap/types.proto index 3f819b1..466216a 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -150,7 +150,7 @@ message NodeInfo { // * Subnet \ // String ID of Node's storage subnet. There can be only one subnet served // by the Storage Node. - // * Locode \ + // * UN-LOCODE \ // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) // format approximated to the nearest point defined in standard. From 556485c0f4f5ee8f90b93bb079cfe139ead6e787 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:41:51 +0300 Subject: [PATCH 265/440] [#129] netmap: Define CountryCode node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 466216a..a9b00fd 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -154,6 +154,8 @@ message NodeInfo { // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) // format approximated to the nearest point defined in standard. + // * CountryCode \ + // TODO: write description. // * Country \ // Country code in // [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) From 5d41fa73482b7681cee4edad11ce6561f4a0f48f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:43:50 +0300 Subject: [PATCH 266/440] [#129] netmap: Define LocationCode node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index a9b00fd..c1b2357 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -160,6 +160,8 @@ message NodeInfo { // Country code in // [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) // format. Calculated automatically from `Locode` attribute + // * LocationCode \ + // TODO: write description. // * Region \ // Country's administative subdivision where node is located. Calculated // automatically from `Locode` attribute based on `SubDiv` field. Presented From 4f7828a1be3d8b7915689c66fc95791bae662ae6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:45:22 +0300 Subject: [PATCH 267/440] [#129] netmap: Define Location node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index c1b2357..38170f1 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -162,6 +162,8 @@ message NodeInfo { // format. Calculated automatically from `Locode` attribute // * LocationCode \ // TODO: write description. + // * Location \ + // TODO: write description. // * Region \ // Country's administative subdivision where node is located. Calculated // automatically from `Locode` attribute based on `SubDiv` field. Presented From e71f7fd5a620da04a0b45f7ff6b3055d90637431 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:47:09 +0300 Subject: [PATCH 268/440] [#129] netmap: Define SubDivCode node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 38170f1..2b29beb 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -164,6 +164,8 @@ message NodeInfo { // TODO: write description. // * Location \ // TODO: write description. + // * SubDivCode \ + // TODO: write description. // * Region \ // Country's administative subdivision where node is located. Calculated // automatically from `Locode` attribute based on `SubDiv` field. Presented From 8410362db372e64886fe5835f76cd3b59ec0fb9b Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:48:23 +0300 Subject: [PATCH 269/440] [#129] netmap: Define SubDiv node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 2b29beb..4398546 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -166,6 +166,8 @@ message NodeInfo { // TODO: write description. // * SubDivCode \ // TODO: write description. + // * SubDiv \ + // TODO: write description. // * Region \ // Country's administative subdivision where node is located. Calculated // automatically from `Locode` attribute based on `SubDiv` field. Presented From 854281608e0049d98aa12a240b8d57daccb80bd8 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 10 Feb 2021 12:49:17 +0300 Subject: [PATCH 270/440] [#129] netmap: Define Continent node attribute Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 4398546..c7220ad 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -168,6 +168,8 @@ message NodeInfo { // TODO: write description. // * SubDiv \ // TODO: write description. + // * Continent \ + // TODO: write description. // * Region \ // Country's administative subdivision where node is located. Calculated // automatically from `Locode` attribute based on `SubDiv` field. Presented From 5152f607f112f138e3a1fc0cb142191f15d1dcc0 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 11 Feb 2021 14:37:29 +0300 Subject: [PATCH 271/440] [#129] netmap: Describe UN-LOCODE related attributes Signed-off-by: Stanislav Bogatyrev --- netmap/types.proto | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index c7220ad..12a2c8d 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -153,30 +153,34 @@ message NodeInfo { // * UN-LOCODE \ // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) - // format approximated to the nearest point defined in standard. + // format approximated to the nearest point defined in the standard. // * CountryCode \ - // TODO: write description. - // * Country \ // Country code in // [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - // format. Calculated automatically from `Locode` attribute - // * LocationCode \ - // TODO: write description. + // format. Calculated automatically from `UN-LOCODE` attribute. + // * Country \ + // Country short name in English, as defined in + // [ISO-3166](https://www.iso.org/obp/ui/#search). Calculated automatically + // from `UN-LOCODE` attribute. // * Location \ - // TODO: write description. + // Place names are given, whenever possible, in their national language + // versions as expressed in the Roman alphabet using the 26 characters of + // the character set adopted for international trade data interchange, + // written without diacritics . Calculated automatically from `UN-LOCODE` + // attribute. // * SubDivCode \ - // TODO: write description. + // Country's administrative subdivision where node is located. Calculated + // automatically from `UN-LOCODE` attribute based on `SubDiv` field. + // Presented in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) + // format. // * SubDiv \ - // TODO: write description. + // Country's administrative subdivision name, as defined in + // [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated + // automatically from `UN-LOCODE` attribute. // * Continent \ - // TODO: write description. - // * Region \ - // Country's administative subdivision where node is located. Calculated - // automatically from `Locode` attribute based on `SubDiv` field. Presented - // in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. - // * City \ - // City, town, village or rural area name where node is located written - // without diacritics . Calculated automatically from `Locode` attribute. + // Node's continent name according to the [Seven-Continent model] + // (https://en.wikipedia.org/wiki/Continent#Number). Calculated + // automatically from `UN-LOCODE` attribute. // // For detailed description of each well-known attribute please see the // corresponding section in NeoFS Technical specification. From a37a7c5ef4957b9c76637d4ce870d34f95961429 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 11 Feb 2021 16:13:07 +0300 Subject: [PATCH 272/440] =?UTF-8?q?Release=20v2.3.0=20-=20Seonyudo=20(?= =?UTF-8?q?=EC=84=A0=EC=9C=A0=EB=8F=84,=20=E4=BB=99=E9=81=8A=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UN-LOCODE support and Container's used space reporting Signed-off-by: Stanislav Bogatyrev --- CHANGELOG.md | 75 ++++++++++++++++++++++++++++++++++++----- proto-docs/container.md | 71 ++++++++++++++++++++++++++++++++++++++ proto-docs/netmap.md | 38 +++++++++++++++------ proto-docs/object.md | 6 ++++ proto-docs/session.md | 22 ++++++++++-- 5 files changed, 190 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a82f44..a4cddb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,47 @@ # Changelog +## [2.3.0] - 2021-02-11 - Seonyudo (선유도, 仙遊島) + +This release brings support for nodes to exchange information about disk space +used by each Container. This information will be used by Inner Ring nodes to +calculate basic rewards and payments. + +Another significant change is UN/LOCODE support for node's attributes describing +geographical location. From now on, most of the geographical attributes will be +calculated automatically from a single `UN-LOCODE` attribute in a deterministic +manner. + +### Added + +- Added `container.AnnounceUsedSpace` request for announcing disk space consumed + by container's objects on the node +- Added `Continent` well-known node's attribute +- Added `SubDivCode` well-known node's attribute +- Added `Location` well-known node's attribute +- Added `CounrtyCode` well-known node's attribute +- Added `STRING_NOT_EQUAL` match type +- Added `NOT_PRESENT` match type +- Added JSON names for search request filter fields + +### Changed + +- `Locode` well-known node's attribute renamed to `UN-LOCODE`. It will be used + as a base for calculating most of the node's geographical attributes. +- `Region` well-known node's attribute renamed to `SubDiv` + +### Removed + +- Removed `City` well-known node's attribute +- Removed `Region` well-known node's attribute + ## [2.2.1] - 2021-01-15 Define "well-known" X-headers ### Added -- Description of the format of "well-known" X-headers that affect system behavior + +- Description of the format of "well-known" X-headers that affect system + behavior - X-header key to netmap epoch value - X-header key to netmap lookup depth value @@ -14,9 +50,11 @@ Define "well-known" X-headers Storage Groups based Data Audit updates ### Added + - `audit.DataAuditResult` message for recording audit result is added ### Changed + - `object.ShortHeader` now has `payload_hash` and `homomorphic_hash` fields ## [2.1.1] - 2020-12-17 @@ -24,6 +62,7 @@ Storage Groups based Data Audit updates Minor documentation fixes ### Changed + - Clarify JSON encoding for `ObjectID`, `ContainerID` and `OwnerID` - Clarify object field usage in some requests' eACL filters @@ -32,6 +71,7 @@ Minor documentation fixes Object split and deletion improvements, documentation clarifications. ### Added + - `$Object:objectID` added to the list of available ACL and Search filters - `split_id` field added in `object.Object.header` - `$Object:split.splitID` search filter added @@ -47,10 +87,12 @@ Object split and deletion improvements, documentation clarifications. - `raw` flag added in `object.GetRangeRequest.Body` ### Changed + - Clarified special search index descriptions - Clarified various types encoding formats descriptions ### Removed + - `$Object:CHILDFREE` filter description removed from well-known list - `$Object:LEAF` filter description removed from well-known list @@ -59,11 +101,14 @@ Object split and deletion improvements, documentation clarifications. More "well-known" application attributes and documentation updates. ### Added + - Added "well-known" attributes list for extended ACL and object search filters - Added `Name`, `Timestamp` "well-known" application attributes for container -- Added `Name`, `FileName`, `Timestamp` "well-known" application attributes for object +- Added `Name`, `FileName`, `Timestamp` "well-known" application attributes for + object ### Changed + - `BearerToken.owner_id` field description changed - `Subnet` container attribute now has `__NEOFS__` prefix - Search and ACL filters now have `key` and `value` fields @@ -73,16 +118,19 @@ More "well-known" application attributes and documentation updates. Documentation updates and JSON field names definition ### Added + - Added "well-known" attributes list for `netmap.NodeInfo` - Added "well-known" attributes list for objects - Added "well-known" attributes list for containers - JSON field names defined for most of data structures ### Changed + - Documentation updated for all packages fixing typos and minor inaccuracies - `acl.EACLRecord.Target.key_list` field renamed to `keys` for consistency ### Removed + - Human-written documentation will now be only in [NeoFS Specification](https://github.com/nspcc-dev/neofs-spec) @@ -91,6 +139,7 @@ Documentation updates and JSON field names definition Major API refactoring and simplification. ### Added + - `neo.fs.v2` prefix added to all package names - `container.Attributes` field added - `refs.ContainerID` added as a separate type @@ -102,26 +151,31 @@ Major API refactoring and simplification. - `refs.Version` defined as a separate type - `refs.Version` field added to all messages stored in SmartContracts - `refs.Checksum` defined as a separate type -- `netmap.LocalNodeInfo` request added to get actual information from connected peer +- `netmap.LocalNodeInfo` request added to get actual information from connected + peer ### Changed + - Extended ACL Table format changed - Protobuf definitions style changed to follow Google Style Guide - `System` and `Extended` Object headers are merged into on `object.Header` type - `object.UserHeader` renamed to `object.Header.Attribute` -- `refs.ObjectID` is now a hash of the `object.Header` field, which contains hash of payload +- `refs.ObjectID` is now a hash of the `object.Header` field, which contains + hash of payload - `StorageGroup` information moved to Object's payload -- `netmap.NodeInfo.options` renamed to `netmap.NodeInfo.attributes` and it uses a - separate `netmap.NodeInfo.Attribute` type now. +- `netmap.NodeInfo.options` renamed to `netmap.NodeInfo.attributes` and it uses + a separate `netmap.NodeInfo.Attribute` type now. - `netmap.NodeInfo.Attribute` type now has a list of parents to construct a tree - Session Token renamed to `session.SessionToken` from `session.Token` - All Requests and Responses now have a common "body-meta-verify" structure - Meta and Verification headers now follow Matryoshka-style composition - SessionToken and BearerToken are now part of Meta header - Object placement policy format is simplified and defined in `netmap` package -- `object.Head()` request now returns either short header or full header with a signature +- `object.Head()` request now returns either short header or full header with a + signature ### Removed + - gogoproto is not used anymore - `decimal` package merged into `accounting` package - `query` package merged into `object` package @@ -142,7 +196,8 @@ Major API refactoring and simplification. ### Added -- ```acl.EACLRecord```, ```acl.EACLTable``` messages for the table of extended ACL rules. +- ```acl.EACLRecord```, ```acl.EACLTable``` messages for the table of extended + ACL rules. ## [1.1.0] - 2020-06-18 @@ -201,7 +256,8 @@ Bump major release ### Removed - `Raw` field from `object.GetRequest` and `object.HeadRequest` messages. -- `Token` field from `object.PutRequest.PutHeader` and `object.DeleteRequest` messages. +- `Token` field from `object.PutRequest.PutHeader` and `object.DeleteRequest` + messages. - `VerificationHeader` message. ## [0.7.1] - 2020-04-20 @@ -256,3 +312,4 @@ Bump major release [2.1.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.0...v2.1.1 [2.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.1...v2.2.0 [2.2.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.0...v2.2.1 +[2.3.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.1...v2.3.0 diff --git a/proto-docs/container.md b/proto-docs/container.md index c5dbe82..6c7d9dd 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -8,6 +8,11 @@ - [ContainerService](#neo.fs.v2.container.ContainerService) - Messages + - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) + - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) + - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) + - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) + - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) @@ -68,6 +73,7 @@ rpc Get(GetRequest) returns (GetResponse); rpc List(ListRequest) returns (ListResponse); rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); +rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); ``` @@ -122,9 +128,74 @@ storage. | Name | Input | Output | | ---- | ----- | ------ | | GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) | +#### Method AnnounceUsedSpace + +Announce container used space values for P2P synchronization. + +| Name | Input | Output | +| ---- | ----- | ------ | +| AnnounceUsedSpace | [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) | [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) | + + +### Message AnnounceUsedSpaceRequest +Announce container used space + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) | | Body of announce used space request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceUsedSpaceRequest.Body +Container used space announcement body. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| announcements | [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) | repeated | List of announcements. If nodes share several containers, then announcements transferred in a batch. | + + + + +### Message AnnounceUsedSpaceRequest.Body.Announcement +Announcement contains used space information about single container. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| epoch | [uint64](#uint64) | | Epoch number for which container size estimation was produced. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container. | +| used_space | [uint64](#uint64) | | Used space is a sum of object payload sizes of specified container, stored in the node. It must not include inhumed objects. | + + + + +### Message AnnounceUsedSpaceResponse +Announce container used space + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) | | Body of announce used space response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceUsedSpaceResponse.Body +`AnnounceUsedSpaceResponse` has an empty body because announcements are +one way communication. + + + ### Message DeleteRequest diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index cc27c5a..ab0cde6 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -177,21 +177,37 @@ explicitly set: * Subnet \ String ID of Node's storage subnet. There can be only one subnet served by the Storage Node. -* Locode \ +* UN-LOCODE \ Node's geographic location in [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) - format approximated to the nearest point defined in standard. -* Country \ + format approximated to the nearest point defined in the standard. +* CountryCode \ Country code in [ISO 3166-1_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) - format. Calculated automatically from `Locode` attribute -* Region \ - Country's administative subdivision where node is located. Calculated - automatically from `Locode` attribute based on `SubDiv` field. Presented - in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. -* City \ - City, town, village or rural area name where node is located written - without diacritics . Calculated automatically from `Locode` attribute. + format. Calculated automatically from `UN-LOCODE` attribute. +* Country \ + Country short name in English, as defined in + [ISO-3166](https://www.iso.org/obp/ui/#search). Calculated automatically + from `UN-LOCODE` attribute. +* Location \ + Place names are given, whenever possible, in their national language + versions as expressed in the Roman alphabet using the 26 characters of + the character set adopted for international trade data interchange, + written without diacritics . Calculated automatically from `UN-LOCODE` + attribute. +* SubDivCode \ + Country's administrative subdivision where node is located. Calculated + automatically from `UN-LOCODE` attribute based on `SubDiv` field. + Presented in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) + format. +* SubDiv \ + Country's administrative subdivision name, as defined in + [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated + automatically from `UN-LOCODE` attribute. +* Continent \ + Node's continent name according to the [Seven-Continent model] + (https://en.wikipedia.org/wiki/Continent#Number). Calculated + automatically from `UN-LOCODE` attribute. For detailed description of each well-known attribute please see the corresponding section in NeoFS Technical specification. diff --git a/proto-docs/object.md b/proto-docs/object.md index fdf3001..ab07679 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -597,6 +597,10 @@ properties: Returns only objects physically stored in the system. This filter is activated if the `key` exists, disregarding the value and matcher type. +Note: using filters with a key with prefix `$Object:` and match type +`NOT_PRESENT `is not recommended since this is not a cross-version approach. +Behavior when processing this kind of filters is undefined. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -780,6 +784,8 @@ Type of match expression | ---- | ------ | ----------- | | MATCH_TYPE_UNSPECIFIED | 0 | Unknown. Not used | | STRING_EQUAL | 1 | Full string match | +| STRING_NOT_EQUAL | 2 | Full string mismatch | +| NOT_PRESENT | 3 | Lack of key | diff --git a/proto-docs/session.md b/proto-docs/session.md index e1340c9..f2324f4 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -84,7 +84,7 @@ Session creation request body | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Dession initiating user's or node's key derived `OwnerID`. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Session initiating user's or node's key derived `OwnerID` | | expiration | [uint64](#uint64) | | Session expiration `Epoch` | @@ -243,7 +243,25 @@ Lifetime parameters of the token. Field names taken from rfc7519. ### Message XHeader -Extended headers for Request/Response. +Extended headers for Request/Response. May contain any user-defined headers +to be interpreted on application level. + +Key name must be unique valid UTF-8 string. Value can't be empty. Requests or +Responses with duplicated header names or headers with empty values will be +considered invalid. + +There are some "well-known" headers starting with `__NEOFS__` prefix that +affect system behaviour: + +* __NEOFS__NETMAP_EPOCH \ + Netmap epoch to use for object placement calculation. The `value` is string + encoded `uint64` in decimal presentation. If set to '0' or not set, the + current epoch only will be used. +* __NEOFS__NETMAP_LOOKUP_DEPTH \ + If object can't be found using current epoch's netmap, this header limits + how many past epochs back the node can lookup. The `value` is string + encoded `uint64` in decimal presentation. If set to '0' or not set, the + current epoch only will be used. | Field | Type | Label | Description | From a39e0be2bda4e90632237d16f5f2422029099525 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Sun, 14 Feb 2021 14:27:43 +0300 Subject: [PATCH 273/440] doc: Add release instructions We need release instructions to use them as a check-list at release creation time. Signed-off-by: Stanislav Bogatyrev --- doc/release_instructions.md | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 doc/release_instructions.md diff --git a/doc/release_instructions.md b/doc/release_instructions.md new file mode 100644 index 0000000..33d7ab2 --- /dev/null +++ b/doc/release_instructions.md @@ -0,0 +1,53 @@ +# Release instructions + +This documents outlines the neofs-api release process, and can be used as a TODO +list for a new release. + +## Pre-release checks + +These should run successfully: +* `make lint` + +## Pre-release actions + +These must be run: +* `make doc` + +## Writing CHANGELOG + +Add an entry to the CHANGELOG.md following the style established there. + +Add a codename for releases with new major version, version and release date in +the heading. Write a paragraph describing the most significant changes done in +this release. Then add sections with what was added, changed and removed, +describing each change briefly with a reference to GitHub issues, where +available. + +## Tag the release + +Use `vX.Y.Z` tag following the semantic versioning standard. For pre-release +versions use `vX.Y.Z-rc.N` scheme. + +## Push changes and release tag to Github + +This step should bypass the default PR mechanism to get a correct result (so +that releasing requires admin privileges for the project), both the `master` +branch update and tag must be pushed simultaneously like this: + +``` +$ git push origin master v2.7.0 +``` + +## Make a proper Github release + +Edit an automatically-created release on Github. + +Release title has to follow ` ( )` scheme for major releases and just `` for regular point +releases. + +## Post-release actions + +* Close corresponding X.Y.Z Github milestone +* Make announcements in Matrix and Discord channels +* Update [NeoFS Technical Specification](https://github.com/nspcc-dev/neofs-spec) From 1f89c9a0d81e3b08b25d5ad4a2672a5656b7ed76 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 19 Feb 2021 12:06:01 +0300 Subject: [PATCH 274/440] [#136] tombstone: Specify connection with object attribute Expiration epoch value should be the same in tombstone object body and in tombstone object header. Signed-off-by: Alex Vanin --- tombstone/types.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tombstone/types.proto b/tombstone/types.proto index 84b0d4c..4113cc5 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -11,7 +11,9 @@ import "refs/types.proto"; // purged from the NeoFS network. message Tombstone { // Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone - // creator depending on current NeoFS network settings. + // creator depending on current NeoFS network settings. Tombstone object + // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` + // attribute. Otherwise tombstone will be rejected by storage node. uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; // 16 byte UUID used to identify the split object hierarchy parts. Must be From 82f2b4cbc16485a15c2979c1c681d50c47e30062 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Sat, 20 Feb 2021 11:10:36 +0300 Subject: [PATCH 275/440] [#135] Clarify empty search filter behaviour It may be confusing for the user to get all types of objects as the result of a search with no filters set. Human users may expect to see only the objects intended for direct manipulation by humans. Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/object/service.proto b/object/service.proto index b975945..5bcb095 100644 --- a/object/service.proto +++ b/object/service.proto @@ -308,6 +308,11 @@ message SearchRequest { // Filter structure checks if object header field or attribute content // matches a value. // + // If no filters set, search request will return all objects of the + // container, including Regular object, Tombstones and Storage Group + // objects. Most human users expect to get only object they can directly + // work with. In that case the `$Object:ROOT` filter should be used. + // // By default `key` field refers to the corresponding object's `Attribute`. // Some Object's header fields can also be accessed by adding `$Object:` // prefix to the name. Here is the list of fields available via this prefix: From 3a2e01741a1f368e1aa796cd46c45fd231c5cf1f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 17 Feb 2021 19:05:06 +0300 Subject: [PATCH 276/440] [#127] netmap: Define NetworkInfo message Define `NetworkInfo` message which groups configuration and state values of NeoFS network. Signed-off-by: Leonard Lyubich --- netmap/types.proto | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 12a2c8d..f2d1818 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -216,3 +216,12 @@ message NodeInfo { // Carries state of the NeoFS node. State state = 4 [json_name = "state"]; } + +// Information about NeoFS network +message NetworkInfo { + // Number of the current epoch in the NeoFS network. + uint64 current_epoch = 1 [json_name = "currentEpoch"]; + + // Magic number of the sidechain of the NeoFS network. + uint64 magic_number = 2 [json_name = "magicNumber"]; +} From 1affb7e4589b57d8f5f122730c82295ee295993e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 17 Feb 2021 19:07:28 +0300 Subject: [PATCH 277/440] [#127] netmap: Define NetworkInfo rpc in NetmapService Define `NetworkInfo` rpc which can be used to read the recent NeoFS network information. Request body is empty, response body contains NetworkInfo message. Signed-off-by: Leonard Lyubich --- netmap/service.proto | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/netmap/service.proto b/netmap/service.proto index 329cbb9..9c2a8ed 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -20,6 +20,9 @@ service NetmapService { // present in `Network Map` to find out what API version can be used for // further communication. Can also be used to check if node is up and running. rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); + + // Read recent information about the NeoFS network. + rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); } // Get NodeInfo structure from the particular node directly @@ -62,3 +65,39 @@ message LocalNodeInfoResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +message NetworkInfoRequest { + // NetworkInfo request body is empty. + message Body { + } + // Body of the NetworkInfo request message + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +message NetworkInfoResponse { + // Information about the network. + message Body { + // NetworkInfo structure with recent information. + NetworkInfo network_info = 1; + } + // Body of the NetworkInfo response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} From 1594dc1f608d9d9e7d9f4e52f145a864850d61d2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 24 Feb 2021 14:46:25 +0300 Subject: [PATCH 278/440] [#127] netmap: Add doc comments Signed-off-by: Alex Vanin --- netmap/service.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netmap/service.proto b/netmap/service.proto index 9c2a8ed..f865b2f 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -66,6 +66,7 @@ message LocalNodeInfoResponse { neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } +// Get NetworkInfo structure with the network view from particular node. message NetworkInfoRequest { // NetworkInfo request body is empty. message Body { @@ -83,6 +84,8 @@ message NetworkInfoRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } +// Response with NetworkInfo structure including current epoch and +// sidechain magic number. message NetworkInfoResponse { // Information about the network. message Body { From f9e76434026f5fab5b75650bb1db25f26b36ae66 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 26 Feb 2021 10:53:47 +0300 Subject: [PATCH 279/440] =?UTF-8?q?Release=20v2.4.0=20-=20Ganghwado=20(?= =?UTF-8?q?=EA=B0=95=ED=99=94=EB=8F=84,=20=E6=B1=9F=E8=8F=AF=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added `netmap.NetworkInfo` RPC. Signed-off-by: Alex Vanin --- CHANGELOG.md | 18 +++++++++++ proto-docs/netmap.md | 70 +++++++++++++++++++++++++++++++++++++++++ proto-docs/object.md | 5 +++ proto-docs/tombstone.md | 2 +- 4 files changed, 94 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4cddb2..8ac3209 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.4.0] - 2021-02-26 - Ganghwado (강화도, 江華島) + +This release provides new RPC method to fetch network info from storage node. +By getting current epoch value, application might set up correct expiration +values in the objects. + +### Added + +- `netmap.NetworkInfo` request for getting node's network view. +- Release instructions. + +### Changed + +- Clarified processing of empty search query in `object.Search` RPC. +- Specified connection of tombstone expiration value with well-known + `__NEOFS__EXPIRATION_EPOCH` object attribute. + ## [2.3.0] - 2021-02-11 - Seonyudo (선유도, 仙遊島) This release brings support for nodes to exchange information about disk space @@ -313,3 +330,4 @@ Bump major release [2.2.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.1.1...v2.2.0 [2.2.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.0...v2.2.1 [2.3.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.1...v2.3.0 +[2.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.3.0...v2.4.0 diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index ab0cde6..6b2493c 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -12,12 +12,17 @@ - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) + - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) + - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) + - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) + - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) - [netmap/types.proto](#netmap/types.proto) - Messages - [Filter](#neo.fs.v2.netmap.Filter) + - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) @@ -47,6 +52,7 @@ NeoFS nodes. ``` rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); +rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); ``` @@ -61,6 +67,13 @@ further communication. Can also be used to check if node is up and running. | Name | Input | Output | | ---- | ----- | ------ | | LocalNodeInfo | [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) | [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) | +#### Method NetworkInfo + +Read recent information about the NeoFS network. + +| Name | Input | Output | +| ---- | ----- | ------ | +| NetworkInfo | [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) | [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) | @@ -108,6 +121,51 @@ Local Node Info, including API Version in use. | version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Latest NeoFS API version in use | | node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo structure with recent information from node itself | + + + +### Message NetworkInfoRequest +Get NetworkInfo structure with the network view from particular node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) | | Body of the NetworkInfo request message | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message NetworkInfoRequest.Body +NetworkInfo request body is empty. + + + + + +### Message NetworkInfoResponse +Response with NetworkInfo structure including current epoch and +sidechain magic number. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) | | Body of the NetworkInfo response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect response execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message NetworkInfoResponse.Body +Information about the network. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| network_info | [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) | | NetworkInfo structure with recent information. | + @@ -139,6 +197,18 @@ results, that will satisfy filter's conditions. | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of inner filters. Top level operation will be applied to the whole list. | + + +### Message NetworkInfo +Information about NeoFS network + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network. | +| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network. | + + ### Message NodeInfo diff --git a/proto-docs/object.md b/proto-docs/object.md index ab07679..355f7a4 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -554,6 +554,11 @@ Object Search request body Filter structure checks if object header field or attribute content matches a value. +If no filters set, search request will return all objects of the +container, including Regular object, Tombstones and Storage Group +objects. Most human users expect to get only object they can directly +work with. In that case the `$Object:ROOT` filter should be used. + By default `key` field refers to the corresponding object's `Attribute`. Some Object's header fields can also be accessed by adding `$Object:` prefix to the name. Here is the list of fields available via this prefix: diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index e43a212..1dca62a 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -31,7 +31,7 @@ purged from the NeoFS network. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone creator depending on current NeoFS network settings. | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone creator depending on current NeoFS network settings. Tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` attribute. Otherwise tombstone will be rejected by storage node. | | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | From 69f09c8030567dd4a5f1a9164dfa359c120860ab Mon Sep 17 00:00:00 2001 From: ZhangTao Date: Wed, 10 Mar 2021 18:54:06 +0800 Subject: [PATCH 280/440] change csharp namespace (#140) * change csharp namespace Signed-off-by: ZhangTao1596 * use Neo.FileStorage.API as base namespace Signed-off-by: ZhangTao1596 --- accounting/service.proto | 2 +- accounting/types.proto | 2 +- acl/types.proto | 2 +- audit/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- netmap/service.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- storagegroup/types.proto | 2 +- tombstone/types.proto | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index c0828f4..f648970 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; -option csharp_namespace = "NeoFS.API.v2.Accounting"; +option csharp_namespace = "Neo.FileStorage.API.Accounting"; import "accounting/types.proto"; import "refs/types.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index cc4fbf6..2776232 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; -option csharp_namespace = "NeoFS.API.v2.Accounting"; +option csharp_namespace = "Neo.FileStorage.API.Accounting"; // Standard floating point data type can't be used in NeoFS due to inexactness // of the result when doing lots of small number operations. To solve the lost diff --git a/acl/types.proto b/acl/types.proto index 3ca0a2e..f60b1d1 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.acl; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl"; -option csharp_namespace = "NeoFS.API.v2.Acl"; +option csharp_namespace = "Neo.FileStorage.API.Acl"; import "refs/types.proto"; diff --git a/audit/types.proto b/audit/types.proto index 551e8c2..11c5754 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.audit; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/audit/grpc;audit"; -option csharp_namespace = "NeoFS.API.v2.Audit"; +option csharp_namespace = "Neo.FileStorage.API.Audit"; import "refs/types.proto"; diff --git a/container/service.proto b/container/service.proto index 5e4295b..0eb28a7 100644 --- a/container/service.proto +++ b/container/service.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.container; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; -option csharp_namespace = "NeoFS.API.v2.Container"; +option csharp_namespace = "Neo.FileStorage.API.Container"; import "acl/types.proto"; import "container/types.proto"; diff --git a/container/types.proto b/container/types.proto index f412a28..4456c5a 100644 --- a/container/types.proto +++ b/container/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.container; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; -option csharp_namespace = "NeoFS.API.v2.Container"; +option csharp_namespace = "Neo.FileStorage.API.Container"; import "netmap/types.proto"; import "refs/types.proto"; diff --git a/netmap/service.proto b/netmap/service.proto index f865b2f..95e21a1 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; -option csharp_namespace = "NeoFS.API.v2.Netmap"; +option csharp_namespace = "Neo.FileStorage.API.Netmap"; import "netmap/types.proto"; import "refs/types.proto"; diff --git a/netmap/types.proto b/netmap/types.proto index f2d1818..3f558e1 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; -option csharp_namespace = "NeoFS.API.v2.Netmap"; +option csharp_namespace = "Neo.FileStorage.API.Netmap"; // Operations on filters enum Operation { diff --git a/object/service.proto b/object/service.proto index 5bcb095..8f94049 100644 --- a/object/service.proto +++ b/object/service.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.object; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; -option csharp_namespace = "NeoFS.API.v2.Object"; +option csharp_namespace = "Neo.FileStorage.API.Object"; import "object/types.proto"; import "refs/types.proto"; diff --git a/object/types.proto b/object/types.proto index 3b26c69..cb6fe91 100644 --- a/object/types.proto +++ b/object/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.object; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; -option csharp_namespace = "NeoFS.API.v2.Object"; +option csharp_namespace = "Neo.FileStorage.API.Object"; import "refs/types.proto"; import "session/types.proto"; diff --git a/refs/types.proto b/refs/types.proto index 84bab73..ef2141c 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.refs; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs"; -option csharp_namespace = "NeoFS.API.v2.Refs"; +option csharp_namespace = "Neo.FileStorage.API.Refs"; // Objects in NeoFS are addressed by their ContainerID and ObjectID. // diff --git a/session/service.proto b/session/service.proto index e3c0cc2..b959755 100644 --- a/session/service.proto +++ b/session/service.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.session; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; -option csharp_namespace = "NeoFS.API.v2.Session"; +option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; import "session/types.proto"; diff --git a/session/types.proto b/session/types.proto index b73d27a..74c1d36 100644 --- a/session/types.proto +++ b/session/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.session; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; -option csharp_namespace = "NeoFS.API.v2.Session"; +option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; import "acl/types.proto"; diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 0400f64..21663ff 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.storagegroup; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup/grpc;storagegroup"; -option csharp_namespace = "NeoFS.API.v2.StorageGroup"; +option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; import "refs/types.proto"; diff --git a/tombstone/types.proto b/tombstone/types.proto index 4113cc5..4ad3c06 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package neo.fs.v2.tombstone; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/tombstone/grpc;tombstone"; -option csharp_namespace = "NeoFS.API.v2.Tombstone"; +option csharp_namespace = "Neo.FileStorage.API.Tombstone"; import "refs/types.proto"; From e33f784e05f0df661f43e2b451301498a1f0b69f Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 12 Mar 2021 22:25:00 +0300 Subject: [PATCH 281/440] [#141] Add well-known attribute for content type Neo3 Oracles need a way to check object's MIME content type, as described in neo-project/neo-modules#555. The proposal was to add Content-Type as a well-known attribute. Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 2 ++ proto-docs/object.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/object/types.proto b/object/types.proto index cb6fe91..8169645 100644 --- a/object/types.proto +++ b/object/types.proto @@ -124,6 +124,8 @@ message Header { // File name to be associated with the object on saving // * Timestamp \ // User-defined local time of object creation in Unix Timestamp format + // * Content-Type \ + // MIME Content Type of object's payload // // For detailed description of each well-known attribute please see the // corresponding section in NeoFS Technical specification. diff --git a/proto-docs/object.md b/proto-docs/object.md index 355f7a4..ce3fb52 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -699,6 +699,8 @@ And some well-known attributes used by applications only: File name to be associated with the object on saving * Timestamp \ User-defined local time of object creation in Unix Timestamp format +* Content-Type \ + MIME Content Type of object's payload For detailed description of each well-known attribute please see the corresponding section in NeoFS Technical specification. From 10278f741a122db82dfc8cec009dbad23f7e7c6e Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 19 Mar 2021 15:46:17 +0300 Subject: [PATCH 282/440] =?UTF-8?q?Release=20v2.5.0=20-=20Jebudo=20(?= =?UTF-8?q?=EC=A0=9C=EB=B6=80=EB=8F=84,=20=E6=BF=9F=E6=89=B6=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alex Vanin --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ac3209..1186c57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.5.0] - 2021-03-19 - Jebudo (제부도, 濟扶島) + +This release contains changes and fixes for NEO3 testnet launch. + +### Added + +- Well-known object attribute `Content-Type`. + +### Changed + +- Namespace for C# has been changed to `Neo.FileStorage.API`. + ## [2.4.0] - 2021-02-26 - Ganghwado (강화도, 江華島) This release provides new RPC method to fetch network info from storage node. @@ -331,3 +343,4 @@ Bump major release [2.2.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.0...v2.2.1 [2.3.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.1...v2.3.0 [2.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.3.0...v2.4.0 +[2.5.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.4.0...v2.5.0 From b334bada3484856deb38bec1976ea51826b46138 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 24 Mar 2021 13:08:16 +0300 Subject: [PATCH 283/440] [#143] Add proto definitions of Reputation service Define `Trust` message structure. Define `ReputationService` service. Add `SendLocalTrust` RPC to `ReputationService`. Define structures of request and response messages. Signed-off-by: Leonard Lyubich --- reputation/service.proto | 61 ++++++++++++++++++++++++++++++++++++++++ reputation/types.proto | 18 ++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 reputation/service.proto create mode 100644 reputation/types.proto diff --git a/reputation/service.proto b/reputation/service.proto new file mode 100644 index 0000000..642fd10 --- /dev/null +++ b/reputation/service.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +package neo.fs.v2.reputation; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option csharp_namespace = "Neo.FileStorage.API.Reputation"; + +import "reputation/types.proto"; +import "session/types.proto"; + +// `ReputationService` provides mechanisms for exchanging +// trust values within NeoFS Reputation system . +service ReputationService { + // Sends local client trust to any peer from NeoFS network. + rpc SendLocalTrust (SendLocalTrustRequest) returns (SendLocalTrustResponse); +} + +// Request to send local trust. +message SendLocalTrustRequest { + // Request body structure. + message Body { + // The number of the epoch in which the trust was assessed. + uint64 epoch = 1; + + // List of normalized local trust values of the client to the NeoFS peers. + // The value is calculated according to EigenTrust++ algorithm + // and must be in the range [0;1]. + repeated Trust trusts = 2; + } + + // Body of the request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Response to request to send local trust. +message SendLocalTrustResponse { + // Response body structure. + message Body { + } + + // Body of the response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} diff --git a/reputation/types.proto b/reputation/types.proto new file mode 100644 index 0000000..87690d6 --- /dev/null +++ b/reputation/types.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package neo.fs.v2.reputation; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option csharp_namespace = "Neo.FileStorage.API.Reputation"; + +// Trust value to NeoFS network peer. +message Trust { + // Identifier of the trusted peer. + // + // For storage nodes, it is the node's public key + // fixed in the network map. + bytes peer = 1 [json_name = "peer"]; + + // Trust value. + double value = 2 [json_name = "value"]; +} From f4974b0e44150fdf0e472d8896e2341f0e3aaf64 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 1 Apr 2021 18:34:30 +0300 Subject: [PATCH 284/440] [#143] reputation: Add SendIntermediateResult RPC Add `SendIntermediateResult` RPC to `ReputationService`. Define structures of request and response messages. Signed-off-by: Leonard Lyubich --- reputation/service.proto | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/reputation/service.proto b/reputation/service.proto index 642fd10..45363ae 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -13,6 +13,10 @@ import "session/types.proto"; service ReputationService { // Sends local client trust to any peer from NeoFS network. rpc SendLocalTrust (SendLocalTrustRequest) returns (SendLocalTrustResponse); + + // Sends the intermediate result of the iterative algorithm + // for calculating the global reputation of the node. + rpc SendIntermediateResult (SendIntermediateResultRequest) returns (SendIntermediateResultResponse); } // Request to send local trust. @@ -59,3 +63,46 @@ message SendLocalTrustResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +// Request to send intermediate global trust. +message SendIntermediateResultRequest { + // Request body structure. + message Body { + // Sequence number of the iteration. + uint32 iteration = 1; + + // Current global trust value computed at the specified iteration. + Trust trust = 2; + } + + // Body of the request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Response to request to send intermediate global trust. +message SendIntermediateResultResponse { + // Response body structure. + message Body { + } + + // Body of the response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} From 5bf79d3dbf65ba7c993144b3599895c567d3620a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 2 Apr 2021 10:56:01 +0300 Subject: [PATCH 285/440] [#143] reputation: Add dedicated type for peer ID Define `PeerID` message. Change `Trust.peer` field type to `PeerID`. Signed-off-by: Leonard Lyubich --- reputation/types.proto | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/reputation/types.proto b/reputation/types.proto index 87690d6..5939537 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -5,13 +5,28 @@ package neo.fs.v2.reputation; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; +// NeoFS unique peer identifier. +// +// `PeerID` is a 33 byte long compressed public key of the node +// stored in network map. +// +// String presentation is +// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. +// +// JSON value will be the data encoded as a string using standard base64 +// encoding with paddings. Either +// [standard](https://tools.ietf.org/html/rfc4648#section-4) or +// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +// with/without paddings are accepted. +message PeerID { + // Peer identifier in a binary format. + bytes value = 1 [json_name = "value"]; +} + // Trust value to NeoFS network peer. message Trust { // Identifier of the trusted peer. - // - // For storage nodes, it is the node's public key - // fixed in the network map. - bytes peer = 1 [json_name = "peer"]; + PeerID peer = 1 [json_name = "peer"]; // Trust value. double value = 2 [json_name = "value"]; From 3b78785e57bc4486f85446b357acd0657947d3f9 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 2 Apr 2021 11:00:53 +0300 Subject: [PATCH 286/440] [#143] reputation: Define global trust message structure Signed-off-by: Leonard Lyubich --- reputation/types.proto | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/reputation/types.proto b/reputation/types.proto index 5939537..36d6147 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -5,6 +5,8 @@ package neo.fs.v2.reputation; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; +import "refs/types.proto"; + // NeoFS unique peer identifier. // // `PeerID` is a 33 byte long compressed public key of the node @@ -31,3 +33,21 @@ message Trust { // Trust value. double value = 2 [json_name = "value"]; } + +// Global trust value to NeoFS network peer. +message GlobalTrust { + // Message body structure. + message Body { + // Node manager ID. + PeerID manager = 1 [json_name = "manager"]; + + // Global trust value. + Trust trust = 2 [json_name = "trust"]; + } + + // Message body. + Body body = 1 [json_name = "body"]; + + // Signature of the binary `body` field by the manager. + refs.Signature signature = 2 [json_name = "signature"]; +} From 453beb8c342e25043eb8cf7bc3a1f2b063784dea Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 2 Apr 2021 13:08:37 +0300 Subject: [PATCH 287/440] [#143] reputation: Add version field to GlobalTrust message Add `version` field as a first field of `GlobalTrust` message. This field will allow you to quickly extract the version of the message from the binary representation. Additionally fix `signature` field's package format. Signed-off-by: Leonard Lyubich --- reputation/types.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reputation/types.proto b/reputation/types.proto index 36d6147..4f614d1 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -36,6 +36,10 @@ message Trust { // Global trust value to NeoFS network peer. message GlobalTrust { + // Message format version. Effectively the version of API library used to create + // the message. + neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + // Message body structure. message Body { // Node manager ID. @@ -46,8 +50,8 @@ message GlobalTrust { } // Message body. - Body body = 1 [json_name = "body"]; + Body body = 2 [json_name = "body"]; // Signature of the binary `body` field by the manager. - refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 3 [json_name = "signature"]; } From 6d572e78ff64752285883c01c7f9a9768bc6e273 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 9 Apr 2021 10:49:20 +0300 Subject: [PATCH 288/440] [#143] reputation: Define peer-to-peer trust message Signed-off-by: Leonard Lyubich --- reputation/types.proto | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reputation/types.proto b/reputation/types.proto index 4f614d1..253f803 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -34,6 +34,15 @@ message Trust { double value = 2 [json_name = "value"]; } +// Trust value of a peer to a peer. +message PeerToPeerTrust { + // Identifier of the trusting peer. + PeerID trusting_peer = 1 [json_name = "trustingPeer"]; + + // Trust value. + Trust trust = 2 [json_name = "trust"]; +} + // Global trust value to NeoFS network peer. message GlobalTrust { // Message format version. Effectively the version of API library used to create From 028f9e8c1aaa966cc34efc2688d880efc1e5b925 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 9 Apr 2021 10:53:45 +0300 Subject: [PATCH 289/440] [#143] reputation: Change SendIntermediateResultRequest.Body.trust type Change `trust` field type of `SendIntermediateResultRequest.Body` message to `PeerToPeerTrust` since `SendIntermediateResult` call transfers the node's directed trust to the node. Signed-off-by: Leonard Lyubich --- reputation/service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reputation/service.proto b/reputation/service.proto index 45363ae..563ed39 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -72,7 +72,7 @@ message SendIntermediateResultRequest { uint32 iteration = 1; // Current global trust value computed at the specified iteration. - Trust trust = 2; + PeerToPeerTrust trust = 2; } // Body of the request message. From b50b951dd0e376e34ec9ed20c0741812a07fc18f Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 21 Apr 2021 18:57:30 +0300 Subject: [PATCH 290/440] [#149] reputation: Change SendIntermediateResultRequest.Body Add `epoch` field to the `SendIntermediateResultRequest.Body` message. Signed-off-by: Pavel Karpy --- reputation/service.proto | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reputation/service.proto b/reputation/service.proto index 563ed39..7c52716 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -68,11 +68,14 @@ message SendLocalTrustResponse { message SendIntermediateResultRequest { // Request body structure. message Body { + // The number of the epoch in which the iteration was executed. + uint64 epoch = 1; + // Sequence number of the iteration. - uint32 iteration = 1; + uint32 iteration = 2; // Current global trust value computed at the specified iteration. - PeerToPeerTrust trust = 2; + PeerToPeerTrust trust = 3; } // Body of the request message. From 37e13c5475e10802f5323edebe105b2aeb684fb8 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 6 May 2021 19:50:20 +0300 Subject: [PATCH 291/440] reputation: Rename and reformat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rename: - SendLocalTrust → AnnounceLocalTrust - SendIntermediateResult → AnnounceIntermediateResult Those methods don't expect to Send anything, but to further announce the trust information from the node. * Change PeerID to explicitly use public key as a node identifier * Minor comments reformat Signed-off-by: Stanislav Bogatyrev --- reputation/service.proto | 59 ++++++++++++++++++++++------------------ reputation/types.proto | 31 ++++++++++----------- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/reputation/service.proto b/reputation/service.proto index 7c52716..9dcf2a5 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -8,27 +8,30 @@ option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "reputation/types.proto"; import "session/types.proto"; -// `ReputationService` provides mechanisms for exchanging -// trust values within NeoFS Reputation system . +// `ReputationService` provides mechanisms for exchanging trust values with +// other NeoFS nodes. Nodes rate each other's reputation based on how good they +// process requests and set a trust level based on that rating. The trust +// information is passed to the next nodes to check and aggregate unless the +// final result is recorded. service ReputationService { - // Sends local client trust to any peer from NeoFS network. - rpc SendLocalTrust (SendLocalTrustRequest) returns (SendLocalTrustResponse); + // Announce local client trust information to any node in NeoFS network. + rpc AnnounceLocalTrust (AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); - // Sends the intermediate result of the iterative algorithm - // for calculating the global reputation of the node. - rpc SendIntermediateResult (SendIntermediateResultRequest) returns (SendIntermediateResultResponse); + // Announces the intermediate result of the iterative algorithm for + // calculating the global reputation of the node in NeoFS network. + rpc AnnounceIntermediateResult (AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse); } -// Request to send local trust. -message SendLocalTrustRequest { - // Request body structure. +// Announce node's local trust information. +message AnnounceLocalTrustRequest { + // Announce node's local trust information. message Body { - // The number of the epoch in which the trust was assessed. + // Trust assessment Epoch number uint64 epoch = 1; - // List of normalized local trust values of the client to the NeoFS peers. - // The value is calculated according to EigenTrust++ algorithm - // and must be in the range [0;1]. + // List of normalized local trust values to other NeoFS nodes. The value + // is calculated according to EigenTrust++ algorithm and must be a + // floating point number in the [0;1] range. repeated Trust trusts = 2; } @@ -45,9 +48,11 @@ message SendLocalTrustRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Response to request to send local trust. -message SendLocalTrustResponse { - // Response body structure. +// Node's local trust information announce response. +message AnnounceLocalTrustResponse { + // Response to the node's local trust information announce has an empty body + // because the trust exchange operation is asynchronous. If Trust information + // will not pass sanity checks it is silently ignored. message Body { } @@ -64,17 +69,17 @@ message SendLocalTrustResponse { neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Request to send intermediate global trust. -message SendIntermediateResultRequest { - // Request body structure. +// Announce intermediate global trust information. +message AnnounceIntermediateResultRequest { + // Announce intermediate global trust information. message Body { - // The number of the epoch in which the iteration was executed. + // Iteration execution Epoch number uint64 epoch = 1; - // Sequence number of the iteration. + // Iteration sequence number uint32 iteration = 2; - // Current global trust value computed at the specified iteration. + // Current global trust value calculated at the specified iteration PeerToPeerTrust trust = 3; } @@ -91,9 +96,11 @@ message SendIntermediateResultRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Response to request to send intermediate global trust. -message SendIntermediateResultResponse { - // Response body structure. +// Intermediate global trust information announce response. +message AnnounceIntermediateResultResponse { + // Response to the node's intermediate global trust information announce has + // an empty body because the trust exchange operation is asynchronous. If + // Trust information will not pass sanity checks it is silently ignored. message Body { } diff --git a/reputation/types.proto b/reputation/types.proto index 253f803..bed5508 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -7,10 +7,8 @@ option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "refs/types.proto"; -// NeoFS unique peer identifier. -// -// `PeerID` is a 33 byte long compressed public key of the node -// stored in network map. +// NeoFS unique peer identifier is 33 byte long compressed public key of the +// node, the same as the one stored in the network map. // // String presentation is // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. @@ -21,44 +19,43 @@ import "refs/types.proto"; // [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding // with/without paddings are accepted. message PeerID { - // Peer identifier in a binary format. - bytes value = 1 [json_name = "value"]; + // Peer node's public key + bytes public_key = 1 [json_name = "publicKey"]; } -// Trust value to NeoFS network peer. +// Trust level to a NeoFS network peer. message Trust { - // Identifier of the trusted peer. + // Identifier of the trusted peer PeerID peer = 1 [json_name = "peer"]; - // Trust value. + // Trust level in [0:1] range double value = 2 [json_name = "value"]; } -// Trust value of a peer to a peer. +// Trust level of a peer to a peer. message PeerToPeerTrust { - // Identifier of the trusting peer. + // Identifier of the trusting peer PeerID trusting_peer = 1 [json_name = "trustingPeer"]; - // Trust value. + // Trust level Trust trust = 2 [json_name = "trust"]; } -// Global trust value to NeoFS network peer. +// Global trust level to NeoFS node. message GlobalTrust { // Message format version. Effectively the version of API library used to create // the message. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; - // Message body structure. message Body { - // Node manager ID. + // Node manager ID PeerID manager = 1 [json_name = "manager"]; - // Global trust value. + // Global trust level Trust trust = 2 [json_name = "trust"]; } - // Message body. + // Message body Body body = 2 [json_name = "body"]; // Signature of the binary `body` field by the manager. From 99177c290659b83c1b83138b061270862af41298 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 7 May 2021 11:56:33 +0300 Subject: [PATCH 292/440] docs: Generate docs for reputation package Signed-off-by: Alex Vanin --- proto-docs/reputation.md | 279 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 proto-docs/reputation.md diff --git a/proto-docs/reputation.md b/proto-docs/reputation.md new file mode 100644 index 0000000..12a9d57 --- /dev/null +++ b/proto-docs/reputation.md @@ -0,0 +1,279 @@ +# Protocol Documentation + + +## Table of Contents + +- [reputation/service.proto](#reputation/service.proto) + - Services + - [ReputationService](#neo.fs.v2.reputation.ReputationService) + + - Messages + - [AnnounceIntermediateResultRequest](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest) + - [AnnounceIntermediateResultRequest.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body) + - [AnnounceIntermediateResultResponse](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse) + - [AnnounceIntermediateResultResponse.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body) + - [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) + - [AnnounceLocalTrustRequest.Body](#neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body) + - [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) + - [AnnounceLocalTrustResponse.Body](#neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body) + + +- [reputation/types.proto](#reputation/types.proto) + + - Messages + - [GlobalTrust](#neo.fs.v2.reputation.GlobalTrust) + - [GlobalTrust.Body](#neo.fs.v2.reputation.GlobalTrust.Body) + - [PeerID](#neo.fs.v2.reputation.PeerID) + - [PeerToPeerTrust](#neo.fs.v2.reputation.PeerToPeerTrust) + - [Trust](#neo.fs.v2.reputation.Trust) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## reputation/service.proto + + + + + + +### Service "neo.fs.v2.reputation.ReputationService" +`ReputationService` provides mechanisms for exchanging trust values with +other NeoFS nodes. Nodes rate each other's reputation based on how good they +process requests and set a trust level based on that rating. The trust +information is passed to the next nodes to check and aggregate unless the +final result is recorded. + +``` +rpc AnnounceLocalTrust(AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); +rpc AnnounceIntermediateResult(AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse); + +``` + +#### Method AnnounceLocalTrust + +Announce local client trust information to any node in NeoFS network. + +| Name | Input | Output | +| ---- | ----- | ------ | +| AnnounceLocalTrust | [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) | [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) | +#### Method AnnounceIntermediateResult + +Announces the intermediate result of the iterative algorithm for +calculating the global reputation of the node in NeoFS network. + +| Name | Input | Output | +| ---- | ----- | ------ | +| AnnounceIntermediateResult | [AnnounceIntermediateResultRequest](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest) | [AnnounceIntermediateResultResponse](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse) | + + + + + +### Message AnnounceIntermediateResultRequest +Announce intermediate global trust information. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceIntermediateResultRequest.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body) | | Body of the request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceIntermediateResultRequest.Body +Announce intermediate global trust information. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| epoch | [uint64](#uint64) | | Iteration execution Epoch number | +| iteration | [uint32](#uint32) | | Iteration sequence number | +| trust | [PeerToPeerTrust](#neo.fs.v2.reputation.PeerToPeerTrust) | | Current global trust value calculated at the specified iteration | + + + + +### Message AnnounceIntermediateResultResponse +Intermediate global trust information announce response. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceIntermediateResultResponse.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body) | | Body of the response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceIntermediateResultResponse.Body +Response to the node's intermediate global trust information announce has +an empty body because the trust exchange operation is asynchronous. If +Trust information will not pass sanity checks it is silently ignored. + + + + + +### Message AnnounceLocalTrustRequest +Announce node's local trust information. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceLocalTrustRequest.Body](#neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body) | | Body of the request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceLocalTrustRequest.Body +Announce node's local trust information. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| epoch | [uint64](#uint64) | | Trust assessment Epoch number | +| trusts | [Trust](#neo.fs.v2.reputation.Trust) | repeated | List of normalized local trust values to other NeoFS nodes. The value is calculated according to EigenTrust++ algorithm and must be a floating point number in the [0;1] range. | + + + + +### Message AnnounceLocalTrustResponse +Node's local trust information announce response. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AnnounceLocalTrustResponse.Body](#neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body) | | Body of the response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AnnounceLocalTrustResponse.Body +Response to the node's local trust information announce has an empty body +because the trust exchange operation is asynchronous. If Trust information +will not pass sanity checks it is silently ignored. + + + + + + + + + +

Top

+ +## reputation/types.proto + + + + + + + +### Message GlobalTrust +Global trust level to NeoFS node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Message format version. Effectively the version of API library used to create the message. | +| body | [GlobalTrust.Body](#neo.fs.v2.reputation.GlobalTrust.Body) | | Message body | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of the binary `body` field by the manager. | + + + + +### Message GlobalTrust.Body +Message body structure. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| manager | [PeerID](#neo.fs.v2.reputation.PeerID) | | Node manager ID | +| trust | [Trust](#neo.fs.v2.reputation.Trust) | | Global trust level | + + + + +### Message PeerID +NeoFS unique peer identifier is 33 byte long compressed public key of the +node, the same as the one stored in the network map. + +String presentation is +[base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. + +JSON value will be the data encoded as a string using standard base64 +encoding with paddings. Either +[standard](https://tools.ietf.org/html/rfc4648#section-4) or +[URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding +with/without paddings are accepted. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| public_key | [bytes](#bytes) | | Peer node's public key | + + + + +### Message PeerToPeerTrust +Trust level of a peer to a peer. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| trusting_peer | [PeerID](#neo.fs.v2.reputation.PeerID) | | Identifier of the trusting peer | +| trust | [Trust](#neo.fs.v2.reputation.Trust) | | Trust level | + + + + +### Message Trust +Trust level to a NeoFS network peer. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| peer | [PeerID](#neo.fs.v2.reputation.PeerID) | | Identifier of the trusted peer | +| value | [double](#double) | | Trust level in [0:1] range | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From a425e55d99771dd9a3814cf312c904c19a024122 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 7 May 2021 12:10:31 +0300 Subject: [PATCH 293/440] Release v2.6.0 - Daecheongdo Signed-off-by: Alex Vanin --- CHANGELOG.md | 7 +++++++ CREDITS.md | 1 + 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1186c57..0a1eae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [2.6.0] - 2021-05-07 - Daecheongdo (대청도, 大靑島) + +### Added + +- Reputation package with reputation service and corresponding type definitions. + ## [2.5.0] - 2021-03-19 - Jebudo (제부도, 濟扶島) This release contains changes and fixes for NEO3 testnet launch. @@ -344,3 +350,4 @@ Bump major release [2.3.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.2.1...v2.3.0 [2.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.3.0...v2.4.0 [2.5.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.4.0...v2.5.0 +[2.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.5.0...v2.6.0 diff --git a/CREDITS.md b/CREDITS.md index 6d45ff2..f786376 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -18,6 +18,7 @@ In alphabetical order: In chronological order: - Pavel Korotkov +- Pavel Karpy # Special Thanks From dbd5ed1978497f11bf002e9d958905032bf1a5ba Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 May 2021 14:12:03 +0300 Subject: [PATCH 294/440] [#156] session: Define structure of container session context Define `session.ContainerSessionContext` message with context information of container service RPCs. Signed-off-by: Leonard Lyubich --- session/types.proto | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/session/types.proto b/session/types.proto index 74c1d36..e4871bf 100644 --- a/session/types.proto +++ b/session/types.proto @@ -43,6 +43,34 @@ message ObjectSessionContext { neo.fs.v2.refs.Address address = 2 [json_name = "address"]; } +// Context information for Session Tokens related to ContainerService requests. +message ContainerSessionContext { + // Container request verbs + enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; + + // Refers to container.Put RPC call + PUT = 1; + + // Refers to container.Delete RPC call + DELETE = 2; + + // Refers to container.SetExtendedACL RPC call + SETEACL = 3; + } + // Type of request for which the token is issued + Verb verb = 1 [json_name = "verb"]; + + // Spreads the action to all owner containers. + // If set, container_id field is ignored. + bool wildcard = 2 [json_name = "wildcard"]; + + // Particular container to which the action applies. + // Ignored if wildcard flag is set. + refs.ContainerID container_id = 3 [json_name = "containerID"]; +} + // NeoFS Session Token. message SessionToken { // Session Token body From 77c4b55100f6d700ed9e9f9c059fd9b67ca13d9a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 May 2021 14:14:22 +0300 Subject: [PATCH 295/440] [#156] session: Add ContainerServiceContext to SessionToken.Body oneof Extend `session.SessionToken.Body.context` oneof with `container` field of type `ContainerServiceContext`. This field is going to be used for RPCs of `container.ContainerService`. Signed-off-by: Leonard Lyubich --- session/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/session/types.proto b/session/types.proto index e4871bf..884d487 100644 --- a/session/types.proto +++ b/session/types.proto @@ -102,6 +102,9 @@ message SessionToken { oneof context { // ObjectService session context ObjectSessionContext object = 5 [json_name = "object"]; + + // ContainerService session context + ContainerSessionContext container = 6 [json_name = "container"]; } } // Session Token contains the proof of trust between peers to be attached in From 4b3794cbb952c5d41395d11e172e5b3b9fe51a3e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 May 2021 14:20:26 +0300 Subject: [PATCH 296/440] [#157] container: Add session token to GetExtendedACLResponse body Extended ACL can be set within a session. The presence of a session token in the GET response body allows you to reflect this fact. Add `session_token` field of `session.SessionToken` type to `container.GetExtendedACLResponse.Body` message. Signed-off-by: Leonard Lyubich --- container/service.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/container/service.proto b/container/service.proto index 0eb28a7..3b088b6 100644 --- a/container/service.proto +++ b/container/service.proto @@ -298,6 +298,9 @@ message GetExtendedACLResponse { // Signature of stable-marshalled Extended ACL according to RFC-6979 neo.fs.v2.refs.Signature signature = 2; + + // Session token if Extended ACL was set within a session + neo.fs.v2.session.SessionToken session_token = 3; } // Body of get extended acl response message. Body body = 1; From 81d6c731477755d674e9e25ac1969988304c1ebb Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 May 2021 14:21:22 +0300 Subject: [PATCH 297/440] [#157] container: Add session token to GetResponse body Container can be created within a session. The presence of a session token in the GET response body allows you to reflect this fact. Add `session_token` field of `session.SessionToken` type to `container.GetResponse.Body` message. Signed-off-by: Leonard Lyubich --- container/service.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container/service.proto b/container/service.proto index 3b088b6..9a23258 100644 --- a/container/service.proto +++ b/container/service.proto @@ -167,6 +167,12 @@ message GetResponse { message Body { // Requested container structure Container container = 1; + + // Signature of a stable-marshalled container according to RFC-6979 + neo.fs.v2.refs.Signature signature = 2; + + // Session token if the container was created within a session + neo.fs.v2.session.SessionToken session_token = 3; } // Body of container get response message. Body body = 1; From 52992d715034411b83403a021f1c24a826ecff84 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 3 Jun 2021 15:34:19 +0300 Subject: [PATCH 298/440] Re-generate docs for release Signed-off-by: Leonard Lyubich --- proto-docs/container.md | 3 +++ proto-docs/session.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/proto-docs/container.md b/proto-docs/container.md index 6c7d9dd..41d6521 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -294,6 +294,7 @@ container creation. | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL requested, if available | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979 | +| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if Extended ACL was set within a session | @@ -343,6 +344,8 @@ was already verified on container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Requested container structure | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979 | +| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if the container was created within a session | diff --git a/proto-docs/session.md b/proto-docs/session.md index f2324f4..ee4798c 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -17,6 +17,7 @@ - [session/types.proto](#session/types.proto) - Messages + - [ContainerSessionContext](#neo.fs.v2.session.ContainerSessionContext) - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) - [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) - [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) @@ -127,6 +128,19 @@ Session creation response body + + +### Message ContainerSessionContext +Context information for Session Tokens related to ContainerService requests. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| verb | [ContainerSessionContext.Verb](#neo.fs.v2.session.ContainerSessionContext.Verb) | | Type of request for which the token is issued | +| wildcard | [bool](#bool) | | Spreads the action to all owner containers. If set, container_id field is ignored. | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Particular container to which the action applies. Ignored if wildcard flag is set. | + + ### Message ObjectSessionContext @@ -225,6 +239,7 @@ Session Token body | lifetime | [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) | | Lifetime of the session | | session_key | [bytes](#bytes) | | Public key used in session | | object | [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) | | ObjectService session context | +| container | [ContainerSessionContext](#neo.fs.v2.session.ContainerSessionContext) | | ContainerService session context | @@ -272,6 +287,20 @@ affect system behaviour: + + +### ContainerSessionContext.Verb +Container request verbs + +| Name | Number | Description | +| ---- | ------ | ----------- | +| VERB_UNSPECIFIED | 0 | Unknown verb | +| PUT | 1 | Refers to container.Put RPC call | +| DELETE | 2 | Refers to container.Delete RPC call | +| SETEACL | 3 | Refers to container.SetExtendedACL RPC call | + + + ### ObjectSessionContext.Verb From 030c59ccbae04d9717c40e6562f8a6de2f729d4e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 3 Jun 2021 15:52:56 +0300 Subject: [PATCH 299/440] Update changelog for v2.7.0 release Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1eae6..80e7b64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [2.7.0] - 2021-06-03 - Seongmodo (석모도, 席毛島) + +Container service sessions. + +### Added + +#### Session + +- `ContainerSessionContext` message. +- `ContainerSessionContext` value of `context` oneof to `SessionToken.Body` message. + +#### Container + +##### Get + +- `session_token` field of type `session.SessionToken` to `GetResponse.Body` message. +- `signature` field of type `refs.Signature` to `GetResponse.Body` message. + +##### GetExtendedACL + +- `session_token` field of type `session.SessionToken` to `GetExtendedACLResponse.Body` message. + ## [2.6.0] - 2021-05-07 - Daecheongdo (대청도, 大靑島) ### Added @@ -351,3 +373,4 @@ Bump major release [2.4.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.3.0...v2.4.0 [2.5.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.4.0...v2.5.0 [2.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.5.0...v2.6.0 +[2.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.6.0...v2.7.0 From 6846e300e78895044645236c28e8e46c249e49d0 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 23 Jun 2021 14:53:21 +0300 Subject: [PATCH 300/440] [#160] netmap: Provide the ability to announce multiple addresses Make `address` field of `netmap.NodeInfo` message repeated (with corresponding renaming). Signed-off-by: Leonard Lyubich --- netmap/types.proto | 2 +- proto-docs/netmap.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index 3f558e1..49ed573 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -127,7 +127,7 @@ message NodeInfo { bytes public_key = 1 [json_name = "publicKey"]; // Ways to connect to a node - string address = 2 [json_name = "address"]; + repeated string addresses = 2 [json_name = "addresses"]; // Administrator-defined Attributes of the NeoFS Storage Node. // diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 6b2493c..a983bbd 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -218,7 +218,7 @@ NeoFS node description | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format. | -| address | [string](#string) | | Ways to connect to a node | +| addresses | [string](#string) | repeated | Ways to connect to a node | | attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. | | state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node. | From 7f67c378a74adc0f9d47b6c604822e95c79d1f5c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 25 Jun 2021 19:00:37 +0300 Subject: [PATCH 301/440] Update changelog for v2.8.0 release Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80e7b64..16e8fea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [2.8.0] - 2021-06-25 - Muuido (무의도, 舞衣島) + +Storage nodes with a group of network endpoints. + +### Changed + +- `address` field of `netmap.NodeInfo` message became `repeated`. + ## [2.7.0] - 2021-06-03 - Seongmodo (석모도, 席毛島) Container service sessions. @@ -374,3 +382,4 @@ Bump major release [2.5.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.4.0...v2.5.0 [2.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.5.0...v2.6.0 [2.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.6.0...v2.7.0 +[2.8.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.7.0...v2.8.0 From 2536e5a97b55556fdd4f5db9253c2e14cc9fb75a Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 16 Aug 2021 12:02:07 +0300 Subject: [PATCH 302/440] [#167] netmap: Add attribute escaping description Signed-off-by: Pavel Karpy --- netmap/types.proto | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 49ed573..a068938 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -134,6 +134,17 @@ message NodeInfo { // `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 // string. Value can't be empty. // + // Attributes can be constructed into a chain of attributes: any attribute can + // have a parent attribute and a child attribute (except the first and the last + // one). A string representation of the chain of attributes in NeoFS Storage + // Node configuration uses ":" and "/" symbols, e.g.: + // + // `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` + // + // Therefore the string attribute representation in the Node configuration must + // use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's + // key or value. + // // Node's attributes are mostly used during Storage Policy evaluation to // calculate object's placement and find a set of nodes satisfying policy // requirements. There are some "well-known" node attributes common to all the From 3cc5852f3f15e0a3218f17f19d2e363dfb41e479 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 16 Aug 2021 12:02:46 +0300 Subject: [PATCH 303/440] [#167] doc: Generate doc for attribute escaping description Signed-off-by: Pavel Karpy --- proto-docs/netmap.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index a983bbd..0a75dc4 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -231,6 +231,17 @@ Administrator-defined Attributes of the NeoFS Storage Node. `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 string. Value can't be empty. +Attributes can be constructed into a chain of attributes: any attribute can +have a parent attribute and a child attribute (except the first and the last +one). A string representation of the chain of attributes in NeoFS Storage +Node configuration uses ":" and "/" symbols, e.g.: + + `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` + +Therefore the string attribute representation in the Node configuration must +use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's +key or value. + Node's attributes are mostly used during Storage Policy evaluation to calculate object's placement and find a set of nodes satisfying policy requirements. There are some "well-known" node attributes common to all the From 0040853986b0dcd0dce01cb5a2c84ae218fbd310 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 16 Aug 2021 10:25:06 +0300 Subject: [PATCH 304/440] [#166] object: Define COMMON_PREFIX value in MatchType enum Signed-off-by: Pavel Karpy --- object/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/types.proto b/object/types.proto index 8169645..302019f 100644 --- a/object/types.proto +++ b/object/types.proto @@ -41,6 +41,9 @@ enum MatchType { // Lack of key NOT_PRESENT = 3; + + // String prefix match + COMMON_PREFIX = 4; } // Short header fields From e6226c27d2c9ca7252b7c77b51a240a073e17a57 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 16 Aug 2021 12:08:35 +0300 Subject: [PATCH 305/440] [#166] doc: Generate doc COMMON_PREFIX matchtype Signed-off-by: Pavel Karpy --- proto-docs/object.md | 1 + 1 file changed, 1 insertion(+) diff --git a/proto-docs/object.md b/proto-docs/object.md index ce3fb52..c488901 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -793,6 +793,7 @@ Type of match expression | STRING_EQUAL | 1 | Full string match | | STRING_NOT_EQUAL | 2 | Full string mismatch | | NOT_PRESENT | 3 | Lack of key | +| COMMON_PREFIX | 4 | String prefix match | From 260db6b3dffba3a51fe4291c72f263ce8ac45d64 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 16 Aug 2021 17:45:23 +0300 Subject: [PATCH 306/440] =?UTF-8?q?Release=20v2.9.0=20-=20Anmyeondo=20(?= =?UTF-8?q?=EC=95=88=EB=A9=B4=EB=8F=84,=20=E5=AE=89=E7=9C=A0=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Karpy --- CHANGELOG.md | 10 ++++++++++ doc/release_instructions.md | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16e8fea..c42ccdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.9.0] - 2021-08-16 - Anmyeondo (안면도, 安眠島) + +Support "common prefix" attribute match operation to simplify filesystem +directory tree-like structures implementation in NeoFS protocol gateways. + +### Added +- `COMMON_PREFIX` object attribute match type. +- Storage node's attribute escape symbol description. + ## [2.8.0] - 2021-06-25 - Muuido (무의도, 舞衣島) Storage nodes with a group of network endpoints. @@ -383,3 +392,4 @@ Bump major release [2.6.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.5.0...v2.6.0 [2.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.6.0...v2.7.0 [2.8.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.7.0...v2.8.0 +[2.9.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.8.0...v2.9.0 diff --git a/doc/release_instructions.md b/doc/release_instructions.md index 33d7ab2..0fc841a 100644 --- a/doc/release_instructions.md +++ b/doc/release_instructions.md @@ -23,6 +23,16 @@ this release. Then add sections with what was added, changed and removed, describing each change briefly with a reference to GitHub issues, where available. +## Release commit + +Release commit summary should follow the template: + +`Release v - (, )`, e.g.: + +``` +Release v2.9.0 - Anmyeondo (안면도, 安眠島) +``` + ## Tag the release Use `vX.Y.Z` tag following the semantic versioning standard. For pre-release From 233f777d0c7f3c6e0d4b203d54c1d8726054cf4a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Wed, 25 Aug 2021 13:21:10 +0300 Subject: [PATCH 307/440] [#84] Fix string presentation object type enum Default string presentations of enums in protobuf are the same as definitions. In our case it is going to be UPPER_SNAKE_CASE string constants. Default presentation is easier to maintain. Signed-off-by: Alex Vanin --- object/types.proto | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/object/types.proto b/object/types.proto index 302019f..f3893bd 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,14 +9,13 @@ import "refs/types.proto"; import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE` and `STORAGEGROUP` payload is limited by maximal object +// hence `TOMBSTONE` and `STORAGE_GROUP` payload is limited by maximal object // size. // -// String presentation of object type is PascalCased `ObjectType` enumeration -// item name: -// * Regular -// * Tombstone -// * StorageGroup +// String presentation of object type is the same as definition: +// * REGULAR +// * TOMBSTONE +// * STORAGE_GROUP enum ObjectType { // Just a normal object REGULAR = 0; From ece09a18129e16fd45cbf196094b7eb769e4ecf2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 26 Aug 2021 16:40:34 +0300 Subject: [PATCH 308/440] Release v2.9.1 Signed-off-by: Alex Vanin --- CHANGELOG.md | 6 ++++++ proto-docs/object.md | 11 +++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c42ccdd..3513989 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.9.1] - 2021-08-26 + +### Changed +- String presentation of object type enum. + ## [2.9.0] - 2021-08-16 - Anmyeondo (안면도, 安眠島) Support "common prefix" attribute match operation to simplify filesystem @@ -393,3 +398,4 @@ Bump major release [2.7.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.6.0...v2.7.0 [2.8.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.7.0...v2.8.0 [2.9.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.8.0...v2.9.0 +[2.9.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.0...v2.9.1 diff --git a/proto-docs/object.md b/proto-docs/object.md index c488901..2226eb8 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -801,14 +801,13 @@ Type of match expression ### ObjectType Type of the object payload content. Only `REGULAR` type objects can be split, -hence `TOMBSTONE` and `STORAGEGROUP` payload is limited by maximal object +hence `TOMBSTONE` and `STORAGE_GROUP` payload is limited by maximal object size. -String presentation of object type is PascalCased `ObjectType` enumeration -item name: -* Regular -* Tombstone -* StorageGroup +String presentation of object type is the same as definition: +* REGULAR +* TOMBSTONE +* STORAGE_GROUP | Name | Number | Description | | ---- | ------ | ----------- | From 3878a09e42c86f38be91fe0de9585ce1a4ae84ea Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 8 Sep 2021 16:47:54 +0300 Subject: [PATCH 309/440] [#173] acl: add filter for service headers Service headers are ignored by NeoFS nodes but can be used to save access-related information by services built on top of NeoFS. Signed-off-by: Evgenii Stratonikov --- acl/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/acl/types.proto b/acl/types.proto index f60b1d1..8e38d58 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -86,6 +86,10 @@ enum HeaderType { // Filter object headers OBJECT = 2; + + // Filter service headers. These are not processed by NeoFS nodes and + // exist for service use only. + SERVICE = 3; } // Describes a single eACL rule. From 2e23cb388844b32c52144fad569b2d84838fe46e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 15 Sep 2021 11:15:50 +0300 Subject: [PATCH 310/440] [#172] netmap: Add ms_per_block field to NetworkInfo message Signed-off-by: Leonard Lyubich --- netmap/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index a068938..2f86421 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -235,4 +235,7 @@ message NetworkInfo { // Magic number of the sidechain of the NeoFS network. uint64 magic_number = 2 [json_name = "magicNumber"]; + + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. + int64 ms_per_block = 3 [json_name = "msPerBlock"]; } From e16866843bb9ce52f85c7d9a23fc22f5750e1c76 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 15 Sep 2021 11:23:44 +0300 Subject: [PATCH 311/440] [#172] netmap: Define NetworkConfig message Define `netmap.NetworkConfig` message which represents structure of NeoFS network config stored in Netmap contract. Signed-off-by: Leonard Lyubich --- netmap/types.proto | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 2f86421..900b835 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -228,6 +228,20 @@ message NodeInfo { State state = 4 [json_name = "state"]; } +// NeoFS network configuration +message NetworkConfig { + // Single configuration parameter. + message Parameter { + // Parameter key. UTF-8 encoded string. + bytes key = 1 [json_name = "key"]; + + // Parameter value. + bytes value = 2 [json_name = "value"]; + } + // List of parameter values. + repeated Parameter parameters = 1 [json_name = "parameters"]; +} + // Information about NeoFS network message NetworkInfo { // Number of the current epoch in the NeoFS network. From 6ad083c73134d73d7b613deda28a0c1dce7e72e1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 15 Sep 2021 11:25:06 +0300 Subject: [PATCH 312/440] [#172] netmap: Add network configuration to NetworkInfo message Signed-off-by: Leonard Lyubich --- netmap/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 900b835..7183add 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -252,4 +252,7 @@ message NetworkInfo { // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. int64 ms_per_block = 3 [json_name = "msPerBlock"]; + + // NeoFS network configuration. + NetworkConfig network_config = 4 [json_name = "networkConfig"]; } From 8bf84cdc652fd1fb762af4ebc8ca1c20a9a540f0 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 7 Oct 2021 17:38:30 +0300 Subject: [PATCH 313/440] [#177] container: Define well-known container attributes for NNS integration Signed-off-by: Alex Vanin --- container/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container/types.proto b/container/types.proto index 4456c5a..fdb0667 100644 --- a/container/types.proto +++ b/container/types.proto @@ -40,6 +40,12 @@ message Container { // * __NEOFS__SUBNET \ // String ID of container's storage subnet. Container can be attached to // only one subnet. + // * __NEOFS__NAME \ + // String of human-friendly container name registered as the domain in + // NNS contract. + // * __NEOFS__ZONE \ + // String of zone for `__NEOFS__NAME`. Used as TLD of domain name in NNS + // contract. If zone is not specified, use default zone: `container`. // // And some well-known attributes used by applications only: // From 115d8c801d15fd14ffa07a6b12d2ee6efbb0abee Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 14 Oct 2021 18:27:45 +0300 Subject: [PATCH 314/440] =?UTF-8?q?Release=20v2.10.0=20-=20Udo=20(?= =?UTF-8?q?=EC=9A=B0=EB=8F=84,=20=E7=89=9B=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alex Vanin --- CHANGELOG.md | 11 +++++++++++ proto-docs/acl.md | 1 + proto-docs/container.md | 6 ++++++ proto-docs/netmap.md | 27 +++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3513989..e791cc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## [2.10.0] - 2021-10-14 - Udo (우도, 牛島) + +NNS integration, detailed network info and ACL rules for non-native services. + +### Added +- ACL header type for services (#173) +- Side chain block duration and NeoFS network config fields in `NetworkInfo` + message (#172) +- Well-known container attributes for NNS integration (#177) + ## [2.9.1] - 2021-08-26 ### Changed @@ -399,3 +409,4 @@ Bump major release [2.8.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.7.0...v2.8.0 [2.9.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.8.0...v2.9.0 [2.9.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.0...v2.9.1 +[2.10.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.1...v2.10.0 diff --git a/proto-docs/acl.md b/proto-docs/acl.md index dc2375a..943dae4 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -188,6 +188,7 @@ Enumeration of possible sources of Headers to apply filters. | HEADER_UNSPECIFIED | 0 | Unspecified header, default value. | | REQUEST | 1 | Filter request headers | | OBJECT | 2 | Filter object headers | +| SERVICE | 3 | Filter service headers. These are not processed by NeoFS nodes and exist for service use only. | diff --git a/proto-docs/container.md b/proto-docs/container.md index 41d6521..dd99da0 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -549,6 +549,12 @@ There are some "well-known" attributes affecting system behaviour: * __NEOFS__SUBNET \ String ID of container's storage subnet. Container can be attached to only one subnet. +* __NEOFS__NAME \ + String of human-friendly container name registered as the domain in + NNS contract. +* __NEOFS__ZONE \ + String of zone for `__NEOFS__NAME`. Used as TLD of domain name in NNS + contract. If zone is not specified, use default zone: `container`. And some well-known attributes used by applications only: diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 0a75dc4..8b8b6d3 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -22,6 +22,8 @@ - Messages - [Filter](#neo.fs.v2.netmap.Filter) + - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) + - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) @@ -197,6 +199,29 @@ results, that will satisfy filter's conditions. | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of inner filters. Top level operation will be applied to the whole list. | + + +### Message NetworkConfig +NeoFS network configuration + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| parameters | [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) | repeated | List of parameter values. | + + + + +### Message NetworkConfig.Parameter +Single configuration parameter. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string. | +| value | [bytes](#bytes) | | Parameter value. | + + ### Message NetworkInfo @@ -207,6 +232,8 @@ Information about NeoFS network | ----- | ---- | ----- | ----------- | | current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network. | | magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network. | +| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. | +| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | NeoFS network configuration. | From f61eaf5353775429aaecca55cff693ea4e20e60f Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 4 Oct 2021 14:29:21 +0300 Subject: [PATCH 315/440] [#150] Define status return message Signed-off-by: Leonard Lyubich --- status/types.proto | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 status/types.proto diff --git a/status/types.proto b/status/types.proto new file mode 100644 index 0000000..f8b6f8d --- /dev/null +++ b/status/types.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package neo.fs.v2.status; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/status/grpc;status"; +option csharp_namespace = "Neo.FileStorage.API.Status"; + +message Status { + uint32 code = 1; + + string message = 2; + + message Detail { + uint32 id = 1; + + bytes value = 2; + } + + repeated Detail details = 3; +} From ba1179a22b5562f135c6f59f512258ab644cb6ca Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 4 Oct 2021 14:34:43 +0300 Subject: [PATCH 316/440] [#150] session: Add Status field to ResponseMetaHeader Signed-off-by: Leonard Lyubich --- session/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/session/types.proto b/session/types.proto index 884d487..7612128 100644 --- a/session/types.proto +++ b/session/types.proto @@ -7,6 +7,7 @@ option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; import "acl/types.proto"; +import "status/types.proto"; // Context information for Session Tokens related to ObjectService requests message ObjectSessionContext { @@ -184,6 +185,8 @@ message ResponseMetaHeader { // `ResponseMetaHeader` of the origin request ResponseMetaHeader origin = 5 [json_name = "origin"]; + + neo.fs.v2.status.Status status = 6 [json_name = "status"]; } // Verification info for request signed by all intermediate nodes. From fd0366bbf51af045ebd70975bd6ce272b9a5d9f4 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 4 Oct 2021 14:40:56 +0300 Subject: [PATCH 317/440] [#150] status: Define enumeration of success status codes Signed-off-by: Leonard Lyubich --- status/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/status/types.proto b/status/types.proto index f8b6f8d..0c302e5 100644 --- a/status/types.proto +++ b/status/types.proto @@ -18,3 +18,7 @@ message Status { repeated Detail details = 3; } + +enum Success { + OK = 0; +} From c90745135033a8b989b2402e82d9cbcb1e065d72 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 4 Oct 2021 14:41:31 +0300 Subject: [PATCH 318/440] [#150] status: Define enumeration of the codes for common failures Signed-off-by: Leonard Lyubich --- status/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/status/types.proto b/status/types.proto index 0c302e5..a340d34 100644 --- a/status/types.proto +++ b/status/types.proto @@ -22,3 +22,7 @@ message Status { enum Success { OK = 0; } + +enum CommonFail { + INTERNAL = 0; +} From f55f83fb24e3888089bc1e51fba38ec38375360a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 4 Oct 2021 14:55:23 +0300 Subject: [PATCH 319/440] [#150] status: Define enum of sequence numbers of the failure sections Signed-off-by: Leonard Lyubich --- status/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/status/types.proto b/status/types.proto index a340d34..c9c467d 100644 --- a/status/types.proto +++ b/status/types.proto @@ -26,3 +26,9 @@ enum Success { enum CommonFail { INTERNAL = 0; } + +enum Section { + SECTION_SUCCESS = 0; + + SECTION_FAILURE_COMMON = 1; +} From 7ea5a1d2f143c2760bf87aee1773484fdb67729c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 12 Nov 2021 19:10:39 +0300 Subject: [PATCH 320/440] [#150] *: Write status-related docs Signed-off-by: Leonard Lyubich --- accounting/service.proto | 5 ++ container/service.proto | 35 ++++++++++ netmap/service.proto | 10 +++ object/service.proto | 35 ++++++++++ proto-docs/accounting.md | 5 ++ proto-docs/container.md | 35 ++++++++++ proto-docs/netmap.md | 10 +++ proto-docs/object.md | 35 ++++++++++ proto-docs/reputation.md | 10 +++ proto-docs/session.md | 6 ++ proto-docs/status.md | 138 +++++++++++++++++++++++++++++++++++++++ reputation/service.proto | 10 +++ session/service.proto | 5 ++ session/types.proto | 1 + status/types.proto | 61 +++++++++++++++-- 15 files changed, 395 insertions(+), 6 deletions(-) create mode 100644 proto-docs/status.md diff --git a/accounting/service.proto b/accounting/service.proto index f648970..d2f99df 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -16,6 +16,11 @@ import "session/types.proto"; // accounts are possible, if both use the same token type. service AccountingService { // Returns the amount of funds in GAS token for the requested NeoFS account. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // balance has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc Balance (BalanceRequest) returns (BalanceResponse); } diff --git a/container/service.proto b/container/service.proto index 9a23258..41c88eb 100644 --- a/container/service.proto +++ b/container/service.proto @@ -19,30 +19,65 @@ service ContainerService { // response immediately. After a new block is issued in sidechain, request is // verified by Inner Ring nodes. After one more block in sidechain, container // is added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // request to save the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). rpc Put(PutRequest) returns (PutResponse); // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is // verified by Inner Ring nodes. After one more block in sidechain, container // is added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // request to remove the container has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns container structure from `Container` smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // container has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc Get(GetRequest) returns (GetResponse); // Returns all owner's containers from 'Container` smart contract' storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response // immediately. After one more block in sidechain, Extended ACL changes are // added into smart contract storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // request to save container eACL has been sent to the sidechain; + // - Common failures (SECTION_FAILURE_COMMON). rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); // Returns Extended ACL table and signature from `Container` smart contract // storage. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // container eACL has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announce container used space values for P2P synchronization. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // estimation of used space has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); } diff --git a/netmap/service.proto b/netmap/service.proto index 95e21a1..5a573c6 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -19,9 +19,19 @@ service NetmapService { // want to get recent information directly, or to talk to the node not yet // present in `Network Map` to find out what API version can be used for // further communication. Can also be used to check if node is up and running. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the server has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); // Read recent information about the NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network state has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); } diff --git a/object/service.proto b/object/service.proto index 8f94049..c608e98 100644 --- a/object/service.proto +++ b/object/service.proto @@ -18,6 +18,11 @@ service ObjectService { // messages, except the first one, carry payload chunks. Requested object can // be restored by concatenation of object message payload and all chunks // keeping receiving order. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // object has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message @@ -26,32 +31,62 @@ service ObjectService { // session package). Chunk messages are considered by server as a part of an // object payload. All messages, except first one, SHOULD be payload chunks. // Chunk messages SHOULD be sent in direct order of fragmentation. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON). rpc Put(stream PutRequest) returns (PutResponse); // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // object has been successfully marked to be removed from the container; + // - Common failures (SECTION_FAILURE_COMMON). rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only // the very minimal information would be returned instead. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // object header has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // objects have been successfully selected; + // - Common failures (SECTION_FAILURE_COMMON). rpc Search(SearchRequest) returns (stream SearchResponse); // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be // restored by concatenation of all received payload chunks keeping receiving // order. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // data range of the object payload has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, // length) tuples. Hashes order in response corresponds to ranges order in // request. Note that hash is calculated for XORed data. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // data range of the object payload has been successfully hashed; + // - Common failures (SECTION_FAILURE_COMMON). rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 8050a1a..6d36189 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -50,6 +50,11 @@ rpc Balance(BalanceRequest) returns (BalanceResponse); Returns the amount of funds in GAS token for the requested NeoFS account. +Statuses: +- **OK** (0, SECTION_SUCCESS): +balance has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Balance | [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) | [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) | diff --git a/proto-docs/container.md b/proto-docs/container.md index dd99da0..13bd4db 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -84,6 +84,11 @@ response immediately. After a new block is issued in sidechain, request is verified by Inner Ring nodes. After one more block in sidechain, container is added into smart contract storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +request to save the container has been sent to the sidechain; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Put | [PutRequest](#neo.fs.v2.container.PutRequest) | [PutResponse](#neo.fs.v2.container.PutResponse) | @@ -94,6 +99,11 @@ response immediately. After a new block is issued in sidechain, request is verified by Inner Ring nodes. After one more block in sidechain, container is added into smart contract storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +request to remove the container has been sent to the sidechain; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Delete | [DeleteRequest](#neo.fs.v2.container.DeleteRequest) | [DeleteResponse](#neo.fs.v2.container.DeleteResponse) | @@ -101,6 +111,11 @@ is added into smart contract storage. Returns container structure from `Container` smart contract storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +container has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Get | [GetRequest](#neo.fs.v2.container.GetRequest) | [GetResponse](#neo.fs.v2.container.GetResponse) | @@ -108,6 +123,11 @@ Returns container structure from `Container` smart contract storage. Returns all owner's containers from 'Container` smart contract' storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +container list has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) | @@ -117,6 +137,11 @@ Invokes 'SetEACL' method of 'Container` smart contract and returns response immediately. After one more block in sidechain, Extended ACL changes are added into smart contract storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +request to save container eACL has been sent to the sidechain; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | SetExtendedACL | [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) | [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) | @@ -125,6 +150,11 @@ added into smart contract storage. Returns Extended ACL table and signature from `Container` smart contract storage. +Statuses: +- **OK** (0, SECTION_SUCCESS): +container eACL has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) | @@ -132,6 +162,11 @@ storage. Announce container used space values for P2P synchronization. +Statuses: +- **OK** (0, SECTION_SUCCESS): +estimation of used space has been successfully announced; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | AnnounceUsedSpace | [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) | [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) | diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 8b8b6d3..6a9ceb7 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -66,6 +66,11 @@ want to get recent information directly, or to talk to the node not yet present in `Network Map` to find out what API version can be used for further communication. Can also be used to check if node is up and running. +Statuses: +- **OK** (0, SECTION_SUCCESS): +information about the server has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | LocalNodeInfo | [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) | [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) | @@ -73,6 +78,11 @@ further communication. Can also be used to check if node is up and running. Read recent information about the NeoFS network. +Statuses: +- **OK** (0, SECTION_SUCCESS): +information about the current network state has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | NetworkInfo | [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) | [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) | diff --git a/proto-docs/object.md b/proto-docs/object.md index 2226eb8..a860242 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -92,6 +92,11 @@ messages, except the first one, carry payload chunks. Requested object can be restored by concatenation of object message payload and all chunks keeping receiving order. +Statuses: +- **OK** (0, SECTION_SUCCESS): +object has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Get | [GetRequest](#neo.fs.v2.object.GetRequest) | [GetResponse](#neo.fs.v2.object.GetResponse) | @@ -104,6 +109,11 @@ session package). Chunk messages are considered by server as a part of an object payload. All messages, except first one, SHOULD be payload chunks. Chunk messages SHOULD be sent in direct order of fragmentation. +Statuses: +- **OK** (0, SECTION_SUCCESS): +object has been successfully saved in the container; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Put | [PutRequest](#neo.fs.v2.object.PutRequest) | [PutResponse](#neo.fs.v2.object.PutResponse) | @@ -112,6 +122,11 @@ Chunk messages SHOULD be sent in direct order of fragmentation. Delete the object from a container. There is no immediate removal guarantee. Object will be marked for removal and deleted eventually. +Statuses: +- **OK** (0, SECTION_SUCCESS): +object has been successfully marked to be removed from the container; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Delete | [DeleteRequest](#neo.fs.v2.object.DeleteRequest) | [DeleteResponse](#neo.fs.v2.object.DeleteResponse) | @@ -121,6 +136,11 @@ Returns the object Headers without data payload. By default full header is returned. If `main_only` request field is set, the short header with only the very minimal information would be returned instead. +Statuses: +- **OK** (0, SECTION_SUCCESS): +object header has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Head | [HeadRequest](#neo.fs.v2.object.HeadRequest) | [HeadResponse](#neo.fs.v2.object.HeadResponse) | @@ -130,6 +150,11 @@ Search objects in container. Search query allows to match by Object Header's filed values. Please see the corresponding NeoFS Technical Specification section for more details. +Statuses: +- **OK** (0, SECTION_SUCCESS): +objects have been successfully selected; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Search | [SearchRequest](#neo.fs.v2.object.SearchRequest) | [SearchResponse](#neo.fs.v2.object.SearchResponse) | @@ -140,6 +165,11 @@ Like in `Get` method, the response uses gRPC stream. Requested range can be restored by concatenation of all received payload chunks keeping receiving order. +Statuses: +- **OK** (0, SECTION_SUCCESS): +data range of the object payload has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | GetRange | [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) | [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) | @@ -150,6 +180,11 @@ applying XOR operation with the provided `salt`. Ranges are set of (offset, length) tuples. Hashes order in response corresponds to ranges order in request. Note that hash is calculated for XORed data. +Statuses: +- **OK** (0, SECTION_SUCCESS): +data range of the object payload has been successfully hashed; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | GetRangeHash | [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) | [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) | diff --git a/proto-docs/reputation.md b/proto-docs/reputation.md index 12a9d57..3802c39 100644 --- a/proto-docs/reputation.md +++ b/proto-docs/reputation.md @@ -59,6 +59,11 @@ rpc AnnounceIntermediateResult(AnnounceIntermediateResultRequest) returns (Annou Announce local client trust information to any node in NeoFS network. +Statuses: +- **OK** (0, SECTION_SUCCESS): +local trust has been successfully announced; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | AnnounceLocalTrust | [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) | [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) | @@ -67,6 +72,11 @@ Announce local client trust information to any node in NeoFS network. Announces the intermediate result of the iterative algorithm for calculating the global reputation of the node in NeoFS network. +Statuses: +- **OK** (0, SECTION_SUCCESS): +intermediate trust estimation has been successfully announced; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | AnnounceIntermediateResult | [AnnounceIntermediateResultRequest](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest) | [AnnounceIntermediateResultResponse](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse) | diff --git a/proto-docs/session.md b/proto-docs/session.md index ee4798c..7fb532a 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -58,6 +58,11 @@ rpc Create(CreateRequest) returns (CreateResponse); Opens a new session between two peers. +Statuses: +- **OK** (0, SECTION_SUCCESS): +session has been successfully opened; +- Common failures (SECTION_FAILURE_COMMON). + | Name | Input | Output | | ---- | ----- | ------ | | Create | [CreateRequest](#neo.fs.v2.session.CreateRequest) | [CreateResponse](#neo.fs.v2.session.CreateResponse) | @@ -198,6 +203,7 @@ Information about the response | ttl | [uint32](#uint32) | | Maximum number of intermediate nodes in the request route | | x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Response X-Headers | | origin | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | `ResponseMetaHeader` of the origin request | +| status | [neo.fs.v2.status.Status](#neo.fs.v2.status.Status) | | Status return. | diff --git a/proto-docs/status.md b/proto-docs/status.md new file mode 100644 index 0000000..7df4ca0 --- /dev/null +++ b/proto-docs/status.md @@ -0,0 +1,138 @@ +# Protocol Documentation + + +## Table of Contents + +- [status/types.proto](#status/types.proto) + + - Messages + - [Status](#neo.fs.v2.status.Status) + - [Status.Detail](#neo.fs.v2.status.Status.Detail) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## status/types.proto + + + + + + + +### Message Status +Declares the general format of the status returns of the NeoFS RPC protocol. +Status is present in all response messages. Each RPC of NeoFS protocol +describes the possible outcomes and details of the operation. + +Each status is assigned a one-to-one numeric code. Any unique result of an +operation in NeoFS is unambiguously associated with the code value. + +Numerical set of codes is split into 1024-element sections. An enumeration +is defined for each section. Values can be referred to in the following ways: + +* numerical value ranging from 0 to 4,294,967,295 (global code); + +* values from enumeration (local code). The formula for the ratio of the + local code (`L`) of a defined section (`S`) to the global one (`G`): + `G = 1024 * S + L`. + +All outcomes are divided into successful and failed, which corresponds +to the success or failure of the operation. The definition of success +follows from the semantics of RPC and the description of its purpose. +The server must not attach code that is the opposite of outcome type. + +See the set of return codes in the description for calls. + +Each status can carry developer-facing error message. It should be human +readable text in English. The server should not transmit (and the client +should not expect) useful information in the message. Field `details` +should make the return more detailed. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| code | [uint32](#uint32) | | The status code. | +| message | [string](#string) | | Developer-facing error message. | +| details | [Status.Detail](#neo.fs.v2.status.Status.Detail) | repeated | Data detailing the outcome of the operation. Must be unique by ID. | + + + + +### Message Status.Detail +Return detail. It contains additional information that can be used to +analyze the response. Each code defines a set of details that can be +attached to a status. Client should not handle details that are not +covered by the code. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [uint32](#uint32) | | Detail ID. The identifier is required to determine the binary format of the detail and how to decode it. | +| value | [bytes](#bytes) | | Binary status detail. Must follow the format associated with ID. The possibility of missing a value must be explicitly allowed. | + + + + + + +### CommonFail +Section of failed statuses independent of the operation. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed.. If the server cannot match failed outcome to the code , it should use this code. | + + + + + +### Section +Section identifiers. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| SECTION_SUCCESS | 0 | Successful return codes. | +| SECTION_FAILURE_COMMON | 1 | Failure codes regardless of the operation. | + + + + + +### Success +Section of NeoFS successful return codes. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| OK | 0 | [**0**] Default success. Not detailed. If the server cannot match successful outcome to the code, it should use this code. | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/reputation/service.proto b/reputation/service.proto index 9dcf2a5..a556405 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -15,10 +15,20 @@ import "session/types.proto"; // final result is recorded. service ReputationService { // Announce local client trust information to any node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // local trust has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). rpc AnnounceLocalTrust (AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); // Announces the intermediate result of the iterative algorithm for // calculating the global reputation of the node in NeoFS network. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // intermediate trust estimation has been successfully announced; + // - Common failures (SECTION_FAILURE_COMMON). rpc AnnounceIntermediateResult (AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse); } diff --git a/session/service.proto b/session/service.proto index b959755..aff4959 100644 --- a/session/service.proto +++ b/session/service.proto @@ -14,6 +14,11 @@ import "session/types.proto"; // section of NeoFS Technical Specification for details. service SessionService { // Opens a new session between two peers. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // session has been successfully opened; + // - Common failures (SECTION_FAILURE_COMMON). rpc Create (CreateRequest) returns (CreateResponse); } diff --git a/session/types.proto b/session/types.proto index 7612128..256293d 100644 --- a/session/types.proto +++ b/session/types.proto @@ -186,6 +186,7 @@ message ResponseMetaHeader { // `ResponseMetaHeader` of the origin request ResponseMetaHeader origin = 5 [json_name = "origin"]; + // Status return neo.fs.v2.status.Status status = 6 [json_name = "status"]; } diff --git a/status/types.proto b/status/types.proto index c9c467d..dbf7e19 100644 --- a/status/types.proto +++ b/status/types.proto @@ -5,30 +5,79 @@ package neo.fs.v2.status; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/status/grpc;status"; option csharp_namespace = "Neo.FileStorage.API.Status"; +// Declares the general format of the status returns of the NeoFS RPC protocol. +// Status is present in all response messages. Each RPC of NeoFS protocol +// describes the possible outcomes and details of the operation. +// +// Each status is assigned a one-to-one numeric code. Any unique result of an +// operation in NeoFS is unambiguously associated with the code value. +// +// Numerical set of codes is split into 1024-element sections. An enumeration +// is defined for each section. Values can be referred to in the following ways: +// +// * numerical value ranging from 0 to 4,294,967,295 (global code); +// +// * values from enumeration (local code). The formula for the ratio of the +// local code (`L`) of a defined section (`S`) to the global one (`G`): +// `G = 1024 * S + L`. +// +// All outcomes are divided into successful and failed, which corresponds +// to the success or failure of the operation. The definition of success +// follows from the semantics of RPC and the description of its purpose. +// The server must not attach code that is the opposite of outcome type. +// +// See the set of return codes in the description for calls. +// +// Each status can carry developer-facing error message. It should be human +// readable text in English. The server should not transmit (and the client +// should not expect) useful information in the message. Field `details` +// should make the return more detailed. message Status { + // The status code uint32 code = 1; + // Developer-facing error message string message = 2; + // Return detail. It contains additional information that can be used to + // analyze the response. Each code defines a set of details that can be + // attached to a status. Client should not handle details that are not + // covered by the code. message Detail { + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. uint32 id = 1; + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. bytes value = 2; } + // Data detailing the outcome of the operation. Must be unique by ID. repeated Detail details = 3; } +// Section identifiers. +enum Section { + // Successful return codes. + SECTION_SUCCESS = 0; + + // Failure codes regardless of the operation. + SECTION_FAILURE_COMMON = 1; +} + +// Section of NeoFS successful return codes. enum Success { + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. OK = 0; } +// Section of failed statuses independent of the operation. enum CommonFail { + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. INTERNAL = 0; } - -enum Section { - SECTION_SUCCESS = 0; - - SECTION_FAILURE_COMMON = 1; -} From c6691c492450f996aef664a20842d1b1d24888bf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 17 Nov 2021 09:37:07 +0300 Subject: [PATCH 321/440] [#179] netmap: add subnet id to placement policy Signed-off-by: Evgenii Stratonikov --- netmap/types.proto | 6 ++++++ refs/types.proto | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 7183add..cacee4b 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -5,6 +5,8 @@ package neo.fs.v2.netmap; option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; +import "refs/types.proto"; + // Operations on filters enum Operation { // No Operation defined @@ -119,6 +121,10 @@ message PlacementPolicy { // List of named filters to reference in selectors repeated Filter filters = 4 [json_name = "filters"]; + + // Subnetwork ID to select nodes from. Zero subnet (default) represents + // all of the nodes which didn't explicitly opt out of membership. + refs.SubnetID subnet_id = 5 [json_name = "subnetId"]; } // NeoFS node description diff --git a/refs/types.proto b/refs/types.proto index ef2141c..9675026 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -77,6 +77,16 @@ message OwnerID { bytes value = 1 [json_name = "value"]; } +// NeoFS subnetwork identifier. +// +// String representation of a value is base-10 integer. +// +// JSON representation is an object containing single `value` number field. +message SubnetID { + // 4-byte integer subnetwork identifier. + fixed32 value = 1 [json_name = "value"]; +} + // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string From a05e6f9a5c74d304946320adc11ed51a3ef3544b Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 17 Nov 2021 15:08:28 +0300 Subject: [PATCH 322/440] [#183] subnet: Define subnet information message Signed-off-by: Pavel Karpy --- subnet/types.proto | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 subnet/types.proto diff --git a/subnet/types.proto b/subnet/types.proto new file mode 100644 index 0000000..aa69bba --- /dev/null +++ b/subnet/types.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package neo.fs.v2.subnet; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/subnet/grpc;subnet"; +option csharp_namespace = "Neo.FileStorage.API.Subnet"; + +import "refs/types.proto"; + +// NeoFS subnetwork description +message SubnetInfo { + // Unique subnet identifier. Missing ID is + // equivalent to zero (default subnetwork) ID. + neo.fs.v2.refs.SubnetID id = 1; + + // Identifier of the subnetwork owner + neo.fs.v2.refs.OwnerID owner = 2; +} From c11991aff19c3fce142421f96f24c6be10d96fcd Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 17 Nov 2021 23:54:32 +0300 Subject: [PATCH 323/440] [#183] doc: Regenerate docs Signed-off-by: Pavel Karpy --- proto-docs/netmap.md | 1 + proto-docs/refs.md | 16 ++++++++++++ proto-docs/session.md | 2 +- proto-docs/status.md | 6 ++--- proto-docs/subnet.md | 61 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 proto-docs/subnet.md diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 6a9ceb7..6bb58ed 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -352,6 +352,7 @@ storage policy definition languages. | container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset | | selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | +| subnet_id | [neo.fs.v2.refs.SubnetID](#neo.fs.v2.refs.SubnetID) | | Subnetwork ID to select nodes from. Zero subnet (default) represents all of the nodes which didn't explicitly opt out of membership. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index d423de5..e9e46d9 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -12,6 +12,7 @@ - [ObjectID](#neo.fs.v2.refs.ObjectID) - [OwnerID](#neo.fs.v2.refs.OwnerID) - [Signature](#neo.fs.v2.refs.Signature) + - [SubnetID](#neo.fs.v2.refs.SubnetID) - [Version](#neo.fs.v2.refs.Version) @@ -149,6 +150,21 @@ Signature of something in NeoFS. | sign | [bytes](#bytes) | | Signature | + + +### Message SubnetID +NeoFS subnetwork identifier. + +String representation of a value is base-10 integer. + +JSON representation is an object containing single `value` number field. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| value | [fixed32](#fixed32) | | 4-byte integer subnetwork identifier. | + + ### Message Version diff --git a/proto-docs/session.md b/proto-docs/session.md index 7fb532a..4e24e71 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -203,7 +203,7 @@ Information about the response | ttl | [uint32](#uint32) | | Maximum number of intermediate nodes in the request route | | x_headers | [XHeader](#neo.fs.v2.session.XHeader) | repeated | Response X-Headers | | origin | [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | `ResponseMetaHeader` of the origin request | -| status | [neo.fs.v2.status.Status](#neo.fs.v2.status.Status) | | Status return. | +| status | [neo.fs.v2.status.Status](#neo.fs.v2.status.Status) | | Status return | diff --git a/proto-docs/status.md b/proto-docs/status.md index 7df4ca0..c99e015 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -57,8 +57,8 @@ should make the return more detailed. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| code | [uint32](#uint32) | | The status code. | -| message | [string](#string) | | Developer-facing error message. | +| code | [uint32](#uint32) | | The status code | +| message | [string](#string) | | Developer-facing error message | | details | [Status.Detail](#neo.fs.v2.status.Status.Detail) | repeated | Data detailing the outcome of the operation. Must be unique by ID. | @@ -86,7 +86,7 @@ Section of failed statuses independent of the operation. | Name | Number | Description | | ---- | ------ | ----------- | -| INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed.. If the server cannot match failed outcome to the code , it should use this code. | +| INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed. If the server cannot match failed outcome to the code, it should use this code. | diff --git a/proto-docs/subnet.md b/proto-docs/subnet.md new file mode 100644 index 0000000..a766dc6 --- /dev/null +++ b/proto-docs/subnet.md @@ -0,0 +1,61 @@ +# Protocol Documentation + + +## Table of Contents + +- [subnet/types.proto](#subnet/types.proto) + + - Messages + - [SubnetInfo](#neo.fs.v2.subnet.SubnetInfo) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## subnet/types.proto + + + + + + + +### Message SubnetInfo +NeoFS subnetwork description + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [neo.fs.v2.refs.SubnetID](#neo.fs.v2.refs.SubnetID) | | Unique subnet identifier. Missing ID is equivalent to zero (default subnetwork) ID. | +| owner | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the subnetwork owner | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + From fbbbfccb8d0ccde71de00d54420c3b2cdbcb460e Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 18 Nov 2021 13:31:51 +0300 Subject: [PATCH 324/440] [#184] netmap: Sync style of the comments Signed-off-by: Pavel Karpy --- netmap/types.proto | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index cacee4b..a63696a 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -40,7 +40,7 @@ enum Operation { // Selector modifier shows how the node set will be formed. By default selector // just groups nodes into a bucket by attribute, selecting nodes only by their // hash distance. -enum Clause{ +enum Clause { // No modifier defined. Will select nodes from bucket randomly. CLAUSE_UNSPECIFIED = 0; @@ -129,7 +129,7 @@ message PlacementPolicy { // NeoFS node description message NodeInfo { - // Public key of the NeoFS node in a binary format. + // Public key of the NeoFS node in a binary format bytes public_key = 1 [json_name = "publicKey"]; // Ways to connect to a node @@ -202,10 +202,10 @@ message NodeInfo { // For detailed description of each well-known attribute please see the // corresponding section in NeoFS Technical specification. message Attribute { - // Key of the node attribute. + // Key of the node attribute string key = 1 [json_name = "key"]; - // Value of the node attribute. + // Value of the node attribute string value = 2 [json_name = "value"]; // Parent keys, if any. For example for `City` it could be `Region` and @@ -220,45 +220,45 @@ message NodeInfo { // Represents the enumeration of various states of the NeoFS node. enum State { - // Unknown state. + // Unknown state UNSPECIFIED = 0; - // Active state in the network. + // Active state in the network ONLINE = 1; - // Network unavailable state. + // Network unavailable state OFFLINE = 2; } - // Carries state of the NeoFS node. + // Carries state of the NeoFS node State state = 4 [json_name = "state"]; } // NeoFS network configuration message NetworkConfig { - // Single configuration parameter. + // Single configuration parameter message Parameter { - // Parameter key. UTF-8 encoded string. + // Parameter key. UTF-8 encoded string bytes key = 1 [json_name = "key"]; - // Parameter value. + // Parameter value bytes value = 2 [json_name = "value"]; } - // List of parameter values. + // List of parameter values repeated Parameter parameters = 1 [json_name = "parameters"]; } // Information about NeoFS network message NetworkInfo { - // Number of the current epoch in the NeoFS network. + // Number of the current epoch in the NeoFS network uint64 current_epoch = 1 [json_name = "currentEpoch"]; - // Magic number of the sidechain of the NeoFS network. + // Magic number of the sidechain of the NeoFS network uint64 magic_number = 2 [json_name = "magicNumber"]; - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network int64 ms_per_block = 3 [json_name = "msPerBlock"]; - // NeoFS network configuration. + // NeoFS network configuration NetworkConfig network_config = 4 [json_name = "networkConfig"]; } From b608e89bf48bef20222788d440e7baabef7b77c8 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 18 Nov 2021 14:08:31 +0300 Subject: [PATCH 325/440] [#184] netmap: Add subnetwork attribute to the `NodeInfo` Signed-off-by: Pavel Karpy --- netmap/types.proto | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index a63696a..2e8dc7c 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -164,9 +164,13 @@ message NodeInfo { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. - // * Subnet \ - // String ID of Node's storage subnet. There can be only one subnet served - // by the Storage Node. + // * __NEOFS__SUBNET_%s \ + // `True` or `False`. Defines if the node is included in the `%s` subnetwork + // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). + // A node can be included in more than one subnetwork and, therefore, can contain + // more than one subnet attribute. A missing attribute is equivalent to the + // presence of the attribute with `False` value (except default zero subnetwork + // (with `%s` == 0) for which missing attribute means inclusion in that network). // * UN-LOCODE \ // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) From 8de347883304148cc8ab40237fb209c975fc18b6 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 18 Nov 2021 14:08:52 +0300 Subject: [PATCH 326/440] [#184] doc: Regenerate docs Signed-off-by: Pavel Karpy --- proto-docs/netmap.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 6bb58ed..a74d41f 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -217,19 +217,19 @@ NeoFS network configuration | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| parameters | [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) | repeated | List of parameter values. | +| parameters | [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) | repeated | List of parameter values | ### Message NetworkConfig.Parameter -Single configuration parameter. +Single configuration parameter | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string. | -| value | [bytes](#bytes) | | Parameter value. | +| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string | +| value | [bytes](#bytes) | | Parameter value | @@ -240,10 +240,10 @@ Information about NeoFS network | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network. | -| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network. | -| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. | -| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | NeoFS network configuration. | +| current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network | +| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network | +| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the NeoFS network | +| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | NeoFS network configuration | @@ -254,10 +254,10 @@ NeoFS node description | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format. | +| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format | | addresses | [string](#string) | repeated | Ways to connect to a node | | attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. | -| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node. | +| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node | @@ -292,9 +292,13 @@ explicitly set: attributes it's a string presenting floating point number with comma or point delimiter for decimal part. In the Network Map it will be saved as 64-bit unsigned integer representing number of minimal token fractions. -* Subnet \ - String ID of Node's storage subnet. There can be only one subnet served - by the Storage Node. +* __NEOFS__SUBNET_%s \ + `True` or `False`. Defines if the node is included in the `%s` subnetwork + or not. `%s` must be an existing subnetwork's ID (non-negative integer number). + A node can be included in more than one subnetwork and, therefore, can contain + more than one subnet attribute. A missing attribute is equivalent to the + presence of the attribute with `False` value (except default zero subnetwork + (with `%s` == 0) for which missing attribute means inclusion in that network). * UN-LOCODE \ Node's geographic location in [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) @@ -333,8 +337,8 @@ corresponding section in NeoFS Technical specification. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Key of the node attribute. | -| value | [string](#string) | | Value of the node attribute. | +| key | [string](#string) | | Key of the node attribute | +| value | [string](#string) | | Value of the node attribute | | parents | [string](#string) | repeated | Parent keys, if any. For example for `City` it could be `Region` and `Country`. | @@ -409,9 +413,9 @@ Represents the enumeration of various states of the NeoFS node. | Name | Number | Description | | ---- | ------ | ----------- | -| UNSPECIFIED | 0 | Unknown state. | -| ONLINE | 1 | Active state in the network. | -| OFFLINE | 2 | Network unavailable state. | +| UNSPECIFIED | 0 | Unknown state | +| ONLINE | 1 | Active state in the network | +| OFFLINE | 2 | Network unavailable state | From 848b96ede0790a9438c14172fc7a0277ca871365 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 2 Dec 2021 13:09:21 +0300 Subject: [PATCH 327/440] Update changelog for release v2.11.0 Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e791cc7..a24a315 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) + +Subnets and status responses. + +### Added +- `Status` message structure (#150) +- `status` field of `Status` type to `ResponseMetaHeader` message (#150) +- `Subnet` message structure (#180) +- `subnet` field of `Subnet` type to `PlacementPolicy` message (#179) + +### Changed +- Subnet attributes in `NodeInfo` (#181) + ## [2.10.0] - 2021-10-14 - Udo (우도, 牛島) NNS integration, detailed network info and ACL rules for non-native services. @@ -410,3 +423,4 @@ Bump major release [2.9.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.8.0...v2.9.0 [2.9.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.0...v2.9.1 [2.10.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.1...v2.10.0 +[2.11.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.10.0...v2.11.0 From b1fca685a9631344875e53efab24c34f476d9752 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 10 Jan 2022 15:26:42 +0300 Subject: [PATCH 328/440] [#82] session: Add network magic to `RequestMetaHeader` To prevent theoretical cross-network replay attack, we need to have network magic in NeoFS requests. Add `magic_number` numeric field to `session.RequestMetaHeader` message. Signed-off-by: Leonard Lyubich --- session/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/session/types.proto b/session/types.proto index 256293d..4eff307 100644 --- a/session/types.proto +++ b/session/types.proto @@ -167,6 +167,10 @@ message RequestMetaHeader { // `RequestMetaHeader` of the origin request RequestMetaHeader origin = 7 [json_name = "origin"]; + + // NeoFS network magic. Must match the value for the network + // that the server belongs to. + uint64 magic_number = 8 [json_name = "magicNumber"]; } // Information about the response From d9d71ccd662dd9681f0fab51e647ea4864510225 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 10 Jan 2022 15:42:41 +0300 Subject: [PATCH 329/440] [#82] status: Add status code for wrong network magic After the recent update of NeoFS V2 protocol all requests must carry correct network magic. Add `WRONG_MAGIC_NUMBER` code to `CommonFail` section. Signed-off-by: Leonard Lyubich --- status/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/status/types.proto b/status/types.proto index dbf7e19..d2c7f45 100644 --- a/status/types.proto +++ b/status/types.proto @@ -80,4 +80,7 @@ enum CommonFail { // If the server cannot match failed outcome to the code, it should // use this code. INTERNAL = 0; + + // [**1025**] Wrong magic of the NeoFS network. Not detailed. + WRONG_MAGIC_NUMBER = 1; } From e09a560d5781718a4d1eb27c89435958610bc600 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 24 Jan 2022 14:19:42 +0300 Subject: [PATCH 330/440] [#187] status: Add detail with supported network magic Add detail for `WRONG_MAGIC_NUMBER` status code which carries the correct magic of the served network served. Clients will be able to fix incorrect magic and re-send the request. ID is 0, binary format is uint64 in big-endian. Signed-off-by: Leonard Lyubich --- status/types.proto | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/status/types.proto b/status/types.proto index d2c7f45..1c505d9 100644 --- a/status/types.proto +++ b/status/types.proto @@ -81,6 +81,9 @@ enum CommonFail { // use this code. INTERNAL = 0; - // [**1025**] Wrong magic of the NeoFS network. Not detailed. + // [**1025**] Wrong magic of the NeoFS network. + // Details: + // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit + // unsigned integer). WRONG_MAGIC_NUMBER = 1; } From f67442d769b7507ec97d7dae6502a489faa245f0 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 14 Feb 2022 19:29:51 +0300 Subject: [PATCH 331/440] [#195] object: Add notification well-known attributes Signed-off-by: Pavel Karpy --- object/types.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/object/types.proto b/object/types.proto index f3893bd..63bed78 100644 --- a/object/types.proto +++ b/object/types.proto @@ -117,6 +117,13 @@ message Header { // Marks smaller parts of a split bigger object // * __NEOFS__EXPIRATION_EPOCH \ // Tells GC to delete object after that epoch + // * __NEOFS__TICK_EPOCH \ + // Decimal number that defines what epoch must produce + // object notification with UTF-8 object address in a + // body (`0` value produces notification right after + // object put) + // * __NEOFS__TICK_TOPIC \ + // UTF-8 string topic ID that is used for object notification // // And some well-known attributes used by applications only: // From 184230511647a0c79642b93bdc326e0a48ae0f88 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 14 Feb 2022 19:31:20 +0300 Subject: [PATCH 332/440] [#195] doc: Regenerate documentation Signed-off-by: Pavel Karpy --- proto-docs/object.md | 7 +++++++ proto-docs/session.md | 1 + proto-docs/status.md | 1 + 3 files changed, 9 insertions(+) diff --git a/proto-docs/object.md b/proto-docs/object.md index a860242..fa33d43 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -725,6 +725,13 @@ that affect system behaviour: Marks smaller parts of a split bigger object * __NEOFS__EXPIRATION_EPOCH \ Tells GC to delete object after that epoch +* __NEOFS__TICK_EPOCH \ + Decimal number that defines what epoch must produce + object notification with UTF-8 object address in a + body (`0` value produces notification right after + object put) +* __NEOFS__TICK_TOPIC \ + UTF-8 string topic ID that is used for object notification And some well-known attributes used by applications only: diff --git a/proto-docs/session.md b/proto-docs/session.md index 4e24e71..683777b 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -174,6 +174,7 @@ request meta headers are folded in matryoshka style. | session_token | [SessionToken](#neo.fs.v2.session.SessionToken) | | Session token within which the request is sent | | bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | `BearerToken` with eACL overrides for the request | | origin | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | `RequestMetaHeader` of the origin request | +| magic_number | [uint64](#uint64) | | NeoFS network magic. Must match the value for the network that the server belongs to. | diff --git a/proto-docs/status.md b/proto-docs/status.md index c99e015..c29c289 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -87,6 +87,7 @@ Section of failed statuses independent of the operation. | Name | Number | Description | | ---- | ------ | ----------- | | INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed. If the server cannot match failed outcome to the code, it should use this code. | +| WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). | From 5f3fa3fdd8736b7a58d759614087084d52f1029b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Feb 2022 13:35:24 +0300 Subject: [PATCH 333/440] [#189] status: add Object section and ACL_DENIED code Signed-off-by: Evgenii Stratonikov --- status/types.proto | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/status/types.proto b/status/types.proto index 1c505d9..cc3f2b7 100644 --- a/status/types.proto +++ b/status/types.proto @@ -64,6 +64,9 @@ enum Section { // Failure codes regardless of the operation. SECTION_FAILURE_COMMON = 1; + + // Object service-specific errors. + SECTION_OBJECT = 2; } // Section of NeoFS successful return codes. @@ -87,3 +90,11 @@ enum CommonFail { // unsigned integer). WRONG_MAGIC_NUMBER = 1; } + +// Section of statuses for object-related operations. +enum Object { + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description. + ACCESS_DENIED = 0; +} \ No newline at end of file From 5f53a683d141d290b0de1e5d239d9dea05a3bcf6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Feb 2022 13:35:42 +0300 Subject: [PATCH 334/440] [#190] status: add Object.OBJECT_NOT_FOUND code `OBJECT_` prefix is needed because of possible conflicts with other `NOT_FOUND` codes declared in the same file. Signed-off-by: Evgenii Stratonikov --- status/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/status/types.proto b/status/types.proto index cc3f2b7..80aaf0f 100644 --- a/status/types.proto +++ b/status/types.proto @@ -97,4 +97,7 @@ enum Object { // Details: // - [**0**] Human-readable description. ACCESS_DENIED = 0; + // [**2049**] Object not found. + OBJECT_NOT_FOUND = 1; +} } \ No newline at end of file From 31b7b073c21e0170c9adafb8b3de0cfa21c5e536 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Feb 2022 13:36:32 +0300 Subject: [PATCH 335/440] [#190] status: add Container section and CONTAINER_NOT_FOUND code Signed-off-by: Evgenii Stratonikov --- status/types.proto | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/status/types.proto b/status/types.proto index 80aaf0f..c243d43 100644 --- a/status/types.proto +++ b/status/types.proto @@ -67,6 +67,9 @@ enum Section { // Object service-specific errors. SECTION_OBJECT = 2; + + // Container service-specific errors. + SECTION_CONTAINER = 3; } // Section of NeoFS successful return codes. @@ -100,4 +103,9 @@ enum Object { // [**2049**] Object not found. OBJECT_NOT_FOUND = 1; } + +// Section of statuses for container-related operations. +enum Container { + // [**3072**] Container not found. + CONTAINER_NOT_FOUND = 0; } \ No newline at end of file From 3a154760b5dcbd88a50e8df9982027d7a0309fcf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Feb 2022 13:39:38 +0300 Subject: [PATCH 336/440] [#191] status: add Session section and some status codes Signed-off-by: Evgenii Stratonikov --- status/types.proto | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/status/types.proto b/status/types.proto index c243d43..80b47aa 100644 --- a/status/types.proto +++ b/status/types.proto @@ -70,6 +70,9 @@ enum Section { // Container service-specific errors. SECTION_CONTAINER = 3; + + // Session service-specific errors. + SECTION_SESSION = 4; } // Section of NeoFS successful return codes. @@ -108,4 +111,12 @@ enum Object { enum Container { // [**3072**] Container not found. CONTAINER_NOT_FOUND = 0; -} \ No newline at end of file +} + +// Section of statuses for session-related operations. +enum Session { + // [**4096**] Token not found. + TOKEN_NOT_FOUND = 0; + // [**4097**] Token has expired. + TOKEN_EXPIRED = 1; +} From 35e9840de68de9553d1f1144b3bf93330bf62739 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 21 Feb 2022 15:36:08 +0300 Subject: [PATCH 337/440] [#192] docs: Generate documentation Signed-off-by: Evgenii Stratonikov --- proto-docs/status.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/proto-docs/status.md b/proto-docs/status.md index c29c289..de1b44b 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -91,6 +91,29 @@ Section of failed statuses independent of the operation. + + +### Container +Section of statuses for container-related operations. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| CONTAINER_NOT_FOUND | 0 | [**3072**] Container not found. | + + + + + +### Object +Section of statuses for object-related operations. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| ACCESS_DENIED | 0 | [**2048**] Access denied by ACL. Details: - [**0**] Human-readable description. | +| OBJECT_NOT_FOUND | 1 | [**2049**] Object not found. | + + + ### Section @@ -100,6 +123,21 @@ Section identifiers. | ---- | ------ | ----------- | | SECTION_SUCCESS | 0 | Successful return codes. | | SECTION_FAILURE_COMMON | 1 | Failure codes regardless of the operation. | +| SECTION_OBJECT | 2 | Object service-specific errors. | +| SECTION_CONTAINER | 3 | Container service-specific errors. | +| SECTION_SESSION | 4 | Session service-specific errors. | + + + + + +### Session +Section of statuses for session-related operations. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TOKEN_NOT_FOUND | 0 | [**4096**] Token not found. | +| TOKEN_EXPIRED | 1 | [**4097**] Token has expired. | From 3793783ed4f7250721e8f3a5f5810dbd4c975836 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 15 Feb 2022 08:06:19 +0300 Subject: [PATCH 338/440] [#194] object: Add `LOCK` type NeoFS introduces object LOCKs - a mechanism for locking an object from, for example, deletion. Object locks are implemented and stored in the container as objects, so there is a need to define a new type of system objects. Add `LOCK` value to `ObjectType` enum. Signed-off-by: Leonard Lyubich --- object/types.proto | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/object/types.proto b/object/types.proto index 63bed78..95cb8f1 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,13 +9,14 @@ import "refs/types.proto"; import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE` and `STORAGE_GROUP` payload is limited by maximal object -// size. +// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by maximal +// object size. // // String presentation of object type is the same as definition: // * REGULAR // * TOMBSTONE // * STORAGE_GROUP +// * LOCK enum ObjectType { // Just a normal object REGULAR = 0; @@ -25,6 +26,9 @@ enum ObjectType { // StorageGroup information STORAGE_GROUP = 2; + + // Object lock + LOCK = 3; } // Type of match expression From 7b83b9df4ee87480459401056300587733db48c6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 15 Feb 2022 23:02:18 +0300 Subject: [PATCH 339/440] [#194] object: Add status returns related to LOCKs Add `status.Object` section for object failures. Add `LOCKED` and `LOCK_NON_REGULAR_OBJECT` codes to it. Return these codes from `Put` and `Delete` RPCs of `ObjectService`. Signed-off-by: Leonard Lyubich --- object/service.proto | 12 ++++++++++-- status/types.proto | 8 ++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/object/service.proto b/object/service.proto index c608e98..bdce523 100644 --- a/object/service.proto +++ b/object/service.proto @@ -35,7 +35,13 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // object has been successfully saved in the container; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **LOCKED** (2048, SECTION_OBJECT): + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2049, SECTION_OBJECT): + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited. rpc Put(stream PutRequest) returns (PutResponse); // Delete the object from a container. There is no immediate removal @@ -44,7 +50,9 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // object has been successfully marked to be removed from the container; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **LOCKED** (2048, SECTION_OBJECT): + // deleting a locked object is prohibited. rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns the object Headers without data payload. By default full header is diff --git a/status/types.proto b/status/types.proto index 80b47aa..cef00d3 100644 --- a/status/types.proto +++ b/status/types.proto @@ -103,8 +103,15 @@ enum Object { // Details: // - [**0**] Human-readable description. ACCESS_DENIED = 0; + // [**2049**] Object not found. OBJECT_NOT_FOUND = 1; + + // [**2050**] Operation rejected by the object lock. + LOCKED = 2; + + // [**2051**] Locking an object with a non-REGULAR type rejected. + LOCK_NON_REGULAR_OBJECT = 3; } // Section of statuses for container-related operations. @@ -117,6 +124,7 @@ enum Container { enum Session { // [**4096**] Token not found. TOKEN_NOT_FOUND = 0; + // [**4097**] Token has expired. TOKEN_EXPIRED = 1; } From d6bf64589f027249dff6fd470ede5e27ab73b510 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 16 Feb 2022 10:13:43 +0300 Subject: [PATCH 340/440] [#194] object: Define payload format of LOCK objects Define `object.Lock` message which carries list of locked objects. Require this message to be a payload of locked objects (`LOCK` type). Signed-off-by: Leonard Lyubich --- lock/types.proto | 14 ++++++++++++++ object/types.proto | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 lock/types.proto diff --git a/lock/types.proto b/lock/types.proto new file mode 100644 index 0000000..30a9607 --- /dev/null +++ b/lock/types.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package neo.fs.v2.lock; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/lock/grpc;lock"; +option csharp_namespace = "Neo.FileStorage.API.Lock"; + +import "refs/types.proto"; + +// Lock keeps record of objects that are locked. +message Lock { + // List of objects to be locked. + repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"]; +} diff --git a/object/types.proto b/object/types.proto index 95cb8f1..dc0bb69 100644 --- a/object/types.proto +++ b/object/types.proto @@ -184,6 +184,14 @@ message Header { // Object structure. Object is immutable and content-addressed. It means // `ObjectID` will change if header or payload changes. It's calculated as a // hash of header field, which contains hash of object's payload. +// +// Payload format depends on object type specified in the header: +// * **LOCK** \ +// Must be encoded message of type `Lock` in Protocol Buffers binary format +// with direct field order. Member list must no be empty or carry empty IDs. +// All members must regular objects (`REGULAR` type). Lifetime of the lock +// object is limited similar to regular objects in `__NEOFS__EXPIRATION_EPOCH` +// attribute. message Object { // Object's unique identifier. neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"]; From 1c683c757807b8dd3df4570035d456a21f3865c2 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Mon, 21 Feb 2022 12:47:21 +0300 Subject: [PATCH 341/440] [#194] Move Lock payload description to definition Signed-off-by: Stanislav Bogatyrev --- lock/types.proto | 7 +++++-- object/types.proto | 9 ++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lock/types.proto b/lock/types.proto index 30a9607..fea7fe6 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -7,8 +7,11 @@ option csharp_namespace = "Neo.FileStorage.API.Lock"; import "refs/types.proto"; -// Lock keeps record of objects that are locked. +// Lock objects protects a list of objects from being deleted. Lifetime of the +// lock object is limited similar to regular objects in +// `__NEOFS__EXPIRATION_EPOCH` attribute. message Lock { - // List of objects to be locked. + // List of objects to lock. Must not be empty or carry empty IDs. + // All members must be of the `REGULAR` type. repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"]; } diff --git a/object/types.proto b/object/types.proto index dc0bb69..2980b39 100644 --- a/object/types.proto +++ b/object/types.proto @@ -185,13 +185,8 @@ message Header { // `ObjectID` will change if header or payload changes. It's calculated as a // hash of header field, which contains hash of object's payload. // -// Payload format depends on object type specified in the header: -// * **LOCK** \ -// Must be encoded message of type `Lock` in Protocol Buffers binary format -// with direct field order. Member list must no be empty or carry empty IDs. -// All members must regular objects (`REGULAR` type). Lifetime of the lock -// object is limited similar to regular objects in `__NEOFS__EXPIRATION_EPOCH` -// attribute. +// For non-regular object types payload format depends on object type specified +// in the header. message Object { // Object's unique identifier. neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"]; From 0caf501b4afcfbb7c34156bb3cb236838cc5a19c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 21 Feb 2022 18:49:33 +0300 Subject: [PATCH 342/440] [#194] Document status returns of Object and Container service RPCs Signed-off-by: Leonard Lyubich --- container/service.proto | 8 +++-- object/service.proto | 73 +++++++++++++++++++++++++++++++++++------ 2 files changed, 69 insertions(+), 12 deletions(-) diff --git a/container/service.proto b/container/service.proto index 41c88eb..0749926 100644 --- a/container/service.proto +++ b/container/service.proto @@ -42,7 +42,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // container has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // requested container not found. rpc Get(GetRequest) returns (GetResponse); // Returns all owner's containers from 'Container` smart contract' storage. @@ -69,7 +71,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // container not found. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announce container used space values for P2P synchronization. diff --git a/object/service.proto b/object/service.proto index bdce523..d3713ec 100644 --- a/object/service.proto +++ b/object/service.proto @@ -22,7 +22,15 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // object has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message @@ -36,12 +44,21 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): // object has been successfully saved in the container; // - Common failures (SECTION_FAILURE_COMMON); - // - **LOCKED** (2048, SECTION_OBJECT): + // - **LOCKED** (2050, SECTION_OBJECT): // placement of an object of type TOMBSTONE that includes at least one locked // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2049, SECTION_OBJECT): + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited. + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object storage container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // write access to the container is denied; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): + // (for trusted object preparation) session private key does not exist or has + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc Put(stream PutRequest) returns (PutResponse); // Delete the object from a container. There is no immediate removal @@ -51,8 +68,14 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): // object has been successfully marked to be removed from the container; // - Common failures (SECTION_FAILURE_COMMON); - // - **LOCKED** (2048, SECTION_OBJECT): - // deleting a locked object is prohibited. + // - **LOCKED** (2050, SECTION_OBJECT): + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // delete access to the object is denied; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns the object Headers without data payload. By default full header is @@ -62,7 +85,15 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // object header has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object @@ -72,7 +103,13 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // objects have been successfully selected; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // search container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // access to operation SEARCH of the object is denied; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc Search(SearchRequest) returns (stream SearchResponse); // Get byte range of data payload. Range is set as an (offset, length) tuple. @@ -83,7 +120,15 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // data range of the object payload has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after @@ -94,7 +139,15 @@ service ObjectService { // Statuses: // - **OK** (0, SECTION_SUCCESS): // data range of the object payload has been successfully hashed; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): + // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } From 83b0eef37d838c77c9338ae93f79a0d3d540c417 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 21 Feb 2022 18:52:26 +0300 Subject: [PATCH 343/440] [#189] status: Refine format of the `ACCESS_DENIED` status detail Signed-off-by: Leonard Lyubich --- status/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/status/types.proto b/status/types.proto index cef00d3..f64d585 100644 --- a/status/types.proto +++ b/status/types.proto @@ -101,7 +101,7 @@ enum CommonFail { enum Object { // [**2048**] Access denied by ACL. // Details: - // - [**0**] Human-readable description. + // - [**0**] Human-readable description (UTF-8 encoded string). ACCESS_DENIED = 0; // [**2049**] Object not found. From fc79cd18cc8eea74f12fdbcdbb8dd74b2c259e0a Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 21 Feb 2022 18:58:34 +0300 Subject: [PATCH 344/440] [#190] status: Add `OBJECT_ALREADY_REMOVED` code Add `OBJECT_ALREADY_REMOVED` value to `Object` enumeration. Return this status from object GET/HEAD/RANGE operations. Signed-off-by: Leonard Lyubich --- object/service.proto | 12 +++++++++--- status/types.proto | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index d3713ec..061050f 100644 --- a/object/service.proto +++ b/object/service.proto @@ -30,7 +30,9 @@ service ObjectService { // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): // object not found in container; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): + // the requested object has been marked as deleted. rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message @@ -93,7 +95,9 @@ service ObjectService { // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): // object not found in container; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): + // the requested object has been marked as deleted. rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object @@ -128,7 +132,9 @@ service ObjectService { // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): // object not found in container; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): + // the requested object has been marked as deleted. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after diff --git a/status/types.proto b/status/types.proto index f64d585..25645a0 100644 --- a/status/types.proto +++ b/status/types.proto @@ -112,6 +112,9 @@ enum Object { // [**2051**] Locking an object with a non-REGULAR type rejected. LOCK_NON_REGULAR_OBJECT = 3; + + // [**2052**] Object has been marked deleted. + OBJECT_ALREADY_REMOVED = 4; } // Section of statuses for container-related operations. From 2743e4ba11bf588f86ff500a752eef2f5d2aa0a6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 21 Feb 2022 19:00:08 +0300 Subject: [PATCH 345/440] [#194] Generate docs with recent protocol changes Signed-off-by: Leonard Lyubich --- container/service.proto | 36 ++++----- object/service.proto | 160 ++++++++++++++++++++-------------------- proto-docs/container.md | 36 +++++---- proto-docs/lock.md | 62 ++++++++++++++++ proto-docs/object.md | 118 +++++++++++++++++++++++------ proto-docs/status.md | 5 +- 6 files changed, 279 insertions(+), 138 deletions(-) create mode 100644 proto-docs/lock.md diff --git a/container/service.proto b/container/service.proto index 0749926..fae6d4c 100644 --- a/container/service.proto +++ b/container/service.proto @@ -21,8 +21,8 @@ service ContainerService { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // request to save the container has been sent to the sidechain; + // - **OK** (0, SECTION_SUCCESS): \ + // request to save the container has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON). rpc Put(PutRequest) returns (PutResponse); @@ -32,26 +32,26 @@ service ContainerService { // is added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // request to remove the container has been sent to the sidechain; + // - **OK** (0, SECTION_SUCCESS): \ + // request to remove the container has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON). rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns container structure from `Container` smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // container has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // container has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // requested container not found. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // requested container not found. rpc Get(GetRequest) returns (GetResponse); // Returns all owner's containers from 'Container` smart contract' storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // container list has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). rpc List(ListRequest) returns (ListResponse); @@ -60,8 +60,8 @@ service ContainerService { // added into smart contract storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // request to save container eACL has been sent to the sidechain; + // - **OK** (0, SECTION_SUCCESS): \ + // request to save container eACL has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON). rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); @@ -69,18 +69,18 @@ service ContainerService { // storage. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // container eACL has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // container eACL has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // container not found. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container not found. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announce container used space values for P2P synchronization. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // estimation of used space has been successfully announced; + // - **OK** (0, SECTION_SUCCESS): \ + // estimation of used space has been successfully announced; // - Common failures (SECTION_FAILURE_COMMON). rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); } diff --git a/object/service.proto b/object/service.proto index 061050f..4170e1d 100644 --- a/object/service.proto +++ b/object/service.proto @@ -20,19 +20,19 @@ service ObjectService { // keeping receiving order. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // object has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // read access to the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): - // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): - // the requested object has been marked as deleted. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // read access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message @@ -43,41 +43,41 @@ service ObjectService { // Chunk messages SHOULD be sent in direct order of fragmentation. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // object has been successfully saved in the container; + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; // - Common failures (SECTION_FAILURE_COMMON); - // - **LOCKED** (2050, SECTION_OBJECT): - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; - // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): - // placement of an object of type LOCK that includes at least one object of - // type other than REGULAR is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object storage container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // write access to the container is denied; - // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): - // (for trusted object preparation) session private key does not exist or has + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has // been deleted; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc Put(stream PutRequest) returns (PutResponse); // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // object has been successfully marked to be removed from the container; + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully marked to be removed from the container; // - Common failures (SECTION_FAILURE_COMMON); - // - **LOCKED** (2050, SECTION_OBJECT): - // deleting a locked object is prohibited; - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // delete access to the object is denied; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // - **LOCKED** (2050, SECTION_OBJECT): \ + // deleting a locked object is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns the object Headers without data payload. By default full header is @@ -85,19 +85,19 @@ service ObjectService { // the very minimal information would be returned instead. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // object header has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // object header has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // access to operation HEAD of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): - // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): - // the requested object has been marked as deleted. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation HEAD of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object @@ -105,15 +105,15 @@ service ObjectService { // Specification section for more details. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // objects have been successfully selected; + // - **OK** (0, SECTION_SUCCESS): \ + // objects have been successfully selected; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // search container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // access to operation SEARCH of the object is denied; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation SEARCH of the object is denied; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc Search(SearchRequest) returns (stream SearchResponse); // Get byte range of data payload. Range is set as an (offset, length) tuple. @@ -122,19 +122,19 @@ service ObjectService { // order. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // data range of the object payload has been successfully read; + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // access to operation RANGE of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): - // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired; - // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): - // the requested object has been marked as deleted. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGE of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after @@ -143,17 +143,17 @@ service ObjectService { // request. Note that hash is calculated for XORed data. // // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // data range of the object payload has been successfully hashed; + // - **OK** (0, SECTION_SUCCESS): \ + // data range of the object payload has been successfully hashed; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): - // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): - // access to operation RANGEHASH of the object is denied; - // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): - // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): - // provided session token has expired. + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // access to operation RANGEHASH of the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); } diff --git a/proto-docs/container.md b/proto-docs/container.md index 13bd4db..80684db 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -85,8 +85,8 @@ verified by Inner Ring nodes. After one more block in sidechain, container is added into smart contract storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -request to save the container has been sent to the sidechain; +- **OK** (0, SECTION_SUCCESS): \ + request to save the container has been sent to the sidechain; - Common failures (SECTION_FAILURE_COMMON). | Name | Input | Output | @@ -100,8 +100,8 @@ verified by Inner Ring nodes. After one more block in sidechain, container is added into smart contract storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -request to remove the container has been sent to the sidechain; +- **OK** (0, SECTION_SUCCESS): \ + request to remove the container has been sent to the sidechain; - Common failures (SECTION_FAILURE_COMMON). | Name | Input | Output | @@ -112,9 +112,11 @@ request to remove the container has been sent to the sidechain; Returns container structure from `Container` smart contract storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -container has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + container has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + requested container not found. | Name | Input | Output | | ---- | ----- | ------ | @@ -124,8 +126,8 @@ container has been successfully read; Returns all owner's containers from 'Container` smart contract' storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -container list has been successfully read; +- **OK** (0, SECTION_SUCCESS): \ + container list has been successfully read; - Common failures (SECTION_FAILURE_COMMON). | Name | Input | Output | @@ -138,8 +140,8 @@ immediately. After one more block in sidechain, Extended ACL changes are added into smart contract storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -request to save container eACL has been sent to the sidechain; +- **OK** (0, SECTION_SUCCESS): \ + request to save container eACL has been sent to the sidechain; - Common failures (SECTION_FAILURE_COMMON). | Name | Input | Output | @@ -151,9 +153,11 @@ Returns Extended ACL table and signature from `Container` smart contract storage. Statuses: -- **OK** (0, SECTION_SUCCESS): -container eACL has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + container eACL has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + container not found. | Name | Input | Output | | ---- | ----- | ------ | @@ -163,8 +167,8 @@ container eACL has been successfully read; Announce container used space values for P2P synchronization. Statuses: -- **OK** (0, SECTION_SUCCESS): -estimation of used space has been successfully announced; +- **OK** (0, SECTION_SUCCESS): \ + estimation of used space has been successfully announced; - Common failures (SECTION_FAILURE_COMMON). | Name | Input | Output | diff --git a/proto-docs/lock.md b/proto-docs/lock.md new file mode 100644 index 0000000..b23c734 --- /dev/null +++ b/proto-docs/lock.md @@ -0,0 +1,62 @@ +# Protocol Documentation + + +## Table of Contents + +- [lock/types.proto](#lock/types.proto) + + - Messages + - [Lock](#neo.fs.v2.lock.Lock) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## lock/types.proto + + + + + + + +### Message Lock +Lock objects protects a list of objects from being deleted. Lifetime of the +lock object is limited similar to regular objects in +`__NEOFS__EXPIRATION_EPOCH` attribute. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to lock. Must not be empty or carry empty IDs. All members must be of the `REGULAR` type. | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/object.md b/proto-docs/object.md index fa33d43..a483e8c 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -93,9 +93,19 @@ be restored by concatenation of object message payload and all chunks keeping receiving order. Statuses: -- **OK** (0, SECTION_SUCCESS): -object has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + object has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + read access to the object is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + object not found in container; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired; +- **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + the requested object has been marked as deleted. | Name | Input | Output | | ---- | ----- | ------ | @@ -110,9 +120,24 @@ object payload. All messages, except first one, SHOULD be payload chunks. Chunk messages SHOULD be sent in direct order of fragmentation. Statuses: -- **OK** (0, SECTION_SUCCESS): -object has been successfully saved in the container; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + object has been successfully saved in the container; +- Common failures (SECTION_FAILURE_COMMON); +- **LOCKED** (2050, SECTION_OBJECT): \ + placement of an object of type TOMBSTONE that includes at least one locked + object is prohibited; +- **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + placement of an object of type LOCK that includes at least one object of + type other than REGULAR is prohibited; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object storage container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + write access to the container is denied; +- **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + (for trusted object preparation) session private key does not exist or has +been deleted; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -123,9 +148,17 @@ Delete the object from a container. There is no immediate removal guarantee. Object will be marked for removal and deleted eventually. Statuses: -- **OK** (0, SECTION_SUCCESS): -object has been successfully marked to be removed from the container; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + object has been successfully marked to be removed from the container; +- Common failures (SECTION_FAILURE_COMMON); +- **LOCKED** (2050, SECTION_OBJECT): \ + deleting a locked object is prohibited; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + delete access to the object is denied; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -137,9 +170,19 @@ returned. If `main_only` request field is set, the short header with only the very minimal information would be returned instead. Statuses: -- **OK** (0, SECTION_SUCCESS): -object header has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + object header has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + access to operation HEAD of the object is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + object not found in container; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired; +- **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + the requested object has been marked as deleted. | Name | Input | Output | | ---- | ----- | ------ | @@ -151,9 +194,15 @@ Header's filed values. Please see the corresponding NeoFS Technical Specification section for more details. Statuses: -- **OK** (0, SECTION_SUCCESS): -objects have been successfully selected; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + objects have been successfully selected; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + search container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + access to operation SEARCH of the object is denied; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -166,9 +215,19 @@ restored by concatenation of all received payload chunks keeping receiving order. Statuses: -- **OK** (0, SECTION_SUCCESS): -data range of the object payload has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + data range of the object payload has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + access to operation RANGE of the object is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + object not found in container; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired; +- **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + the requested object has been marked as deleted. | Name | Input | Output | | ---- | ----- | ------ | @@ -181,9 +240,17 @@ length) tuples. Hashes order in response corresponds to ranges order in request. Note that hash is calculated for XORed data. Statuses: -- **OK** (0, SECTION_SUCCESS): -data range of the object payload has been successfully hashed; -- Common failures (SECTION_FAILURE_COMMON). +- **OK** (0, SECTION_SUCCESS): \ + data range of the object payload has been successfully hashed; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + access to operation RANGEHASH of the object is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + object not found in container; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -780,6 +847,9 @@ Object structure. Object is immutable and content-addressed. It means `ObjectID` will change if header or payload changes. It's calculated as a hash of header field, which contains hash of object's payload. +For non-regular object types payload format depends on object type specified +in the header. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | @@ -843,19 +913,21 @@ Type of match expression ### ObjectType Type of the object payload content. Only `REGULAR` type objects can be split, -hence `TOMBSTONE` and `STORAGE_GROUP` payload is limited by maximal object -size. +hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by maximal +object size. String presentation of object type is the same as definition: * REGULAR * TOMBSTONE * STORAGE_GROUP +* LOCK | Name | Number | Description | | ---- | ------ | ----------- | | REGULAR | 0 | Just a normal object | | TOMBSTONE | 1 | Used internally to identify deleted objects | | STORAGE_GROUP | 2 | StorageGroup information | +| LOCK | 3 | Object lock | diff --git a/proto-docs/status.md b/proto-docs/status.md index de1b44b..ea97ac7 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -109,8 +109,11 @@ Section of statuses for object-related operations. | Name | Number | Description | | ---- | ------ | ----------- | -| ACCESS_DENIED | 0 | [**2048**] Access denied by ACL. Details: - [**0**] Human-readable description. | +| ACCESS_DENIED | 0 | [**2048**] Access denied by ACL. Details: - [**0**] Human-readable description (UTF-8 encoded string). | | OBJECT_NOT_FOUND | 1 | [**2049**] Object not found. | +| LOCKED | 2 | [**2050**] Operation rejected by the object lock. | +| LOCK_NON_REGULAR_OBJECT | 3 | [**2051**] Locking an object with a non-REGULAR type rejected. | +| OBJECT_ALREADY_REMOVED | 4 | [**2052**] Object has been marked deleted. | From 3302a530f215646f03a1a7b11ff39502bff254d7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 7 Feb 2022 15:46:39 +0300 Subject: [PATCH 346/440] [#55] refs: add signature scheme description Signed-off-by: Evgenii Stratonikov --- proto-docs/refs.md | 14 ++++++++++++++ refs/types.proto | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index e9e46d9..3ce5f0e 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -148,6 +148,7 @@ Signature of something in NeoFS. | ----- | ---- | ----- | ----------- | | key | [bytes](#bytes) | | Public key used for signing | | sign | [bytes](#bytes) | | Signature | +| scheme | [SignatureScheme](#neo.fs.v2.refs.SignatureScheme) | | Scheme contains digital signature scheme identifier. | @@ -194,6 +195,19 @@ Checksum algorithm type. | SHA256 | 2 | SHA-256 | + + + +### SignatureScheme +Signature scheme describes digital signing scheme used for (key, signature) pair. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| UNSPECIFIED | 0 | Unknown. The default interpretation depends on a particular structure type. | +| ECDSA_SHA512 | 1 | ECDSA with SHA-512 hashing (FIPS 186-3). | +| ECDSA_RFC6979_SHA256 | 2 | Deterministic ECDSA with SHA-256 hashing (RFC 6979) | + + diff --git a/refs/types.proto b/refs/types.proto index 9675026..908a76c 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -105,6 +105,18 @@ message Signature { bytes key = 1 [json_name = "key"]; // Signature bytes sign = 2 [json_name = "signature"]; + // Scheme contains digital signature scheme identifier. + SignatureScheme scheme = 3 [json_name = "scheme"]; +} + +// Signature scheme describes digital signing scheme used for (key, signature) pair. +enum SignatureScheme { + // Unknown. The default interpretation depends on a particular structure type. + UNSPECIFIED = 0; + // ECDSA with SHA-512 hashing (FIPS 186-3). + ECDSA_SHA512 = 1; + // Deterministic ECDSA with SHA-256 hashing (RFC 6979) + ECDSA_RFC6979_SHA256 = 2; } // Checksum algorithm type. From 478c388df96cc11f72dc338e1440ce20d3c890ae Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 21 Feb 2022 11:54:46 +0300 Subject: [PATCH 347/440] [#55] container: add a comment about signature restrictions Signed-off-by: Evgenii Stratonikov --- container/service.proto | 15 ++++++++++----- proto-docs/container.md | 10 +++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/container/service.proto b/container/service.proto index fae6d4c..05668d8 100644 --- a/container/service.proto +++ b/container/service.proto @@ -96,7 +96,8 @@ message PutRequest { // Container structure to register in NeoFS container.Container container = 1; - // Signature of a stable-marshalled container according to RFC-6979 + // Signature of a stable-marshalled container according to RFC-6979. + // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. neo.fs.v2.refs.Signature signature =2; } // Body of container put request message. @@ -144,7 +145,8 @@ message DeleteRequest { // Identifier of the container to delete from NeoFS neo.fs.v2.refs.ContainerID container_id = 1; - // `ContainerID` signed with the container owner's key according to RFC-6979 + // `ContainerID` signed with the container owner's key according to RFC-6979. + // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. neo.fs.v2.refs.Signature signature = 2; } // Body of container delete request message. @@ -207,7 +209,8 @@ message GetResponse { // Requested container structure Container container = 1; - // Signature of a stable-marshalled container according to RFC-6979 + // Signature of a stable-marshalled container according to RFC-6979. + // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. neo.fs.v2.refs.Signature signature = 2; // Session token if the container was created within a session @@ -275,7 +278,8 @@ message SetExtendedACLRequest { // Extended ACL table to set for container neo.fs.v2.acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL table according to RFC-6979 + // Signature of stable-marshalled Extended ACL table according to RFC-6979. + // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. neo.fs.v2.refs.Signature signature = 2; } // Body of set extended acl request message. @@ -341,7 +345,8 @@ message GetExtendedACLResponse { // Extended ACL requested, if available neo.fs.v2.acl.EACLTable eacl = 1; - // Signature of stable-marshalled Extended ACL according to RFC-6979 + // Signature of stable-marshalled Extended ACL according to RFC-6979. + // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. neo.fs.v2.refs.Signature signature = 2; // Session token if Extended ACL was set within a session diff --git a/proto-docs/container.md b/proto-docs/container.md index 80684db..6fc2fb9 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -259,7 +259,7 @@ smart contract, so signing algorithm must be supported by NeoVM. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to delete from NeoFS | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `ContainerID` signed with the container owner's key according to RFC-6979 | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `ContainerID` signed with the container owner's key according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | @@ -332,7 +332,7 @@ container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL requested, if available | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979 | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if Extended ACL was set within a session | @@ -383,7 +383,7 @@ was already verified on container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Requested container structure | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979 | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if the container was created within a session | @@ -461,7 +461,7 @@ additional signature checks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Container structure to register in NeoFS | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979 | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | @@ -514,7 +514,7 @@ reference. It will be taken from `EACLTable.container_id` field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for container | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL table according to RFC-6979 | +| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL table according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | From f6dad19bef26a049e05eaedfebf90852697c03a7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 22 Feb 2022 15:29:49 +0300 Subject: [PATCH 348/440] =?UTF-8?q?Release=20v2.12.0=20-=20Heuksando=20(?= =?UTF-8?q?=ED=9D=91=EC=82=B0=EB=8F=84,=20=E9=BB=91=E5=B1=B1=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a24a315..1298de9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [2.12.0] - 2022-02-22 - Heuksando (흑산도, 黑山島) + +Network magic, main status codes, object locks and notifications. + +### Added +- `magic_number` field to `RequestMetaHeader` message (#82) +- `WRONG_MAGIC_NUMBER` status code to `CommonFail` section (#82) +- Well-known object attributes related to notifications `__NEOFS__TICK_EPOCH` + and `__NEOFS__TICK_TOPIC` (#193) +- `ACCESS_DENIED` status code to `Object` section (#189) +- `OBJECT_NOT_FOUND`, `CONTAINER_NOT_FOUND` and `OBJECT_ALREADY_REMOVED` status codes (#190) +- `TOKEN_NOT_FOUND` and `TOKEN_EXPIRED` status codes to `Session` section (#191) +- `LOCK` value of `object.Type` enum (#194) +- `Lock` message with payload content of `LOCK` objects (#194) +- `LOCKED` and `LOCK_NON_REGULAR_OBJECT` status codes to `Object` section (#194) +- `scheme` field of type `SignatureScheme` to `Signature` message which determines + signature scheme (#55) + ## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) Subnets and status responses. @@ -424,3 +442,4 @@ Bump major release [2.9.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.0...v2.9.1 [2.10.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.1...v2.10.0 [2.11.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.10.0...v2.11.0 +[2.12.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.11.0...v2.12.0 From b28ce355240c09b15f1df54b1c750362dbdbc4e3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 2 Mar 2022 12:30:05 +0300 Subject: [PATCH 349/440] [#203] refs: Change support for different signature schemes Remove `UNSPECIFIED` value from `SignatureScheme` enum. Make `ECDSA_SHA512` to be default signature scheme (zero value). Define `SignatureRFC6979` type for RFC-6979 signatures. Use it in `Container` service. Signed-off-by: Leonard Lyubich --- container/service.proto | 15 +++++---------- proto-docs/container.md | 10 +++++----- proto-docs/refs.md | 20 ++++++++++++++++---- refs/types.proto | 19 +++++++++++++------ 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/container/service.proto b/container/service.proto index 05668d8..5c7a29c 100644 --- a/container/service.proto +++ b/container/service.proto @@ -97,8 +97,7 @@ message PutRequest { container.Container container = 1; // Signature of a stable-marshalled container according to RFC-6979. - // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. - neo.fs.v2.refs.Signature signature =2; + neo.fs.v2.refs.SignatureRFC6979 signature = 2; } // Body of container put request message. Body body = 1; @@ -146,8 +145,7 @@ message DeleteRequest { neo.fs.v2.refs.ContainerID container_id = 1; // `ContainerID` signed with the container owner's key according to RFC-6979. - // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.SignatureRFC6979 signature = 2; } // Body of container delete request message. Body body = 1; @@ -210,8 +208,7 @@ message GetResponse { Container container = 1; // Signature of a stable-marshalled container according to RFC-6979. - // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.SignatureRFC6979 signature = 2; // Session token if the container was created within a session neo.fs.v2.session.SessionToken session_token = 3; @@ -279,8 +276,7 @@ message SetExtendedACLRequest { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL table according to RFC-6979. - // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.SignatureRFC6979 signature = 2; } // Body of set extended acl request message. Body body = 1; @@ -346,8 +342,7 @@ message GetExtendedACLResponse { neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL according to RFC-6979. - // Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. - neo.fs.v2.refs.Signature signature = 2; + neo.fs.v2.refs.SignatureRFC6979 signature = 2; // Session token if Extended ACL was set within a session neo.fs.v2.session.SessionToken session_token = 3; diff --git a/proto-docs/container.md b/proto-docs/container.md index 6fc2fb9..a0e9684 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -259,7 +259,7 @@ smart contract, so signing algorithm must be supported by NeoVM. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to delete from NeoFS | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | `ContainerID` signed with the container owner's key according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | +| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | `ContainerID` signed with the container owner's key according to RFC-6979. | @@ -332,7 +332,7 @@ container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL requested, if available | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | +| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if Extended ACL was set within a session | @@ -383,7 +383,7 @@ was already verified on container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Requested container structure | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | +| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of a stable-marshalled container according to RFC-6979. | | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if the container was created within a session | @@ -461,7 +461,7 @@ additional signature checks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Container structure to register in NeoFS | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of a stable-marshalled container according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | +| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of a stable-marshalled container according to RFC-6979. | @@ -514,7 +514,7 @@ reference. It will be taken from `EACLTable.container_id` field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for container | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of stable-marshalled Extended ACL table according to RFC-6979. Signature scheme must be either UNSPECIFIED or ECDSA_RFC6979_SHA256. | +| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of stable-marshalled Extended ACL table according to RFC-6979. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 3ce5f0e..abb2f6f 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -12,6 +12,7 @@ - [ObjectID](#neo.fs.v2.refs.ObjectID) - [OwnerID](#neo.fs.v2.refs.OwnerID) - [Signature](#neo.fs.v2.refs.Signature) + - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) - [SubnetID](#neo.fs.v2.refs.SubnetID) - [Version](#neo.fs.v2.refs.Version) @@ -148,7 +149,19 @@ Signature of something in NeoFS. | ----- | ---- | ----- | ----------- | | key | [bytes](#bytes) | | Public key used for signing | | sign | [bytes](#bytes) | | Signature | -| scheme | [SignatureScheme](#neo.fs.v2.refs.SignatureScheme) | | Scheme contains digital signature scheme identifier. | +| scheme | [SignatureScheme](#neo.fs.v2.refs.SignatureScheme) | | Scheme contains digital signature scheme identifier | + + + + +### Message SignatureRFC6979 +RFC 6979 signature. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [bytes](#bytes) | | Public key used for signing | +| sign | [bytes](#bytes) | | Deterministic ECDSA with SHA-256 hashing | @@ -203,9 +216,8 @@ Signature scheme describes digital signing scheme used for (key, signature) pair | Name | Number | Description | | ---- | ------ | ----------- | -| UNSPECIFIED | 0 | Unknown. The default interpretation depends on a particular structure type. | -| ECDSA_SHA512 | 1 | ECDSA with SHA-512 hashing (FIPS 186-3). | -| ECDSA_RFC6979_SHA256 | 2 | Deterministic ECDSA with SHA-256 hashing (RFC 6979) | +| ECDSA_SHA512 | 0 | ECDSA with SHA-512 hashing (FIPS 186-3) | +| ECDSA_RFC6979_SHA256 | 1 | Deterministic ECDSA with SHA-256 hashing (RFC 6979) | diff --git a/refs/types.proto b/refs/types.proto index 908a76c..bd3060b 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -105,18 +105,25 @@ message Signature { bytes key = 1 [json_name = "key"]; // Signature bytes sign = 2 [json_name = "signature"]; - // Scheme contains digital signature scheme identifier. + // Scheme contains digital signature scheme identifier SignatureScheme scheme = 3 [json_name = "scheme"]; } // Signature scheme describes digital signing scheme used for (key, signature) pair. enum SignatureScheme { - // Unknown. The default interpretation depends on a particular structure type. - UNSPECIFIED = 0; - // ECDSA with SHA-512 hashing (FIPS 186-3). - ECDSA_SHA512 = 1; + // ECDSA with SHA-512 hashing (FIPS 186-3) + ECDSA_SHA512 = 0; + // Deterministic ECDSA with SHA-256 hashing (RFC 6979) - ECDSA_RFC6979_SHA256 = 2; + ECDSA_RFC6979_SHA256 = 1; +} + +// RFC 6979 signature. +message SignatureRFC6979 { + // Public key used for signing + bytes key = 1 [json_name = "key"]; + // Deterministic ECDSA with SHA-256 hashing + bytes sign = 2 [json_name = "signature"]; } // Checksum algorithm type. From 650c367529c6fe6b215ea8d5f183b07b4ac8f9a9 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 2 Mar 2022 12:34:46 +0300 Subject: [PATCH 350/440] =?UTF-8?q?Release=20v2.12.0=20-=20Heuksando=20(?= =?UTF-8?q?=ED=9D=91=EC=82=B0=EB=8F=84,=20=E9=BB=91=E5=B1=B1=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1298de9..89fa6c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ Network magic, main status codes, object locks and notifications. - `LOCKED` and `LOCK_NON_REGULAR_OBJECT` status codes to `Object` section (#194) - `scheme` field of type `SignatureScheme` to `Signature` message which determines signature scheme (#55) +- `SignatureRFC6979` message (#203) + +### Changed +- Type of `signature` field in `ContainerService` requests to `SignatureRFC6979` (#203) ## [2.11.0] - 2021-12-02 - Sinjido (신지도, 薪智島) From 431335054c3bd2fcff52226e04175b443bcb8a1e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 18 Mar 2022 17:45:32 +0300 Subject: [PATCH 351/440] [#207] acl: Clarify `container_id` field meaning in the eACL table of a BearerToken Signed-off-by: Evgenii Stratonikov --- acl/types.proto | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/acl/types.proto b/acl/types.proto index 8e38d58..6425e40 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -190,7 +190,9 @@ message BearerToken { // owner with additional information preventing token's abuse. message Body { // Table of Extended ACL rules to use instead of the ones attached to the - // container + // container. If it contains `container_id` field, bearer token is only + // valid for this specific container. Otherwise, any container of the same owner + // is allowed. EACLTable eacl_table = 1 [json_name="eaclTable"]; // `OwnerID` to whom the token was issued. Must match the request From f233a2fd6784b696b41741b4bcbb3bedaef2b066 Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Wed, 13 Apr 2022 09:21:33 +0300 Subject: [PATCH 352/440] [#216] English Check Signed-off-by: Elizaveta Chichindaeva --- CONTRIBUTING.md | 8 ++++---- README.md | 2 +- accounting/service.proto | 6 +++--- accounting/types.proto | 2 +- acl/types.proto | 26 ++++++++++++------------- audit/types.proto | 8 ++++---- container/service.proto | 38 ++++++++++++++++++------------------- container/types.proto | 24 +++++++++++------------ doc/release_instructions.md | 10 +++++----- lock/types.proto | 2 +- netmap/service.proto | 16 ++++++++-------- netmap/types.proto | 14 +++++++------- object/service.proto | 34 ++++++++++++++++----------------- object/types.proto | 32 +++++++++++++++---------------- refs/types.proto | 24 +++++++++++------------ reputation/service.proto | 16 ++++++++-------- reputation/types.proto | 8 ++++---- session/service.proto | 4 ++-- session/types.proto | 18 +++++++++--------- status/types.proto | 6 +++--- storagegroup/types.proto | 4 ++-- tombstone/types.proto | 10 +++++----- 22 files changed, 156 insertions(+), 156 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d02d3c..33ba4ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,8 +44,8 @@ $ git merge upstream/master ``` ### Create your feature branch -Before making code changes, make sure you create a separate branch for these -changes. Maybe you will find it convenient to name branch in +Before making code changes, make sure you have created a separate branch for these +changes. Maybe you will find it convenient to name branch in the `/-` format. ```sh @@ -106,9 +106,9 @@ To sign your work, just add a line like this at the end of your commit message: Signed-off-by: Samii Sakisaka ``` -This can easily be done with the `--signoff` option to `git commit`. +This can be done easily with the `--signoff` option to `git commit`. -By doing this you state that you can certify the following (from [The Developer +By doing this, you state that you can certify the following (from [The Developer Certificate of Origin](https://developercertificate.org/)): ``` diff --git a/README.md b/README.md index 7a68acd..ce5ad24 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ This repository contains: Feel free to contribute to this project after reading the [contributing guidelines](CONTRIBUTING.md). -Before starting to work on a certain topic, create a new issue first, +Before you start working on a certain topic, first create a new issue describing the feature/topic you are going to implement. ## License diff --git a/accounting/service.proto b/accounting/service.proto index d2f99df..bc44b5b 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -13,7 +13,7 @@ import "session/types.proto"; // other NeoFS nodes to get information about the account balance. Deposit and // Withdraw operations can't be implemented here, as they require Mainnet NeoFS // smart contract invocation. Transfer operations between internal NeoFS -// accounts are possible, if both use the same token type. +// accounts are possible if both use the same token type. service AccountingService { // Returns the amount of funds in GAS token for the requested NeoFS account. // @@ -26,7 +26,7 @@ service AccountingService { // BalanceRequest message message BalanceRequest { - // To indicate the account for which the balance is requested, it's identifier + // To indicate the account for which the balance is requested, its identifier // is used. It can be any existing account in NeoFS sidechain `Balance` smart // contract. If omitted, client implementation MUST set it to the request's // signer `OwnerID`. @@ -51,7 +51,7 @@ message BalanceRequest { // BalanceResponse message message BalanceResponse { // The amount of funds in GAS token for the `OwnerID`'s account requested. - // Balance is `Decimal` format to avoid precision issues with rounding. + // Balance is given in the `Decimal` format to avoid precision issues with rounding. message Body { // Amount of funds in GAS token for the requested account. Decimal balance = 1; diff --git a/accounting/types.proto b/accounting/types.proto index 2776232..f1facbf 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -13,7 +13,7 @@ option csharp_namespace = "Neo.FileStorage.API.Accounting"; // Specification](http://speleotrove.com/decimal/) for detailed problem // description. message Decimal { - // Number in smallest Token fractions. + // Number in the smallest Token fractions. int64 value = 1 [json_name = "value"]; // Precision value indicating how many smallest fractions can be in one diff --git a/acl/types.proto b/acl/types.proto index 6425e40..f6c1da7 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -15,11 +15,11 @@ enum Role { // User target rule is applied if sender is the owner of the container USER = 1; - // System target rule is applied if sender is the storage node within the - // container or inner ring node + // System target rule is applied if sender is a storage node within the + // container or an inner ring node SYSTEM = 2; - // Others target rule is applied if sender is not user nor system target + // Others target rule is applied if sender is neither a user nor a system target OTHERS = 3; } @@ -100,7 +100,7 @@ message EACLRecord { // Rule execution result. Either allows or denies access if filters match. Action action = 2 [json_name = "action"]; - // Filter to check particular properties of the request or object. + // Filter to check particular properties of the request or the object. // // By default `key` field refers to the corresponding object's `Attribute`. // Some Object's header fields can also be accessed by adding `$Object:` @@ -160,12 +160,12 @@ message EACLRecord { repeated Target targets = 4 [json_name="targets"]; } -// Extended ACL rules table. Defined a list of ACL rules additionally to Basic -// ACL. Extended ACL rules can be attached to the container and can be updated +// Extended ACL rules table. A list of ACL rules defined additionally to Basic +// ACL. Extended ACL rules can be attached to a container and can be updated // or may be defined in `BearerToken` structure. Please see the corresponding -// NeoFS Technical Specification's section for detailed description. +// NeoFS Technical Specification section for detailed description. message EACLTable { - // eACL format version. Effectively the version of API library used to create + // eACL format version. Effectively, the version of API library used to create // eACL Table. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; @@ -183,11 +183,11 @@ message EACLTable { // used in the similar use cases, like providing authorisation to externally // authenticated party. // -// BearerToken can be issued only by container's owner and must be signed using -// the key associated with container's `OwnerID`. +// BearerToken can be issued only by the container's owner and must be signed using +// the key associated with the container's `OwnerID`. message BearerToken { - // Bearer Token body structure contains Extended ACL table issued by container - // owner with additional information preventing token's abuse. + // Bearer Token body structure contains Extended ACL table issued by the container + // owner with additional information preventing token abuse. message Body { // Table of Extended ACL rules to use instead of the ones attached to the // container. If it contains `container_id` field, bearer token is only @@ -195,7 +195,7 @@ message BearerToken { // is allowed. EACLTable eacl_table = 1 [json_name="eaclTable"]; - // `OwnerID` to whom the token was issued. Must match the request + // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; diff --git a/audit/types.proto b/audit/types.proto index 11c5754..8a9bb72 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -10,7 +10,7 @@ import "refs/types.proto"; // DataAuditResult keeps record of conducted Data Audits. The detailed report is // generated separately. message DataAuditResult { - // Data Audit Result format version. Effectively the version of API library + // Data Audit Result format version. Effectively, the version of API library // used to report DataAuditResult structure. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; @@ -38,16 +38,16 @@ message DataAuditResult { // List of Storage Groups that failed audit PoR stage repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [json_name = "failSG"]; - // Number of sampled objects under audit placed in an optimal way according to + // Number of sampled objects under the audit placed in an optimal way according to // the containers placement policy when checking PoP uint32 hit = 10 [json_name = "hit"]; - // Number of sampled objects under audit placed in suboptimal way according to + // Number of sampled objects under the audit placed in suboptimal way according to // the containers placement policy, but still at a satisfactory level when // checking PoP uint32 miss = 11 [json_name = "miss"]; - // Number of sampled objects under audit stored in a way not confirming + // Number of sampled objects under the audit stored inconsistently with the // placement policy or not found at all when checking PoP uint32 fail = 12 [json_name = "fail"]; diff --git a/container/service.proto b/container/service.proto index 5c7a29c..1fdc54f 100644 --- a/container/service.proto +++ b/container/service.proto @@ -17,7 +17,7 @@ import "session/types.proto"; service ContainerService { // `Put` invokes `Container` smart contract's `Put` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, container + // verified by Inner Ring nodes. After one more block in sidechain, the container // is added into smart contract storage. // // Statuses: @@ -28,7 +28,7 @@ service ContainerService { // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, container + // verified by Inner Ring nodes. After one more block in sidechain, the container // is added into smart contract storage. // // Statuses: @@ -56,7 +56,7 @@ service ContainerService { rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, Extended ACL changes are + // immediately. After one more block in sidechain, changes in an Extended ACL are // added into smart contract storage. // // Statuses: @@ -76,7 +76,7 @@ service ContainerService { // container not found. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); - // Announce container used space values for P2P synchronization. + // Announces the space values used by the container for P2P synchronization. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -117,7 +117,7 @@ message PutResponse { // Container put response body contains information about the newly registered // container as seen by `Container` smart contract. `ContainerID` can be // calculated beforehand from the container structure and compared to the one - // returned here to make sure everything was done as expected. + // returned here to make sure everything has been done as expected. message Body { // Unique identifier of the newly created container neo.fs.v2.refs.ContainerID container_id = 1; @@ -137,8 +137,8 @@ message PutResponse { // Container removal request message DeleteRequest { - // Container removal request body has a signed `ContainerID` as a proof of - // container owner's intent. The signature will be verified by `Container` + // Container removal request body has signed `ContainerID` as a proof of + // the container owner's intent. The signature will be verified by `Container` // smart contract, so signing algorithm must be supported by NeoVM. message Body { // Identifier of the container to delete from NeoFS @@ -202,7 +202,7 @@ message GetRequest { // Get container structure message GetResponse { // Get container response body does not have container structure signature. It - // was already verified on container creation. + // has been already verified upon container creation. message Body { // Requested container structure Container container = 1; @@ -210,7 +210,7 @@ message GetResponse { // Signature of a stable-marshalled container according to RFC-6979. neo.fs.v2.refs.SignatureRFC6979 signature = 2; - // Session token if the container was created within a session + // Session token if the container has been created within the session neo.fs.v2.session.SessionToken session_token = 3; } // Body of container get response message. @@ -272,7 +272,7 @@ message SetExtendedACLRequest { // Set Extended ACL request body does not have separate `ContainerID` // reference. It will be taken from `EACLTable.container_id` field. message Body { - // Extended ACL table to set for container + // Extended ACL table to set for the container neo.fs.v2.acl.EACLTable eacl = 1; // Signature of stable-marshalled Extended ACL table according to RFC-6979. @@ -294,7 +294,7 @@ message SetExtendedACLRequest { // Set Extended ACL message SetExtendedACLResponse { // `SetExtendedACLResponse` has an empty body because the operation is - // asynchronous and update should be reflected in `Container` smart contract's + // asynchronous and the update should be reflected in `Container` smart contract's // storage after next block is issued in sidechain. message Body { } @@ -334,9 +334,9 @@ message GetExtendedACLRequest { // Get Extended ACL message GetExtendedACLResponse { - // Get Extended ACL Response body can be empty if the requested container did - // not have Extended ACL Table attached or Extended ACL was not allowed at - // container creation. + // Get Extended ACL Response body can be empty if the requested container does + // not have Extended ACL Table attached or Extended ACL has not been allowed at + // the time of container creation. message Body { // Extended ACL requested, if available neo.fs.v2.acl.EACLTable eacl = 1; @@ -364,21 +364,21 @@ message GetExtendedACLResponse { message AnnounceUsedSpaceRequest { // Container used space announcement body. message Body { - // Announcement contains used space information about single container. + // Announcement contains used space information for a single container. message Announcement { - // Epoch number for which container size estimation was produced. + // Epoch number for which the container size estimation was produced. uint64 epoch = 1; // Identifier of the container. neo.fs.v2.refs.ContainerID container_id = 2; - // Used space is a sum of object payload sizes of specified + // Used space is a sum of object payload sizes of a specified // container, stored in the node. It must not include inhumed objects. uint64 used_space = 3; } - // List of announcements. If nodes share several containers, then - // announcements transferred in a batch. + // List of announcements. If nodes share several containers, + // announcements are transferred in a batch. repeated Announcement announcements = 1; } diff --git a/container/types.proto b/container/types.proto index fdb0667..a0e70e3 100644 --- a/container/types.proto +++ b/container/types.proto @@ -10,11 +10,11 @@ import "refs/types.proto"; // Container is a structure that defines object placement behaviour. Objects can // be stored only within containers. They define placement rule, attributes and -// access control information. ID of the container is a 32 byte long SHA256 hash +// access control information. An ID of a container is a 32 byte long SHA256 hash // of stable-marshalled container message. message Container { - // Container format version. Effectively the version of API library used to - // create container. + // Container format version. Effectively, the version of API library used to + // create the container. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Identifier of the container owner @@ -23,13 +23,13 @@ message Container { // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s bytes nonce = 3 [json_name = "nonce"]; - // `BasicACL` contains access control rules for owner, system, others groups - // and permission bits for `BearerToken` and `Extended ACL` + // `BasicACL` contains access control rules for the owner, system and others groups, + // as well as permission bits for `BearerToken` and `Extended ACL` uint32 basic_acl = 4 [json_name = "basicACL"]; // `Attribute` is a user-defined Key-Value metadata pair attached to the - // container. Container attributes are immutable. They are set at container - // creation and can never be added or updated. + // container. Container attributes are immutable. They are set at the moment of + // container creation and can never be added or updated. // // Key name must be a container-unique valid UTF-8 string. Value can't be // empty. Containers with duplicated attribute names or attributes with empty @@ -38,14 +38,14 @@ message Container { // There are some "well-known" attributes affecting system behaviour: // // * __NEOFS__SUBNET \ - // String ID of container's storage subnet. Container can be attached to - // only one subnet. + // String ID of a container's storage subnet. Any container can be attached to + // one subnet only. // * __NEOFS__NAME \ - // String of human-friendly container name registered as the domain in + // String of a human-friendly container name registered as a domain in // NNS contract. // * __NEOFS__ZONE \ - // String of zone for `__NEOFS__NAME`. Used as TLD of domain name in NNS - // contract. If zone is not specified, use default zone: `container`. + // String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS + // contract. If no zone is specified, use default zone: `container`. // // And some well-known attributes used by applications only: // diff --git a/doc/release_instructions.md b/doc/release_instructions.md index 0fc841a..853b08a 100644 --- a/doc/release_instructions.md +++ b/doc/release_instructions.md @@ -1,25 +1,25 @@ # Release instructions -This documents outlines the neofs-api release process, and can be used as a TODO +This documents outlines the neofs-api release process and can be used as a TODO list for a new release. ## Pre-release checks -These should run successfully: +This should run successfully: * `make lint` ## Pre-release actions -These must be run: +This must be run: * `make doc` ## Writing CHANGELOG Add an entry to the CHANGELOG.md following the style established there. -Add a codename for releases with new major version, version and release date in +Add a codename for releases with the new major version, version and release date in the heading. Write a paragraph describing the most significant changes done in -this release. Then add sections with what was added, changed and removed, +this release. Then add sections with what has been added, changed and removed, describing each change briefly with a reference to GitHub issues, where available. diff --git a/lock/types.proto b/lock/types.proto index fea7fe6..edf141e 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -7,7 +7,7 @@ option csharp_namespace = "Neo.FileStorage.API.Lock"; import "refs/types.proto"; -// Lock objects protects a list of objects from being deleted. Lifetime of the +// Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in // `__NEOFS__EXPIRATION_EPOCH` attribute. message Lock { diff --git a/netmap/service.proto b/netmap/service.proto index 5a573c6..b0d4064 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -9,16 +9,16 @@ import "netmap/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// `NetmapService` provides methods to work with `Network Map` and information +// `NetmapService` provides methods to work with `Network Map` and the information // required to build it. The resulting `Network Map` is stored in sidechain // `Netmap` smart contract, while related information can be obtained from other // NeoFS nodes. service NetmapService { - // Get NodeInfo structure from the particular node directly. Node information - // can be taken from `Netmap` smart contract, but in some cases the one may - // want to get recent information directly, or to talk to the node not yet - // present in `Network Map` to find out what API version can be used for - // further communication. Can also be used to check if node is up and running. + // Get NodeInfo structure from the particular node directly. + // Node information can be taken from `Netmap` smart contract. In some cases, though, + // one may want to get recent information directly or to talk to the node not yet + // present in the `Network Map` to find out what API version can be used for + // further communication. This can be also used to check if a node is up and running. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -35,7 +35,7 @@ service NetmapService { rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); } -// Get NodeInfo structure from the particular node directly +// Get NodeInfo structure directly from a particular node message LocalNodeInfoRequest { // LocalNodeInfo request body is empty. message Body { @@ -76,7 +76,7 @@ message LocalNodeInfoResponse { neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Get NetworkInfo structure with the network view from particular node. +// Get NetworkInfo structure with the network view from a particular node. message NetworkInfoRequest { // NetworkInfo request body is empty. message Body { diff --git a/netmap/types.proto b/netmap/types.proto index 2e8dc7c..cba74dd 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -41,7 +41,7 @@ enum Operation { // just groups nodes into a bucket by attribute, selecting nodes only by their // hash distance. enum Clause { - // No modifier defined. Will select nodes from bucket randomly. + // No modifier defined. Nodes will be selected from the bucket randomly CLAUSE_UNSPECIFIED = 0; // SAME will select only nodes having the same value of bucket attribute @@ -51,10 +51,10 @@ enum Clause { DISTINCT = 2; } -// Filter will return the subset of nodes from `NetworkMap` or another filter's -// results, that will satisfy filter's conditions. +// This filter will return the subset of nodes from `NetworkMap` or another filter's +// results that will satisfy filter's conditions. message Filter { - // Name of the filter or a reference to the named filter. '*' means + // Name of the filter or a reference to a named filter. '*' means // application to the whole unfiltered NetworkMap. At top level it's used as a // filter name. At lower levels it's considered to be a reference to another // named filter @@ -86,7 +86,7 @@ message Selector { // Selector modifier showing how to form a bucket Clause clause = 3 [json_name = "clause"]; - // Attribute bucket to select from + // Bucket attribute to select from string attribute = 4 [json_name = "attribute"]; // Filter reference to select from @@ -94,7 +94,7 @@ message Selector { } // Number of object replicas in a set of nodes from the defined selector. If no -// selector set the root bucket containing all possible nodes will be used by +// selector set, the root bucket containing all possible nodes will be used by // default. message Replica { // How many object replicas to put @@ -204,7 +204,7 @@ message NodeInfo { // automatically from `UN-LOCODE` attribute. // // For detailed description of each well-known attribute please see the - // corresponding section in NeoFS Technical specification. + // corresponding section in NeoFS Technical Specification. message Attribute { // Key of the node attribute string key = 1 [json_name = "key"]; diff --git a/object/service.proto b/object/service.proto index 4170e1d..8ad4330 100644 --- a/object/service.proto +++ b/object/service.proto @@ -10,14 +10,14 @@ import "refs/types.proto"; import "session/types.proto"; // `ObjectService` provides API for manipulating objects. Object operations do -// not interact with sidechain and are only served by nodes in p2p style. +// not affect the sidechain and are only served by nodes in p2p style. service ObjectService { // Receive full object structure, including Headers and payload. Response uses - // gRPC stream. First response message carries object with requested address. + // gRPC stream. First response message carries the object with the requested address. // Chunk messages are parts of the object's payload if it is needed. All - // messages, except the first one, carry payload chunks. Requested object can + // messages, except the first one, carry payload chunks. The requested object can // be restored by concatenation of object message payload and all chunks - // keeping receiving order. + // keeping the receiving order. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -40,7 +40,7 @@ service ObjectService { // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see // session package). Chunk messages are considered by server as a part of an // object payload. All messages, except first one, SHOULD be payload chunks. - // Chunk messages SHOULD be sent in direct order of fragmentation. + // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -82,7 +82,7 @@ service ObjectService { // Returns the object Headers without data payload. By default full header is // returned. If `main_only` request field is set, the short header with only - // the very minimal information would be returned instead. + // the very minimal information will be returned instead. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -118,7 +118,7 @@ service ObjectService { // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be - // restored by concatenation of all received payload chunks keeping receiving + // restored by concatenation of all received payload chunks keeping the receiving // order. // // Statuses: @@ -139,8 +139,8 @@ service ObjectService { // Returns homomorphic or regular hash of object's payload range after // applying XOR operation with the provided `salt`. Ranges are set of (offset, - // length) tuples. Hashes order in response corresponds to ranges order in - // request. Note that hash is calculated for XORed data. + // length) tuples. Hashes order in response corresponds to the ranges order in + // the request. Note that hash is calculated for XORed data. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -353,12 +353,12 @@ message HeadRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Tuple of full object header and signature of `ObjectID`. \ +// Tuple of a full object header and signature of an `ObjectID`. \ // Signed `ObjectID` is present to verify full header's authenticity through the // following steps: // -// 1. Calculate `SHA-256` of marshalled `Header` structure -// 2. Check if the resulting hash matched `ObjectID` +// 1. Calculate `SHA-256` of the marshalled `Header` structure +// 2. Check if the resulting hash matches `ObjectID` // 3. Check if `ObjectID` signature in `signature` field is correct message HeaderWithSignature { // Full object header @@ -407,13 +407,13 @@ message SearchRequest { // Version of the Query Language used uint32 version = 2; - // Filter structure checks if object header field or attribute content + // Filter structure checks if the object header field or the attribute content // matches a value. // - // If no filters set, search request will return all objects of the + // If no filters are set, search request will return all objects of the // container, including Regular object, Tombstones and Storage Group // objects. Most human users expect to get only object they can directly - // work with. In that case the `$Object:ROOT` filter should be used. + // work with. In that case, `$Object:ROOT` filter should be used. // // By default `key` field refers to the corresponding object's `Attribute`. // Some Object's header fields can also be accessed by adding `$Object:` @@ -446,10 +446,10 @@ message SearchRequest { // properties: // // * $Object:ROOT \ - // Returns only `REGULAR` type objects that are not split or are the top + // Returns only `REGULAR` type objects that are not split or that are the top // level root objects in a split hierarchy. This includes objects not // present physically, like large objects split into smaller objects - // without separate top-level root object. Other type objects like + // without a separate top-level root object. Objects of other types like // StorageGroups and Tombstones will not be shown. This filter may be // useful for listing objects like `ls` command of some virtual file // system. This filter is activated if the `key` exists, disregarding the diff --git a/object/types.proto b/object/types.proto index 2980b39..40b1eb6 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,7 +9,7 @@ import "refs/types.proto"; import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by maximal +// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum // object size. // // String presentation of object type is the same as definition: @@ -51,7 +51,7 @@ enum MatchType { // Short header fields message ShortHeader { - // Object format version. Effectively the version of API library used to + // Object format version. Effectively, the version of API library used to // create particular object. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; @@ -77,7 +77,7 @@ message ShortHeader { // Object Header message Header { - // Object format version. Effectively the version of API library used to + // Object format version. Effectively, the version of API library used to // create particular object neo.fs.v2.refs.Version version = 1 [json_name = "version"]; @@ -107,10 +107,10 @@ message Header { // integrity and authenticity out of Request scope. neo.fs.v2.session.SessionToken session_token = 9 [json_name = "sessionToken"]; - // `Attribute` is a user-defined Key-Value metadata pair attached to the + // `Attribute` is a user-defined Key-Value metadata pair attached to an // object. // - // Key name must be a object-unique valid UTF-8 string. Value can't be empty. + // Key name must be an object-unique valid UTF-8 string. Value can't be empty. // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // @@ -141,7 +141,7 @@ message Header { // MIME Content Type of object's payload // // For detailed description of each well-known attribute please see the - // corresponding section in NeoFS Technical specification. + // corresponding section in NeoFS Technical Specification. message Attribute { // string key to the object attribute string key = 1 [json_name = "key"]; @@ -182,8 +182,8 @@ message Header { } // Object structure. Object is immutable and content-addressed. It means -// `ObjectID` will change if header or payload changes. It's calculated as a -// hash of header field, which contains hash of object's payload. +// `ObjectID` will change if the header or the payload changes. It's calculated as a +// hash of header field which contains hash of the object's payload. // // For non-regular object types payload format depends on object type specified // in the header. @@ -201,20 +201,20 @@ message Object { bytes payload = 4 [json_name = "payload"]; } -// Meta information of split hierarchy for object assembly. With last part -// one can traverse linked list of split hierarchy back to first part and -// assemble original object. With linking object one can assembly object -// straight away from the object parts. +// Meta information of split hierarchy for object assembly. With the last part +// one can traverse linked list of split hierarchy back to the first part and +// assemble the original object. With a linking object one can assemble an object +// right from the object parts. message SplitInfo { // 16 byte UUID used to identify the split object hierarchy parts. bytes split_id = 1; - // Identifier of the last object in split hierarchy parts. It contains - // split header with original object header. + // The identifier of the last object in split hierarchy parts. It contains + // split header with the original object header. neo.fs.v2.refs.ObjectID last_part = 2; - // Identifier of linking object for split hierarchy parts. It contains - // split header with original object header and sorted list of + // The identifier of a linking object for split hierarchy parts. It contains + // split header with the original object header and a sorted list of // object parts. neo.fs.v2.refs.ObjectID link = 3; } diff --git a/refs/types.proto b/refs/types.proto index bd3060b..c0c1030 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -7,7 +7,7 @@ option csharp_namespace = "Neo.FileStorage.API.Refs"; // Objects in NeoFS are addressed by their ContainerID and ObjectID. // -// String presentation of `Address` is the concatenation of string encoded +// String presentation of `Address` is a concatenation of string encoded // `ContainerID` and `ObjectID` delimited by '/' character. message Address { // Container identifier @@ -17,17 +17,17 @@ message Address { } // NeoFS Object unique identifier. Objects are immutable and content-addressed. -// It means `ObjectID` will change if `header` or `payload` changes. +// It means `ObjectID` will change if the `header` or the `payload` changes. // // `ObjectID` is a 32 byte long // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// object's `header` field, which, in it's turn, contains hash of object's +// the object's `header` field, which, in it's turn, contains the hash of the object's // payload. // -// String presentation is +// String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. // -// JSON value will be the data encoded as a string using standard base64 +// JSON value will be data encoded as a string using standard base64 // encoding with paddings. Either // [standard](https://tools.ietf.org/html/rfc4648#section-4) or // [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -44,10 +44,10 @@ message ObjectID { // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of // stable-marshalled container message. // -// String presentation is +// String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. // -// JSON value will be the data encoded as a string using standard base64 +// JSON value will be data encoded as a string using standard base64 // encoding with paddings. Either // [standard](https://tools.ietf.org/html/rfc4648#section-4) or // [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -64,10 +64,10 @@ message ContainerID { // `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte // followed by 20 bytes of ScrptHash and 4 bytes of checksum. // -// String presentation is [Base58 +// String presentation is a [Base58 // Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. // -// JSON value will be the data encoded as a string using standard base64 +// JSON value will be data encoded as a string using standard base64 // encoding with paddings. Either // [standard](https://tools.ietf.org/html/rfc4648#section-4) or // [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -81,7 +81,7 @@ message OwnerID { // // String representation of a value is base-10 integer. // -// JSON representation is an object containing single `value` number field. +// JSON representation is an object containing a single `value` number field. message SubnetID { // 4-byte integer subnetwork identifier. fixed32 value = 1 [json_name = "value"]; @@ -90,7 +90,7 @@ message SubnetID { // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string -// with 'v' prefix. I.e. `vX.Y`, where `X` - major number, `Y` - minor number. +// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. message Version { // Major API version uint32 major = 1 [json_name = "major"]; @@ -139,7 +139,7 @@ enum ChecksumType { } // Checksum message. -// Depending on checksum algorithm type the string presentation may vary: +// Depending on checksum algorithm type, the string presentation may vary: // // * TZ \ // Hex encoded string without `0x` prefix diff --git a/reputation/service.proto b/reputation/service.proto index a556405..c430c5e 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -22,7 +22,7 @@ service ReputationService { // - Common failures (SECTION_FAILURE_COMMON). rpc AnnounceLocalTrust (AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); - // Announces the intermediate result of the iterative algorithm for + // Announce the intermediate result of the iterative algorithm for // calculating the global reputation of the node in NeoFS network. // // Statuses: @@ -41,7 +41,7 @@ message AnnounceLocalTrustRequest { // List of normalized local trust values to other NeoFS nodes. The value // is calculated according to EigenTrust++ algorithm and must be a - // floating point number in the [0;1] range. + // floating point number in [0;1] range. repeated Trust trusts = 2; } @@ -58,11 +58,11 @@ message AnnounceLocalTrustRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Node's local trust information announce response. +// Node's local trust information announcement response. message AnnounceLocalTrustResponse { - // Response to the node's local trust information announce has an empty body + // Response to the node's local trust information announcement has an empty body // because the trust exchange operation is asynchronous. If Trust information - // will not pass sanity checks it is silently ignored. + // does not pass sanity checks, it is silently ignored. message Body { } @@ -106,11 +106,11 @@ message AnnounceIntermediateResultRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// Intermediate global trust information announce response. +// Intermediate global trust information announcement response. message AnnounceIntermediateResultResponse { - // Response to the node's intermediate global trust information announce has + // Response to the node's intermediate global trust information announcement has // an empty body because the trust exchange operation is asynchronous. If - // Trust information will not pass sanity checks it is silently ignored. + // Trust information does not pass sanity checks, it is silently ignored. message Body { } diff --git a/reputation/types.proto b/reputation/types.proto index bed5508..627008d 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -7,13 +7,13 @@ option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "refs/types.proto"; -// NeoFS unique peer identifier is 33 byte long compressed public key of the +// NeoFS unique peer identifier is a 33 byte long compressed public key of the // node, the same as the one stored in the network map. // -// String presentation is +// String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. // -// JSON value will be the data encoded as a string using standard base64 +// JSON value will be data encoded as a string using standard base64 // encoding with paddings. Either // [standard](https://tools.ietf.org/html/rfc4648#section-4) or // [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -43,7 +43,7 @@ message PeerToPeerTrust { // Global trust level to NeoFS node. message GlobalTrust { - // Message format version. Effectively the version of API library used to create + // Message format version. Effectively, the version of API library used to create // the message. neo.fs.v2.refs.Version version = 1 [json_name = "version"]; // Message body structure. diff --git a/session/service.proto b/session/service.proto index aff4959..98c2ca4 100644 --- a/session/service.proto +++ b/session/service.proto @@ -13,7 +13,7 @@ import "session/types.proto"; // attached in requests for further verification. Please see corresponding // section of NeoFS Technical Specification for details. service SessionService { - // Opens a new session between two peers. + // Open a new session between two peers. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -31,7 +31,7 @@ message CreateRequest { // Session expiration `Epoch` uint64 expiration = 2; } - // Body of create session token request message. + // Body of a create session token request message. Body body = 1; // Carries request meta information. Header data is used only to regulate diff --git a/session/types.proto b/session/types.proto index 4eff307..27fae8b 100644 --- a/session/types.proto +++ b/session/types.proto @@ -117,10 +117,10 @@ message SessionToken { neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; } -// Extended headers for Request/Response. May contain any user-defined headers +// Extended headers for Request/Response. They may contain any user-defined headers // to be interpreted on application level. // -// Key name must be unique valid UTF-8 string. Value can't be empty. Requests or +// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or // Responses with duplicated header names or headers with empty values will be // considered invalid. // @@ -133,9 +133,9 @@ message SessionToken { // current epoch only will be used. // * __NEOFS__NETMAP_LOOKUP_DEPTH \ // If object can't be found using current epoch's netmap, this header limits -// how many past epochs back the node can lookup. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, the -// current epoch only will be used. +// how many past epochs the node can look up through. The `value` is string +// encoded `uint64` in decimal presentation. If set to '0' or not set, only the +// current epoch will be used. message XHeader { // Key of the X-Header string key = 1 [json_name = "key"]; @@ -194,9 +194,9 @@ message ResponseMetaHeader { neo.fs.v2.status.Status status = 6 [json_name = "status"]; } -// Verification info for request signed by all intermediate nodes. +// Verification info for the request signed by all intermediate nodes. message RequestVerificationHeader { - // Request Body signature. Should be generated once by request initiator. + // Request Body signature. Should be generated once by the request initiator. neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; // Request Meta signature is added and signed by each intermediate node neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; @@ -207,9 +207,9 @@ message RequestVerificationHeader { RequestVerificationHeader origin = 4 [json_name = "origin"]; } -// Verification info for response signed by all intermediate nodes +// Verification info for the response signed by all intermediate nodes message ResponseVerificationHeader { - // Response Body signature. Should be generated once by answering node. + // Response Body signature. Should be generated once by an answering node. neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; // Response Meta signature is added and signed by each intermediate node neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; diff --git a/status/types.proto b/status/types.proto index 25645a0..bf57c4a 100644 --- a/status/types.proto +++ b/status/types.proto @@ -23,12 +23,12 @@ option csharp_namespace = "Neo.FileStorage.API.Status"; // // All outcomes are divided into successful and failed, which corresponds // to the success or failure of the operation. The definition of success -// follows from the semantics of RPC and the description of its purpose. -// The server must not attach code that is the opposite of outcome type. +// follows the semantics of RPC and the description of its purpose. +// The server must not attach code that is the opposite of the outcome type. // // See the set of return codes in the description for calls. // -// Each status can carry developer-facing error message. It should be human +// Each status can carry a developer-facing error message. It should be a human // readable text in English. The server should not transmit (and the client // should not expect) useful information in the message. Field `details` // should make the return more detailed. diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 21663ff..fe4ac62 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -8,8 +8,8 @@ option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; import "refs/types.proto"; // StorageGroup keeps verification information for Data Audit sessions. Objects -// that require payed storage guaranties are gathered in `StorageGroups` with -// additional information used for proof of storage. `StorageGroup` only +// that require paid storage guarantees are gathered in `StorageGroups` with +// additional information used for the proof of storage. `StorageGroup` only // contains objects from the same container. message StorageGroup { // Total size of the payloads of objects in the storage group diff --git a/tombstone/types.proto b/tombstone/types.proto index 4ad3c06..5a94d3b 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -7,17 +7,17 @@ option csharp_namespace = "Neo.FileStorage.API.Tombstone"; import "refs/types.proto"; -// Tombstone keeps record of deleted objects for few epochs until they are +// Tombstone keeps record of deleted objects for a few epochs until they are // purged from the NeoFS network. message Tombstone { - // Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone - // creator depending on current NeoFS network settings. Tombstone object + // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone + // creator depending on the current NeoFS network settings. A tombstone object // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` - // attribute. Otherwise tombstone will be rejected by storage node. + // attribute. Otherwise, the tombstone will be rejected by a storage node. uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; // 16 byte UUID used to identify the split object hierarchy parts. Must be - // unique inside container. All objects participating in the split must + // unique inside a container. All objects participating in the split must // have the same `split_id` value. bytes split_id = 2 [json_name = "splitID"]; From cd5fdbbd5598812f5c7aa687a67a5509970835f3 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Sat, 5 Mar 2022 13:57:52 +0300 Subject: [PATCH 353/440] Clarification for eXtended Headers in MetaHeader Minor clarification to show how XHeaders should be used. Signed-off-by: Stanislav Bogatyrev --- object/service.proto | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/object/service.proto b/object/service.proto index 8ad4330..248fe89 100644 --- a/object/service.proto +++ b/object/service.proto @@ -19,6 +19,16 @@ service ObjectService { // be restored by concatenation of object message payload and all chunks // keeping the receiving order. // + // Extended headers can change `Get` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of network map to find an object until the depth + // limit reached. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully read; @@ -42,6 +52,13 @@ service ObjectService { // object payload. All messages, except first one, SHOULD be payload chunks. // Chunk messages SHOULD be sent in the direct order of fragmentation. // + // Extended headers can change `Put` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully saved in the container; @@ -66,6 +83,13 @@ service ObjectService { // Delete the object from a container. There is no immediate removal // guarantee. Object will be marked for removal and deleted eventually. // + // Extended headers can change `Delete` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully marked to be removed from the container; @@ -84,6 +108,13 @@ service ObjectService { // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // + // Extended headers can change `Head` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // object header has been successfully read; @@ -104,6 +135,13 @@ service ObjectService { // Header's filed values. Please see the corresponding NeoFS Technical // Specification section for more details. // + // Extended headers can change `Search` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // objects have been successfully selected; @@ -121,6 +159,16 @@ service ObjectService { // restored by concatenation of all received payload chunks keeping the receiving // order. // + // Extended headers can change `GetRange` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of network map to find an object until the depth + // limit reached. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // data range of the object payload has been successfully read; @@ -142,6 +190,16 @@ service ObjectService { // length) tuples. Hashes order in response corresponds to the ranges order in // the request. Note that hash is calculated for XORed data. // + // Extended headers can change `GetRangeHash` behaviour: + // * __NEOFS__NETMAP_EPOCH \ + // Will use the requsted version of Network Map for object placement + // calculation. + // * __NEOFS__NETMAP_LOOKUP_DEPTH \ + // Will try older versions of network map to find an object until the depth + // limit reached. + // + // Please refer to detailed `XHeader` description. + // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // data range of the object payload has been successfully hashed; From f741ea6f4a5131b8ff39f33744cb3ce0235888cb Mon Sep 17 00:00:00 2001 From: Elizaveta Chichindaeva Date: Fri, 13 May 2022 13:27:30 +0300 Subject: [PATCH 354/440] Update Signed-off-by: Elizaveta Chichindaeva --- object/service.proto | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/object/service.proto b/object/service.proto index 248fe89..58fbf03 100644 --- a/object/service.proto +++ b/object/service.proto @@ -24,8 +24,9 @@ service ObjectService { // Will use the requsted version of Network Map for object placement // calculation. // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of network map to find an object until the depth - // limit reached. + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // the latest one otherwise) of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // @@ -164,8 +165,8 @@ service ObjectService { // Will use the requsted version of Network Map for object placement // calculation. // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of network map to find an object until the depth - // limit reached. + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // @@ -195,8 +196,8 @@ service ObjectService { // Will use the requsted version of Network Map for object placement // calculation. // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions of network map to find an object until the depth - // limit reached. + // Will try older versions of Network Map to find an object until the depth + // limit is reached. // // Please refer to detailed `XHeader` description. // From 8bf98ec983cb324fef4f56fc0088246ba918078c Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 9 Mar 2022 14:39:08 +0300 Subject: [PATCH 355/440] Use well-known expiration attribute for SGs To avoid ambiguity, let's use the common well-known attribute to control both Object and Storage Group expirations. Signed-off-by: Stanislav Bogatyrev --- proto-docs/storagegroup.md | 7 ++++++- storagegroup/types.proto | 10 ++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index beb0811..4428595 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -30,12 +30,17 @@ that require payed storage guaranties are gathered in `StorageGroups` with additional information used for proof of storage. `StorageGroup` only contains objects from the same container. +Being an object payload, StorageGroup may have expiration Epoch set with +`__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +will be ignored by InnerRing nodes during Data Audit cycles and will be +deleted by Storage Nodes. + | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | validation_data_size | [uint64](#uint64) | | Total size of the payloads of objects in the storage group | | validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the `members` field. | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the storage group lifetime | +| expiration_epoch | [uint64](#uint64) | | DEPRECATED. Last NeoFS epoch number of the storage group lifetime | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Strictly ordered list of storage group member objects | diff --git a/storagegroup/types.proto b/storagegroup/types.proto index fe4ac62..ced8c16 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -11,6 +11,12 @@ import "refs/types.proto"; // that require paid storage guarantees are gathered in `StorageGroups` with // additional information used for the proof of storage. `StorageGroup` only // contains objects from the same container. +// +// Being an object payload, StorageGroup may have expiration Epoch set with +// `__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// will be ignored by InnerRing nodes during Data Audit cycles and will be +// deleted by Storage Nodes. +// message StorageGroup { // Total size of the payloads of objects in the storage group uint64 validation_data_size = 1 [json_name = "validationDataSize"]; @@ -20,8 +26,8 @@ message StorageGroup { // members in the `members` field. neo.fs.v2.refs.Checksum validation_hash = 2 [json_name = "validationHash"]; - // Last NeoFS epoch number of the storage group lifetime - uint64 expiration_epoch = 3 [json_name = "expirationEpoch"]; + // DEPRECATED. Last NeoFS epoch number of the storage group lifetime + uint64 expiration_epoch = 3 [json_name = "expirationEpoch", deprecated = true]; // Strictly ordered list of storage group member objects repeated neo.fs.v2.refs.ObjectID members = 4 [json_name = "members"]; From 869fb641555b001bf16164cebb4adb1346461eda Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 18 Mar 2022 17:49:45 +0300 Subject: [PATCH 356/440] [#208] status: Add `OUT_OF_RANGE` status in Object section Signed-off-by: Evgenii Stratonikov --- object/service.proto | 4 ++++ status/types.proto | 3 +++ 2 files changed, 7 insertions(+) diff --git a/object/service.proto b/object/service.proto index 58fbf03..22d7948 100644 --- a/object/service.proto +++ b/object/service.proto @@ -184,6 +184,8 @@ service ObjectService { // provided session token has expired; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after @@ -211,6 +213,8 @@ service ObjectService { // access to operation RANGEHASH of the object is denied; // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds. // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); diff --git a/status/types.proto b/status/types.proto index bf57c4a..a44cf6a 100644 --- a/status/types.proto +++ b/status/types.proto @@ -115,6 +115,9 @@ enum Object { // [**2052**] Object has been marked deleted. OBJECT_ALREADY_REMOVED = 4; + + // [**2053**] Invalid range has been requested for an object. + OUT_OF_RANGE = 5; } // Section of statuses for container-related operations. From 64ab86a1ff63c56af0de4b74a17d5a4fbc2dcacd Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 27 May 2022 14:45:24 +0300 Subject: [PATCH 357/440] [#217] container: Add homomorphic hashing well-known attribute Signed-off-by: Pavel Karpy --- container/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container/types.proto b/container/types.proto index a0e70e3..a710a4b 100644 --- a/container/types.proto +++ b/container/types.proto @@ -46,6 +46,12 @@ message Container { // * __NEOFS__ZONE \ // String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS // contract. If no zone is specified, use default zone: `container`. + // * __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ + // Disables homomorphic hashing for the container if the value equals "true" string. + // Any other values are interpreted as missing attribute. Container could be + // accepted in a NeoFS network only if the global network hashing configuration + // value corresponds with that attribute's value. After container inclusion, network + // setting is ignored. // // And some well-known attributes used by applications only: // From e31fcad6b85f0d7f4565e9adc4a5d204b9f7872a Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 27 May 2022 14:54:48 +0300 Subject: [PATCH 358/440] [#221] lock: Clarify lock object usage Signed-off-by: Pavel Karpy --- lock/types.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lock/types.proto b/lock/types.proto index edf141e..da811b8 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -9,7 +9,8 @@ import "refs/types.proto"; // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__NEOFS__EXPIRATION_EPOCH` attribute. +// `__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// It is impossible to delete a lock object via ObjectService.Delete RPC call. message Lock { // List of objects to lock. Must not be empty or carry empty IDs. // All members must be of the `REGULAR` type. From 5bd512774c0660f71ce3899517d656e4d680cf18 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 6 Jun 2022 18:38:15 +0300 Subject: [PATCH 359/440] [#222] storagegroup: Force members to be unique Signed-off-by: Pavel Karpy --- storagegroup/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storagegroup/types.proto b/storagegroup/types.proto index ced8c16..c54c741 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -29,6 +29,6 @@ message StorageGroup { // DEPRECATED. Last NeoFS epoch number of the storage group lifetime uint64 expiration_epoch = 3 [json_name = "expirationEpoch", deprecated = true]; - // Strictly ordered list of storage group member objects + // Strictly ordered list of storage group member objects. Members MUST be unique repeated neo.fs.v2.refs.ObjectID members = 4 [json_name = "members"]; } From 66cc44e72709f12f184f84f1bea9d8a46c233acf Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 15 Mar 2022 15:49:35 +0300 Subject: [PATCH 360/440] refs: add WalletConnect signature type Signed-off-by: Evgenii Stratonikov --- refs/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/refs/types.proto b/refs/types.proto index c0c1030..729fc1b 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -116,6 +116,10 @@ enum SignatureScheme { // Deterministic ECDSA with SHA-256 hashing (RFC 6979) ECDSA_RFC6979_SHA256 = 1; + + // Deterministic ECDSA with SHA-256 hashing using WalletConnect API. + // Here the algorithm is the same, but the message format differs. + ECDSA_RFC6979_SHA256_WALLET_CONNECT = 2; } // RFC 6979 signature. From 2f52216400253c06d197cb88f15d0b3111f6e721 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 16 Jun 2022 23:59:59 +0300 Subject: [PATCH 361/440] [#225] status: Add signature related status Signed-off-by: Pavel Karpy --- status/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/status/types.proto b/status/types.proto index a44cf6a..6e05f62 100644 --- a/status/types.proto +++ b/status/types.proto @@ -95,6 +95,9 @@ enum CommonFail { // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit // unsigned integer). WRONG_MAGIC_NUMBER = 1; + + // [**1026**] Signature verification failure. + SIGNATURE_VERIFICATION_FAIL = 2; } // Section of statuses for object-related operations. From 1bc50fc2a9382de4728fee0b2ed8c12d251e6b4a Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 21 Jun 2022 14:32:14 +0300 Subject: [PATCH 362/440] [#227] *: Regenerate docs Signed-off-by: Pavel Karpy --- proto-docs/accounting.md | 8 +-- proto-docs/acl.md | 26 ++++---- proto-docs/audit.md | 8 +-- proto-docs/container.md | 62 +++++++++--------- proto-docs/lock.md | 5 +- proto-docs/netmap.md | 30 ++++----- proto-docs/object.md | 125 ++++++++++++++++++++++++++++--------- proto-docs/refs.md | 25 ++++---- proto-docs/reputation.md | 24 +++---- proto-docs/session.md | 22 +++---- proto-docs/status.md | 8 ++- proto-docs/storagegroup.md | 6 +- proto-docs/tombstone.md | 6 +- 13 files changed, 214 insertions(+), 141 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 6d36189..94de765 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -39,7 +39,7 @@ Accounting service provides methods for interaction with NeoFS sidechain via other NeoFS nodes to get information about the account balance. Deposit and Withdraw operations can't be implemented here, as they require Mainnet NeoFS smart contract invocation. Transfer operations between internal NeoFS -accounts are possible, if both use the same token type. +accounts are possible if both use the same token type. ``` rpc Balance(BalanceRequest) returns (BalanceResponse); @@ -77,7 +77,7 @@ BalanceRequest message ### Message BalanceRequest.Body -To indicate the account for which the balance is requested, it's identifier +To indicate the account for which the balance is requested, its identifier is used. It can be any existing account in NeoFS sidechain `Balance` smart contract. If omitted, client implementation MUST set it to the request's signer `OwnerID`. @@ -105,7 +105,7 @@ BalanceResponse message ### Message BalanceResponse.Body The amount of funds in GAS token for the `OwnerID`'s account requested. -Balance is `Decimal` format to avoid precision issues with rounding. +Balance is given in the `Decimal` format to avoid precision issues with rounding. | Field | Type | Label | Description | @@ -141,7 +141,7 @@ description. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| value | [int64](#int64) | | Number in smallest Token fractions. | +| value | [int64](#int64) | | Number in the smallest Token fractions. | | precision | [uint32](#uint32) | | Precision value indicating how many smallest fractions can be in one integer. | diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 943dae4..80416c5 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -38,8 +38,8 @@ like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be used in the similar use cases, like providing authorisation to externally authenticated party. -BearerToken can be issued only by container's owner and must be signed using -the key associated with container's `OwnerID`. +BearerToken can be issued only by the container's owner and must be signed using +the key associated with the container's `OwnerID`. | Field | Type | Label | Description | @@ -51,14 +51,14 @@ the key associated with container's `OwnerID`. ### Message BearerToken.Body -Bearer Token body structure contains Extended ACL table issued by container -owner with additional information preventing token's abuse. +Bearer Token body structure contains Extended ACL table issued by the container +owner with additional information preventing token abuse. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container | -| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` to whom the token was issued. Must match the request originator's `OwnerID`. If empty, any token bearer will be accepted. | +| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container. If it contains `container_id` field, bearer token is only valid for this specific container. Otherwise, any container of the same owner is allowed. | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` defines to whom the token was issued. It must match the request originator's `OwnerID`. If empty, any token bearer will be accepted. | | lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | @@ -93,7 +93,7 @@ Describes a single eACL rule. ### Message EACLRecord.Filter -Filter to check particular properties of the request or object. +Filter to check particular properties of the request or the object. By default `key` field refers to the corresponding object's `Attribute`. Some Object's header fields can also be accessed by adding `$Object:` @@ -149,15 +149,15 @@ keys to match. ### Message EACLTable -Extended ACL rules table. Defined a list of ACL rules additionally to Basic -ACL. Extended ACL rules can be attached to the container and can be updated +Extended ACL rules table. A list of ACL rules defined additionally to Basic +ACL. Extended ACL rules can be attached to a container and can be updated or may be defined in `BearerToken` structure. Please see the corresponding -NeoFS Technical Specification's section for detailed description. +NeoFS Technical Specification section for detailed description. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | eACL format version. Effectively the version of API library used to create eACL Table. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | eACL format version. Effectively, the version of API library used to create eACL Table. | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container that should use given access control rules | | records | [EACLRecord](#neo.fs.v2.acl.EACLRecord) | repeated | List of Extended ACL rules | @@ -233,8 +233,8 @@ Target role of the access control rule in access control list. | ---- | ------ | ----------- | | ROLE_UNSPECIFIED | 0 | Unspecified role, default value | | USER | 1 | User target rule is applied if sender is the owner of the container | -| SYSTEM | 2 | System target rule is applied if sender is the storage node within the container or inner ring node | -| OTHERS | 3 | Others target rule is applied if sender is not user nor system target | +| SYSTEM | 2 | System target rule is applied if sender is a storage node within the container or an inner ring node | +| OTHERS | 3 | Others target rule is applied if sender is neither a user nor a system target | diff --git a/proto-docs/audit.md b/proto-docs/audit.md index 073c2cb..b8d2010 100644 --- a/proto-docs/audit.md +++ b/proto-docs/audit.md @@ -31,7 +31,7 @@ generated separately. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Data Audit Result format version. Effectively the version of API library used to report DataAuditResult structure. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Data Audit Result format version. Effectively, the version of API library used to report DataAuditResult structure. | | audit_epoch | [fixed64](#fixed64) | | Epoch number when the Data Audit was conducted | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Container under audit | | public_key | [bytes](#bytes) | | Public key of the auditing InnerRing node in a binary format | @@ -40,9 +40,9 @@ generated separately. | retries | [uint32](#uint32) | | Number of retries done at PoR stage | | pass_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that passed audit PoR stage | | fail_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that failed audit PoR stage | -| hit | [uint32](#uint32) | | Number of sampled objects under audit placed in an optimal way according to the containers placement policy when checking PoP | -| miss | [uint32](#uint32) | | Number of sampled objects under audit placed in suboptimal way according to the containers placement policy, but still at a satisfactory level when checking PoP | -| fail | [uint32](#uint32) | | Number of sampled objects under audit stored in a way not confirming placement policy or not found at all when checking PoP | +| hit | [uint32](#uint32) | | Number of sampled objects under the audit placed in an optimal way according to the containers placement policy when checking PoP | +| miss | [uint32](#uint32) | | Number of sampled objects under the audit placed in suboptimal way according to the containers placement policy, but still at a satisfactory level when checking PoP | +| fail | [uint32](#uint32) | | Number of sampled objects under the audit stored inconsistently with the placement policy or not found at all when checking PoP | | pass_nodes | [bytes](#bytes) | repeated | List of storage node public keys that passed at least one PDP | | fail_nodes | [bytes](#bytes) | repeated | List of storage node public keys that failed at least one PDP | diff --git a/proto-docs/container.md b/proto-docs/container.md index a0e9684..d11243d 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -81,7 +81,7 @@ rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceRespon `Put` invokes `Container` smart contract's `Put` method and returns response immediately. After a new block is issued in sidechain, request is -verified by Inner Ring nodes. After one more block in sidechain, container +verified by Inner Ring nodes. After one more block in sidechain, the container is added into smart contract storage. Statuses: @@ -96,7 +96,7 @@ Statuses: `Delete` invokes `Container` smart contract's `Delete` method and returns response immediately. After a new block is issued in sidechain, request is -verified by Inner Ring nodes. After one more block in sidechain, container +verified by Inner Ring nodes. After one more block in sidechain, the container is added into smart contract storage. Statuses: @@ -136,7 +136,7 @@ Statuses: #### Method SetExtendedACL Invokes 'SetEACL' method of 'Container` smart contract and returns response -immediately. After one more block in sidechain, Extended ACL changes are +immediately. After one more block in sidechain, changes in an Extended ACL are added into smart contract storage. Statuses: @@ -164,7 +164,7 @@ Statuses: | GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) | #### Method AnnounceUsedSpace -Announce container used space values for P2P synchronization. +Announces the space values used by the container for P2P synchronization. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -198,20 +198,20 @@ Container used space announcement body. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| announcements | [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) | repeated | List of announcements. If nodes share several containers, then announcements transferred in a batch. | +| announcements | [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) | repeated | List of announcements. If nodes share several containers, announcements are transferred in a batch. | ### Message AnnounceUsedSpaceRequest.Body.Announcement -Announcement contains used space information about single container. +Announcement contains used space information for a single container. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| epoch | [uint64](#uint64) | | Epoch number for which container size estimation was produced. | +| epoch | [uint64](#uint64) | | Epoch number for which the container size estimation was produced. | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container. | -| used_space | [uint64](#uint64) | | Used space is a sum of object payload sizes of specified container, stored in the node. It must not include inhumed objects. | +| used_space | [uint64](#uint64) | | Used space is a sum of object payload sizes of a specified container, stored in the node. It must not include inhumed objects. | @@ -251,8 +251,8 @@ Container removal request ### Message DeleteRequest.Body -Container removal request body has a signed `ContainerID` as a proof of -container owner's intent. The signature will be verified by `Container` +Container removal request body has signed `ContainerID` as a proof of +the container owner's intent. The signature will be verified by `Container` smart contract, so signing algorithm must be supported by NeoVM. @@ -324,9 +324,9 @@ Get Extended ACL ### Message GetExtendedACLResponse.Body -Get Extended ACL Response body can be empty if the requested container did -not have Extended ACL Table attached or Extended ACL was not allowed at -container creation. +Get Extended ACL Response body can be empty if the requested container does +not have Extended ACL Table attached or Extended ACL has not been allowed at +the time of container creation. | Field | Type | Label | Description | @@ -377,14 +377,14 @@ Get container structure ### Message GetResponse.Body Get container response body does not have container structure signature. It -was already verified on container creation. +has been already verified upon container creation. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [Container](#neo.fs.v2.container.Container) | | Requested container structure | | signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of a stable-marshalled container according to RFC-6979. | -| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if the container was created within a session | +| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if the container has been created within the session | @@ -483,7 +483,7 @@ New NeoFS Container creation response Container put response body contains information about the newly registered container as seen by `Container` smart contract. `ContainerID` can be calculated beforehand from the container structure and compared to the one -returned here to make sure everything was done as expected. +returned here to make sure everything has been done as expected. | Field | Type | Label | Description | @@ -513,7 +513,7 @@ reference. It will be taken from `EACLTable.container_id` field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for container | +| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for the container | | signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of stable-marshalled Extended ACL table according to RFC-6979. | @@ -534,7 +534,7 @@ Set Extended ACL ### Message SetExtendedACLResponse.Body `SetExtendedACLResponse` has an empty body because the operation is -asynchronous and update should be reflected in `Container` smart contract's +asynchronous and the update should be reflected in `Container` smart contract's storage after next block is issued in sidechain. @@ -558,16 +558,16 @@ storage after next block is issued in sidechain. ### Message Container Container is a structure that defines object placement behaviour. Objects can be stored only within containers. They define placement rule, attributes and -access control information. ID of the container is a 32 byte long SHA256 hash +access control information. An ID of a container is a 32 byte long SHA256 hash of stable-marshalled container message. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively the version of API library used to create container. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Container format version. Effectively, the version of API library used to create the container. | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the container owner | | nonce | [bytes](#bytes) | | Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s | -| basic_acl | [uint32](#uint32) | | `BasicACL` contains access control rules for owner, system, others groups and permission bits for `BearerToken` and `Extended ACL` | +| basic_acl | [uint32](#uint32) | | `BasicACL` contains access control rules for the owner, system and others groups, as well as permission bits for `BearerToken` and `Extended ACL` | | attributes | [Container.Attribute](#neo.fs.v2.container.Container.Attribute) | repeated | Attributes represent immutable container's meta data | | placement_policy | [neo.fs.v2.netmap.PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) | | Placement policy for the object inside the container | @@ -576,8 +576,8 @@ of stable-marshalled container message. ### Message Container.Attribute `Attribute` is a user-defined Key-Value metadata pair attached to the -container. Container attributes are immutable. They are set at container -creation and can never be added or updated. +container. Container attributes are immutable. They are set at the moment of +container creation and can never be added or updated. Key name must be a container-unique valid UTF-8 string. Value can't be empty. Containers with duplicated attribute names or attributes with empty @@ -586,14 +586,20 @@ values will be considered invalid. There are some "well-known" attributes affecting system behaviour: * __NEOFS__SUBNET \ - String ID of container's storage subnet. Container can be attached to - only one subnet. + String ID of a container's storage subnet. Any container can be attached to + one subnet only. * __NEOFS__NAME \ - String of human-friendly container name registered as the domain in + String of a human-friendly container name registered as a domain in NNS contract. * __NEOFS__ZONE \ - String of zone for `__NEOFS__NAME`. Used as TLD of domain name in NNS - contract. If zone is not specified, use default zone: `container`. + String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS + contract. If no zone is specified, use default zone: `container`. +* __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ + Disables homomorphic hashing for the container if the value equals "true" string. + Any other values are interpreted as missing attribute. Container could be + accepted in a NeoFS network only if the global network hashing configuration + value corresponds with that attribute's value. After container inclusion, network + setting is ignored. And some well-known attributes used by applications only: diff --git a/proto-docs/lock.md b/proto-docs/lock.md index b23c734..3bbbf79 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -25,9 +25,10 @@ ### Message Lock -Lock objects protects a list of objects from being deleted. Lifetime of the +Lock objects protects a list of objects from being deleted. The lifetime of a lock object is limited similar to regular objects in -`__NEOFS__EXPIRATION_EPOCH` attribute. +`__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +It is impossible to delete a lock object via ObjectService.Delete RPC call. | Field | Type | Label | Description | diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index a74d41f..c029442 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -47,7 +47,7 @@ ### Service "neo.fs.v2.netmap.NetmapService" -`NetmapService` provides methods to work with `Network Map` and information +`NetmapService` provides methods to work with `Network Map` and the information required to build it. The resulting `Network Map` is stored in sidechain `Netmap` smart contract, while related information can be obtained from other NeoFS nodes. @@ -60,11 +60,11 @@ rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); #### Method LocalNodeInfo -Get NodeInfo structure from the particular node directly. Node information -can be taken from `Netmap` smart contract, but in some cases the one may -want to get recent information directly, or to talk to the node not yet -present in `Network Map` to find out what API version can be used for -further communication. Can also be used to check if node is up and running. +Get NodeInfo structure from the particular node directly. +Node information can be taken from `Netmap` smart contract. In some cases, though, +one may want to get recent information directly or to talk to the node not yet +present in the `Network Map` to find out what API version can be used for +further communication. This can be also used to check if a node is up and running. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -92,7 +92,7 @@ information about the current network state has been successfully read; ### Message LocalNodeInfoRequest -Get NodeInfo structure from the particular node directly +Get NodeInfo structure directly from a particular node | Field | Type | Label | Description | @@ -137,7 +137,7 @@ Local Node Info, including API Version in use. ### Message NetworkInfoRequest -Get NetworkInfo structure with the network view from particular node. +Get NetworkInfo structure with the network view from a particular node. | Field | Type | Label | Description | @@ -196,13 +196,13 @@ Information about the network. ### Message Filter -Filter will return the subset of nodes from `NetworkMap` or another filter's -results, that will satisfy filter's conditions. +This filter will return the subset of nodes from `NetworkMap` or another filter's +results that will satisfy filter's conditions. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | Name of the filter or a reference to the named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | +| name | [string](#string) | | Name of the filter or a reference to a named filter. '*' means application to the whole unfiltered NetworkMap. At top level it's used as a filter name. At lower levels it's considered to be a reference to another named filter | | key | [string](#string) | | Key to filter | | op | [Operation](#neo.fs.v2.netmap.Operation) | | Filtering operation | | value | [string](#string) | | Value to match | @@ -332,7 +332,7 @@ explicitly set: automatically from `UN-LOCODE` attribute. For detailed description of each well-known attribute please see the -corresponding section in NeoFS Technical specification. +corresponding section in NeoFS Technical Specification. | Field | Type | Label | Description | @@ -363,7 +363,7 @@ storage policy definition languages. ### Message Replica Number of object replicas in a set of nodes from the defined selector. If no -selector set the root bucket containing all possible nodes will be used by +selector set, the root bucket containing all possible nodes will be used by default. @@ -385,7 +385,7 @@ to the provided `ContainerID` by hash distance. | name | [string](#string) | | Selector name to reference in object placement section | | count | [uint32](#uint32) | | How many nodes to select from the bucket | | clause | [Clause](#neo.fs.v2.netmap.Clause) | | Selector modifier showing how to form a bucket | -| attribute | [string](#string) | | Attribute bucket to select from | +| attribute | [string](#string) | | Bucket attribute to select from | | filter | [string](#string) | | Filter reference to select from | @@ -400,7 +400,7 @@ hash distance. | Name | Number | Description | | ---- | ------ | ----------- | -| CLAUSE_UNSPECIFIED | 0 | No modifier defined. Will select nodes from bucket randomly. | +| CLAUSE_UNSPECIFIED | 0 | No modifier defined. Nodes will be selected from the bucket randomly | | SAME | 1 | SAME will select only nodes having the same value of bucket attribute | | DISTINCT | 2 | DISTINCT will select nodes having different values of bucket attribute | diff --git a/proto-docs/object.md b/proto-docs/object.md index a483e8c..025f41f 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -70,7 +70,7 @@ ### Service "neo.fs.v2.object.ObjectService" `ObjectService` provides API for manipulating objects. Object operations do -not interact with sidechain and are only served by nodes in p2p style. +not affect the sidechain and are only served by nodes in p2p style. ``` rpc Get(GetRequest) returns (stream GetResponse); @@ -86,11 +86,22 @@ rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); #### Method Get Receive full object structure, including Headers and payload. Response uses -gRPC stream. First response message carries object with requested address. +gRPC stream. First response message carries the object with the requested address. Chunk messages are parts of the object's payload if it is needed. All -messages, except the first one, carry payload chunks. Requested object can +messages, except the first one, carry payload chunks. The requested object can be restored by concatenation of object message payload and all chunks -keeping receiving order. +keeping the receiving order. + +Extended headers can change `Get` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. +* __NEOFS__NETMAP_LOOKUP_DEPTH \ + Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + the latest one otherwise) of Network Map to find an object until the depth + limit is reached. + +Please refer to detailed `XHeader` description. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -117,7 +128,14 @@ SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see session package). Chunk messages are considered by server as a part of an object payload. All messages, except first one, SHOULD be payload chunks. -Chunk messages SHOULD be sent in direct order of fragmentation. +Chunk messages SHOULD be sent in the direct order of fragmentation. + +Extended headers can change `Put` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -147,6 +165,13 @@ been deleted; Delete the object from a container. There is no immediate removal guarantee. Object will be marked for removal and deleted eventually. +Extended headers can change `Delete` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. + Statuses: - **OK** (0, SECTION_SUCCESS): \ object has been successfully marked to be removed from the container; @@ -167,7 +192,14 @@ Statuses: Returns the object Headers without data payload. By default full header is returned. If `main_only` request field is set, the short header with only -the very minimal information would be returned instead. +the very minimal information will be returned instead. + +Extended headers can change `Head` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -193,6 +225,13 @@ Search objects in container. Search query allows to match by Object Header's filed values. Please see the corresponding NeoFS Technical Specification section for more details. +Extended headers can change `Search` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. + Statuses: - **OK** (0, SECTION_SUCCESS): \ objects have been successfully selected; @@ -211,9 +250,19 @@ Statuses: Get byte range of data payload. Range is set as an (offset, length) tuple. Like in `Get` method, the response uses gRPC stream. Requested range can be -restored by concatenation of all received payload chunks keeping receiving +restored by concatenation of all received payload chunks keeping the receiving order. +Extended headers can change `GetRange` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. +* __NEOFS__NETMAP_LOOKUP_DEPTH \ + Will try older versions of Network Map to find an object until the depth + limit is reached. + +Please refer to detailed `XHeader` description. + Statuses: - **OK** (0, SECTION_SUCCESS): \ data range of the object payload has been successfully read; @@ -228,6 +277,8 @@ Statuses: provided session token has expired; - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ the requested object has been marked as deleted. +- **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + the requested range is out of bounds. | Name | Input | Output | | ---- | ----- | ------ | @@ -236,8 +287,18 @@ Statuses: Returns homomorphic or regular hash of object's payload range after applying XOR operation with the provided `salt`. Ranges are set of (offset, -length) tuples. Hashes order in response corresponds to ranges order in -request. Note that hash is calculated for XORed data. +length) tuples. Hashes order in response corresponds to the ranges order in +the request. Note that hash is calculated for XORed data. + +Extended headers can change `GetRangeHash` behaviour: +* __NEOFS__NETMAP_EPOCH \ + Will use the requsted version of Network Map for object placement + calculation. +* __NEOFS__NETMAP_LOOKUP_DEPTH \ + Will try older versions of Network Map to find an object until the depth + limit is reached. + +Please refer to detailed `XHeader` description. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -249,6 +310,8 @@ Statuses: access to operation RANGEHASH of the object is denied; - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ object not found in container; +- **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + the requested range is out of bounds. - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -533,12 +596,12 @@ Object HEAD response body ### Message HeaderWithSignature -Tuple of full object header and signature of `ObjectID`. \ +Tuple of a full object header and signature of an `ObjectID`. \ Signed `ObjectID` is present to verify full header's authenticity through the following steps: -1. Calculate `SHA-256` of marshalled `Header` structure -2. Check if the resulting hash matched `ObjectID` +1. Calculate `SHA-256` of the marshalled `Header` structure +2. Check if the resulting hash matches `ObjectID` 3. Check if `ObjectID` signature in `signature` field is correct @@ -653,13 +716,13 @@ Object Search request body ### Message SearchRequest.Body.Filter -Filter structure checks if object header field or attribute content +Filter structure checks if the object header field or the attribute content matches a value. -If no filters set, search request will return all objects of the +If no filters are set, search request will return all objects of the container, including Regular object, Tombstones and Storage Group objects. Most human users expect to get only object they can directly -work with. In that case the `$Object:ROOT` filter should be used. +work with. In that case, `$Object:ROOT` filter should be used. By default `key` field refers to the corresponding object's `Attribute`. Some Object's header fields can also be accessed by adding `$Object:` @@ -692,10 +755,10 @@ There are some well-known filter aliases to match objects by certain properties: * $Object:ROOT \ - Returns only `REGULAR` type objects that are not split or are the top + Returns only `REGULAR` type objects that are not split or that are the top level root objects in a split hierarchy. This includes objects not present physically, like large objects split into smaller objects - without separate top-level root object. Other type objects like + without a separate top-level root object. Objects of other types like StorageGroups and Tombstones will not be shown. This filter may be useful for listing objects like `ls` command of some virtual file system. This filter is activated if the `key` exists, disregarding the @@ -762,7 +825,7 @@ Object Header | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively, the version of API library used to create particular object | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Object's container | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | creation_epoch | [uint64](#uint64) | | Object creation Epoch | @@ -778,10 +841,10 @@ Object Header ### Message Header.Attribute -`Attribute` is a user-defined Key-Value metadata pair attached to the +`Attribute` is a user-defined Key-Value metadata pair attached to an object. -Key name must be a object-unique valid UTF-8 string. Value can't be empty. +Key name must be an object-unique valid UTF-8 string. Value can't be empty. Objects with duplicated attribute names or attributes with empty values will be considered invalid. @@ -812,7 +875,7 @@ And some well-known attributes used by applications only: MIME Content Type of object's payload For detailed description of each well-known attribute please see the -corresponding section in NeoFS Technical specification. +corresponding section in NeoFS Technical Specification. | Field | Type | Label | Description | @@ -844,8 +907,8 @@ must be within the same container. ### Message Object Object structure. Object is immutable and content-addressed. It means -`ObjectID` will change if header or payload changes. It's calculated as a -hash of header field, which contains hash of object's payload. +`ObjectID` will change if the header or the payload changes. It's calculated as a +hash of header field which contains hash of the object's payload. For non-regular object types payload format depends on object type specified in the header. @@ -867,7 +930,7 @@ Short header fields | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively the version of API library used to create particular object. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Object format version. Effectively, the version of API library used to create particular object. | | creation_epoch | [uint64](#uint64) | | Epoch when the object was created | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Object's owner | | object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content | @@ -879,17 +942,17 @@ Short header fields ### Message SplitInfo -Meta information of split hierarchy for object assembly. With last part -one can traverse linked list of split hierarchy back to first part and -assemble original object. With linking object one can assembly object -straight away from the object parts. +Meta information of split hierarchy for object assembly. With the last part +one can traverse linked list of split hierarchy back to the first part and +assemble the original object. With a linking object one can assemble an object +right from the object parts. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. | -| last_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the last object in split hierarchy parts. It contains split header with original object header. | -| link | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of linking object for split hierarchy parts. It contains split header with original object header and sorted list of object parts. | +| last_part | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of the last object in split hierarchy parts. It contains split header with the original object header. | +| link | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The identifier of a linking object for split hierarchy parts. It contains split header with the original object header and a sorted list of object parts. | @@ -913,7 +976,7 @@ Type of match expression ### ObjectType Type of the object payload content. Only `REGULAR` type objects can be split, -hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by maximal +hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum object size. String presentation of object type is the same as definition: diff --git a/proto-docs/refs.md b/proto-docs/refs.md index abb2f6f..651822f 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -35,7 +35,7 @@ ### Message Address Objects in NeoFS are addressed by their ContainerID and ObjectID. -String presentation of `Address` is the concatenation of string encoded +String presentation of `Address` is a concatenation of string encoded `ContainerID` and `ObjectID` delimited by '/' character. @@ -49,7 +49,7 @@ String presentation of `Address` is the concatenation of string encoded ### Message Checksum Checksum message. -Depending on checksum algorithm type the string presentation may vary: +Depending on checksum algorithm type, the string presentation may vary: * TZ \ Hex encoded string without `0x` prefix @@ -73,10 +73,10 @@ content-addressed. [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of stable-marshalled container message. -String presentation is +String presentation is a [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -JSON value will be the data encoded as a string using standard base64 +JSON value will be data encoded as a string using standard base64 encoding with paddings. Either [standard](https://tools.ietf.org/html/rfc4648#section-4) or [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -92,17 +92,17 @@ with/without paddings are accepted. ### Message ObjectID NeoFS Object unique identifier. Objects are immutable and content-addressed. -It means `ObjectID` will change if `header` or `payload` changes. +It means `ObjectID` will change if the `header` or the `payload` changes. `ObjectID` is a 32 byte long [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -object's `header` field, which, in it's turn, contains hash of object's +the object's `header` field, which, in it's turn, contains the hash of the object's payload. -String presentation is +String presentation is a [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -JSON value will be the data encoded as a string using standard base64 +JSON value will be data encoded as a string using standard base64 encoding with paddings. Either [standard](https://tools.ietf.org/html/rfc4648#section-4) or [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -124,10 +124,10 @@ be directly used as `OwnerID`. `OwnerID` is a 25 bytes sequence starting with Neo version prefix byte followed by 20 bytes of ScrptHash and 4 bytes of checksum. -String presentation is [Base58 +String presentation is a [Base58 Check](https://en.bitcoin.it/wiki/Base58Check_encoding) Encoded string. -JSON value will be the data encoded as a string using standard base64 +JSON value will be data encoded as a string using standard base64 encoding with paddings. Either [standard](https://tools.ietf.org/html/rfc4648#section-4) or [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding @@ -171,7 +171,7 @@ NeoFS subnetwork identifier. String representation of a value is base-10 integer. -JSON representation is an object containing single `value` number field. +JSON representation is an object containing a single `value` number field. | Field | Type | Label | Description | @@ -185,7 +185,7 @@ JSON representation is an object containing single `value` number field. API version used by a node. String presentation is a Semantic Versioning 2.0.0 compatible version string -with 'v' prefix. I.e. `vX.Y`, where `X` - major number, `Y` - minor number. +with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. | Field | Type | Label | Description | @@ -218,6 +218,7 @@ Signature scheme describes digital signing scheme used for (key, signature) pair | ---- | ------ | ----------- | | ECDSA_SHA512 | 0 | ECDSA with SHA-512 hashing (FIPS 186-3) | | ECDSA_RFC6979_SHA256 | 1 | Deterministic ECDSA with SHA-256 hashing (RFC 6979) | +| ECDSA_RFC6979_SHA256_WALLET_CONNECT | 2 | Deterministic ECDSA with SHA-256 hashing using WalletConnect API. Here the algorithm is the same, but the message format differs. | diff --git a/proto-docs/reputation.md b/proto-docs/reputation.md index 3802c39..19558f3 100644 --- a/proto-docs/reputation.md +++ b/proto-docs/reputation.md @@ -69,7 +69,7 @@ local trust has been successfully announced; | AnnounceLocalTrust | [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) | [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) | #### Method AnnounceIntermediateResult -Announces the intermediate result of the iterative algorithm for +Announce the intermediate result of the iterative algorithm for calculating the global reputation of the node in NeoFS network. Statuses: @@ -112,7 +112,7 @@ Announce intermediate global trust information. ### Message AnnounceIntermediateResultResponse -Intermediate global trust information announce response. +Intermediate global trust information announcement response. | Field | Type | Label | Description | @@ -125,9 +125,9 @@ Intermediate global trust information announce response. ### Message AnnounceIntermediateResultResponse.Body -Response to the node's intermediate global trust information announce has +Response to the node's intermediate global trust information announcement has an empty body because the trust exchange operation is asynchronous. If -Trust information will not pass sanity checks it is silently ignored. +Trust information does not pass sanity checks, it is silently ignored. @@ -153,13 +153,13 @@ Announce node's local trust information. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | epoch | [uint64](#uint64) | | Trust assessment Epoch number | -| trusts | [Trust](#neo.fs.v2.reputation.Trust) | repeated | List of normalized local trust values to other NeoFS nodes. The value is calculated according to EigenTrust++ algorithm and must be a floating point number in the [0;1] range. | +| trusts | [Trust](#neo.fs.v2.reputation.Trust) | repeated | List of normalized local trust values to other NeoFS nodes. The value is calculated according to EigenTrust++ algorithm and must be a floating point number in [0;1] range. | ### Message AnnounceLocalTrustResponse -Node's local trust information announce response. +Node's local trust information announcement response. | Field | Type | Label | Description | @@ -172,9 +172,9 @@ Node's local trust information announce response. ### Message AnnounceLocalTrustResponse.Body -Response to the node's local trust information announce has an empty body +Response to the node's local trust information announcement has an empty body because the trust exchange operation is asynchronous. If Trust information -will not pass sanity checks it is silently ignored. +does not pass sanity checks, it is silently ignored. @@ -200,7 +200,7 @@ Global trust level to NeoFS node. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Message format version. Effectively the version of API library used to create the message. | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Message format version. Effectively, the version of API library used to create the message. | | body | [GlobalTrust.Body](#neo.fs.v2.reputation.GlobalTrust.Body) | | Message body | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of the binary `body` field by the manager. | @@ -220,13 +220,13 @@ Message body structure. ### Message PeerID -NeoFS unique peer identifier is 33 byte long compressed public key of the +NeoFS unique peer identifier is a 33 byte long compressed public key of the node, the same as the one stored in the network map. -String presentation is +String presentation is a [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -JSON value will be the data encoded as a string using standard base64 +JSON value will be data encoded as a string using standard base64 encoding with paddings. Either [standard](https://tools.ietf.org/html/rfc4648#section-4) or [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding diff --git a/proto-docs/session.md b/proto-docs/session.md index 683777b..40a48e2 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -56,7 +56,7 @@ rpc Create(CreateRequest) returns (CreateResponse); #### Method Create -Opens a new session between two peers. +Open a new session between two peers. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -77,7 +77,7 @@ Information necessary for opening a session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) | | Body of create session token request message. | +| body | [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) | | Body of a create session token request message. | | meta_header | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | | verify_header | [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | @@ -180,12 +180,12 @@ request meta headers are folded in matryoshka style. ### Message RequestVerificationHeader -Verification info for request signed by all intermediate nodes. +Verification info for the request signed by all intermediate nodes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by request initiator. | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by the request initiator. | | meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by each intermediate node | | origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of previous hops | | origin | [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Chain of previous hops signatures | @@ -210,12 +210,12 @@ Information about the response ### Message ResponseVerificationHeader -Verification info for response signed by all intermediate nodes +Verification info for the response signed by all intermediate nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by answering node. | +| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by an answering node. | | meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by each intermediate node | | origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of previous hops | | origin | [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Chain of previous hops signatures | @@ -265,10 +265,10 @@ Lifetime parameters of the token. Field names taken from rfc7519. ### Message XHeader -Extended headers for Request/Response. May contain any user-defined headers +Extended headers for Request/Response. They may contain any user-defined headers to be interpreted on application level. -Key name must be unique valid UTF-8 string. Value can't be empty. Requests or +Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or Responses with duplicated header names or headers with empty values will be considered invalid. @@ -281,9 +281,9 @@ affect system behaviour: current epoch only will be used. * __NEOFS__NETMAP_LOOKUP_DEPTH \ If object can't be found using current epoch's netmap, this header limits - how many past epochs back the node can lookup. The `value` is string - encoded `uint64` in decimal presentation. If set to '0' or not set, the - current epoch only will be used. + how many past epochs the node can look up through. The `value` is string + encoded `uint64` in decimal presentation. If set to '0' or not set, only the + current epoch will be used. | Field | Type | Label | Description | diff --git a/proto-docs/status.md b/proto-docs/status.md index ea97ac7..1d02903 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -44,12 +44,12 @@ is defined for each section. Values can be referred to in the following ways: All outcomes are divided into successful and failed, which corresponds to the success or failure of the operation. The definition of success -follows from the semantics of RPC and the description of its purpose. -The server must not attach code that is the opposite of outcome type. +follows the semantics of RPC and the description of its purpose. +The server must not attach code that is the opposite of the outcome type. See the set of return codes in the description for calls. -Each status can carry developer-facing error message. It should be human +Each status can carry a developer-facing error message. It should be a human readable text in English. The server should not transmit (and the client should not expect) useful information in the message. Field `details` should make the return more detailed. @@ -88,6 +88,7 @@ Section of failed statuses independent of the operation. | ---- | ------ | ----------- | | INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed. If the server cannot match failed outcome to the code, it should use this code. | | WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). | +| SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. | @@ -114,6 +115,7 @@ Section of statuses for object-related operations. | LOCKED | 2 | [**2050**] Operation rejected by the object lock. | | LOCK_NON_REGULAR_OBJECT | 3 | [**2051**] Locking an object with a non-REGULAR type rejected. | | OBJECT_ALREADY_REMOVED | 4 | [**2052**] Object has been marked deleted. | +| OUT_OF_RANGE | 5 | [**2053**] Invalid range has been requested for an object. | diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index 4428595..3bc0b5e 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -26,8 +26,8 @@ ### Message StorageGroup StorageGroup keeps verification information for Data Audit sessions. Objects -that require payed storage guaranties are gathered in `StorageGroups` with -additional information used for proof of storage. `StorageGroup` only +that require paid storage guarantees are gathered in `StorageGroups` with +additional information used for the proof of storage. `StorageGroup` only contains objects from the same container. Being an object payload, StorageGroup may have expiration Epoch set with @@ -41,7 +41,7 @@ deleted by Storage Nodes. | validation_data_size | [uint64](#uint64) | | Total size of the payloads of objects in the storage group | | validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the `members` field. | | expiration_epoch | [uint64](#uint64) | | DEPRECATED. Last NeoFS epoch number of the storage group lifetime | -| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Strictly ordered list of storage group member objects | +| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Strictly ordered list of storage group member objects. Members MUST be unique | diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 1dca62a..4657935 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -25,14 +25,14 @@ ### Message Tombstone -Tombstone keeps record of deleted objects for few epochs until they are +Tombstone keeps record of deleted objects for a few epochs until they are purged from the NeoFS network. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by tombstone creator depending on current NeoFS network settings. Tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` attribute. Otherwise tombstone will be rejected by storage node. | -| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside container. All objects participating in the split must have the same `split_id` value. | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` attribute. Otherwise, the tombstone will be rejected by a storage node. | +| split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside a container. All objects participating in the split must have the same `split_id` value. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | From 10f18e4b69ec79991b1a2b83e212d99203f3ee1a Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 21 Jun 2022 14:55:04 +0300 Subject: [PATCH 363/440] =?UTF-8?q?Release=20v2.13.0=20-=20Yeonpyeongdo=20?= =?UTF-8?q?(=EC=97=B0=ED=8F=89=EB=8F=84,=20=E5=BB=B6=E5=9D=AA=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Karpy --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 89fa6c9..a64cd65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [2.13.0] - 2022-06-21 - Yeonpyeongdo (연평도, 延坪島) + +### Added +- Extended headers usage clarification (#204) +- `OUT_OF_RANGE` status code to the `object` section (#208) +- Disabling homomorphic hashing container setting (#217) +- `LOCK` object behaviour clarification (#221) +- Storage group members uniqueness constraint (#222) +- WalletConnect signature scheme (#206) +- `SIGNATURE_VERIFICATION_FAIL` status code to the `CommonFail` section (#225) + +### Deprecated +- Storage group's expiration epoch field (#205) + +### Fixed +- English language typos (#216) + ## [2.12.0] - 2022-02-22 - Heuksando (흑산도, 黑山島) Network magic, main status codes, object locks and notifications. @@ -447,3 +464,4 @@ Bump major release [2.10.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.9.1...v2.10.0 [2.11.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.10.0...v2.11.0 [2.12.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.11.0...v2.12.0 +[2.13.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.12.0...v2.13.0 From 22a7d8be6ceb1509e3dba565a73ae2093183f5f7 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 29 Jul 2022 20:16:16 +0300 Subject: [PATCH 364/440] [#230] status: Add EACL_NOT_FOUND status Signed-off-by: Pavel Karpy --- container/service.proto | 4 +++- proto-docs/container.md | 4 +++- proto-docs/status.md | 1 + status/types.proto | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/container/service.proto b/container/service.proto index 1fdc54f..69d96a3 100644 --- a/container/service.proto +++ b/container/service.proto @@ -73,7 +73,9 @@ service ContainerService { // container eACL has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found. + // container not found; + // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + // eACL table not found. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announces the space values used by the container for P2P synchronization. diff --git a/proto-docs/container.md b/proto-docs/container.md index d11243d..b518a67 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -157,7 +157,9 @@ Statuses: container eACL has been successfully read; - Common failures (SECTION_FAILURE_COMMON); - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - container not found. + container not found; +- **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ + eACL table not found. | Name | Input | Output | | ---- | ----- | ------ | diff --git a/proto-docs/status.md b/proto-docs/status.md index 1d02903..246292e 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -100,6 +100,7 @@ Section of statuses for container-related operations. | Name | Number | Description | | ---- | ------ | ----------- | | CONTAINER_NOT_FOUND | 0 | [**3072**] Container not found. | +| EACL_NOT_FOUND | 1 | [**3073**] eACL table not found. | diff --git a/status/types.proto b/status/types.proto index 6e05f62..eb0a3ed 100644 --- a/status/types.proto +++ b/status/types.proto @@ -127,6 +127,9 @@ enum Object { enum Container { // [**3072**] Container not found. CONTAINER_NOT_FOUND = 0; + + // [**3073**] eACL table not found. + EACL_NOT_FOUND = 1; } // Section of statuses for session-related operations. From 81488edd8b7823142872e03ce72349c558c879e9 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Mon, 1 Aug 2022 10:52:29 +0300 Subject: [PATCH 365/440] Release v2.13.1 Signed-off-by: Pavel Karpy --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a64cd65..ca21fbb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.13.1] - 2022-08-01 + +### Added +- `EACL_NOT_FOUND` status code to the `container` section (#230) + ## [2.13.0] - 2022-06-21 - Yeonpyeongdo (연평도, 延坪島) ### Added @@ -465,3 +470,4 @@ Bump major release [2.11.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.10.0...v2.11.0 [2.12.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.11.0...v2.12.0 [2.13.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.12.0...v2.13.0 +[2.13.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.13.0...v2.13.1 From 4de2570e1a3dfc9633bbf02daf74753e7ba46b69 Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Tue, 2 Aug 2022 17:32:35 +0300 Subject: [PATCH 366/440] [#232] Comments fix for ACL Signed-off-by: anastasia prasolova --- acl/types.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acl/types.proto b/acl/types.proto index f6c1da7..2bf5f23 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -125,7 +125,7 @@ message EACLRecord { // * $Object:homomorphicHash \ // homomorphic_hash // - // Please note, that if request or response does not have object's headers or + // Please note, that if request or response does not have object's headers of // full object (Range, RangeHash, Search, Delete), it will not be possible to // filter by object header fields or user attributes. From the well-known list // only `$Object:objectID` and `$Object:containerID` will be available, as From c03a53813a53c9283060e76a67d110c1c528a326 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Wed, 27 Jul 2022 16:27:55 +0300 Subject: [PATCH 367/440] [#228] Add netmap snapshot request Clients need an easy way of getting network map to get connection endpoints form Node's attributes. Signed-off-by: Stanislav Bogatyrev --- netmap/service.proto | 50 ++++++++++++++++++++++++++++++++++++++++++++ netmap/types.proto | 9 ++++++++ 2 files changed, 59 insertions(+) diff --git a/netmap/service.proto b/netmap/service.proto index b0d4064..1898b3a 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -33,6 +33,14 @@ service NetmapService { // information about the current network state has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); + + // Returns network map snapshot of the current NeoFS epoch. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): + // information about the current network map has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON). + rpc NetmapSnapshot (NetmapSnapshotRequest) returns (NetmapSnapshotResponse); } // Get NodeInfo structure directly from a particular node @@ -114,3 +122,45 @@ message NetworkInfoResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +// Get netmap snapshot request +message NetmapSnapshotRequest { + // Get netmap snapshot request body. + message Body { + } + + // Body of get netmap snapshot request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + +} + +// Response with current netmap snapshot +message NetmapSnapshotResponse { + // Get netmap snapshot response body + message Body { + // Structure of the requested network map. + Netmap netmap = 1 [json_name = "netmap"]; + } + + // Body of get netmap snapshot response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; + +} diff --git a/netmap/types.proto b/netmap/types.proto index cba74dd..e625c2d 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -238,6 +238,15 @@ message NodeInfo { State state = 4 [json_name = "state"]; } +// Network map structure +message Netmap { + // Network map revision number. + uint64 epoch = 1 [json_name = "epoch"]; + + // Nodes presented in network. + repeated NodeInfo nodes = 2 [json_name = "nodes"]; +} + // NeoFS network configuration message NetworkConfig { // Single configuration parameter From 15eaf93ba1eb6947fb6e0927a1e6c430866cfa52 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Fri, 26 Aug 2022 12:32:10 +0300 Subject: [PATCH 368/440] [#238] Add FilePath object attribute FilePath attribute is already used by S3 and HTTP protocol gateways. Also seen in [Gaspump](https://github.com/configwizard/gaspump-api/). Signed-off-by: Stanislav Bogatyrev --- object/types.proto | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/object/types.proto b/object/types.proto index 40b1eb6..82d9b9a 100644 --- a/object/types.proto +++ b/object/types.proto @@ -135,6 +135,13 @@ message Header { // Human-friendly name // * FileName \ // File name to be associated with the object on saving + // * FilePath \ + // Full path to be associated with the object on saving. Should start with a + // '/' and use '/' as a delimiting symbol. Trailing '/' should be + // interpreted as a virtual directory marker. If an object has conflicting + // FilePath and FileName, FilePath should have higher priority, because it + // is used to construct the directory tree. FilePath with trailing '/' and + // non-empty FileName attribute should not be used together. // * Timestamp \ // User-defined local time of object creation in Unix Timestamp format // * Content-Type \ From d939c47ee51ba2a6a3e93a79a12c3bae48e4c378 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 14 Sep 2022 18:07:14 +0300 Subject: [PATCH 369/440] [#237] netmap: Add MAINTENANCE node state Signed-off-by: Evgenii Stratonikov --- netmap/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index e625c2d..2be052d 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -232,6 +232,9 @@ message NodeInfo { // Network unavailable state OFFLINE = 2; + + // Maintenance state + MAINTENANCE = 3; } // Carries state of the NeoFS node From 4d8dd727eab1fda32a50a1b5d06fdc7d332d606f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 14 Sep 2022 18:07:29 +0300 Subject: [PATCH 370/440] [#237] status: Add NODE_UNDER_MAINTENANCE status code Signed-off-by: Evgenii Stratonikov --- status/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/status/types.proto b/status/types.proto index eb0a3ed..1b4a9fc 100644 --- a/status/types.proto +++ b/status/types.proto @@ -98,6 +98,9 @@ enum CommonFail { // [**1026**] Signature verification failure. SIGNATURE_VERIFICATION_FAIL = 2; + + // [**1027**] Node is under maintenance. + NODE_UNDER_MAINTENANCE = 3; } // Section of statuses for object-related operations. From b8b1a90075c5c242d7e8904ed72136b3e4c200b0 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 16 Sep 2022 10:26:24 +0400 Subject: [PATCH 371/440] [#198] object: Sort statuses by codes Description of statuses sorted by sections and codes looks more logical. Signed-off-by: Leonard Lyubich --- object/service.proto | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/object/service.proto b/object/service.proto index 22d7948..853ce00 100644 --- a/object/service.proto +++ b/object/service.proto @@ -34,16 +34,16 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // read access to the object is denied; // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc Get(GetRequest) returns (stream GetResponse); // Put the object into container. Request uses gRPC stream. First message @@ -64,6 +64,8 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully saved in the container; // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ // placement of an object of type TOMBSTONE that includes at least one locked // object is prohibited; @@ -72,8 +74,6 @@ service ObjectService { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // write access to the container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or has // been deleted; @@ -95,12 +95,12 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // object has been successfully marked to be removed from the container; // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // delete access to the object is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; - // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - // delete access to the object is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Delete(DeleteRequest) returns (DeleteResponse); @@ -120,16 +120,16 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // object header has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // access to operation HEAD of the object is denied; // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - // the requested object has been marked as deleted. + // the requested object has been marked as deleted; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object @@ -147,10 +147,10 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // objects have been successfully selected; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // search container not found; // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // access to operation SEARCH of the object is denied; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // search container not found; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Search(SearchRequest) returns (stream SearchResponse); @@ -174,18 +174,18 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // data range of the object payload has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // access to operation RANGE of the object is denied; // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; - // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - // provided session token has expired; // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ // the requested object has been marked as deleted. // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds. + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); // Returns homomorphic or regular hash of object's payload range after @@ -207,14 +207,14 @@ service ObjectService { // - **OK** (0, SECTION_SUCCESS): \ // data range of the object payload has been successfully hashed; // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // object container not found; // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // access to operation RANGEHASH of the object is denied; // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ // object not found in container; // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - // the requested range is out of bounds. + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object container not found; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); From d6090eb2fc6fbdb401f22ec471fffb1015d67aca Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 16 Sep 2022 10:56:56 +0400 Subject: [PATCH 372/440] [#202] session: Allow to spread object session to the whole container Object sessions for `PUT` and `SEARCH` ops are spread to the whole container due to op semantics. Sometimes it is convenient to spread the session to all objects of the container for other operations. Thus, object sessions for the whole container can be unified. Modify docs of `ObjectSessionContext.address` field: * require `container_id` field to be correctly set; * require `object_id` field to be correctly field if set; * allow `object_id` field to be unset and make this case equivalent to the container-global session. Signed-off-by: Leonard Lyubich --- session/types.proto | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/session/types.proto b/session/types.proto index 27fae8b..099b7d5 100644 --- a/session/types.proto +++ b/session/types.proto @@ -40,7 +40,13 @@ message ObjectSessionContext { // Type of request for which the token is issued Verb verb = 1 [json_name = "verb"]; - // Related Object address + // Objects involved in the session. `address` MUST be set. + // `container_id` field indicates which container the session is spread to. + // `container_id` MUST be correctly filled and set. + // `object_id` field indicates which objects in the specified container the + // session is spread to. `object_id` MUST be correctly filled or unset. + // If `object_id` field is set, then the session applies only to this object, + // otherwise, to all objects of the specified container. neo.fs.v2.refs.Address address = 2 [json_name = "address"]; } From b4cdca989fc3171b1179b629425b75bcb27f68c1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 16 Sep 2022 18:11:53 +0400 Subject: [PATCH 373/440] [#202] session: Support sessions issued for an object group Sometimes it is useful to open single session which covers several objects in the container. In previous implementation it could be done: * by opening container-global session * by opening N per-object sessions Both approaches are not optimal for the mentioned need. Define `ObjectSessionContext.Target` which is backward compatible with `refs.Address` in binary format. Replace `address` field of `refs.Address` type in `ObjectSessionContext` message with `target` field of `ObjectSessionContext.Target` type. This change saves backward compatibility in binary format, but break the JSON one. Such a breakage is considered admissible for now since NeoFS API protocol hasn't declared JSON compatibility yet. Signed-off-by: Leonard Lyubich --- session/types.proto | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/session/types.proto b/session/types.proto index 099b7d5..d00e99f 100644 --- a/session/types.proto +++ b/session/types.proto @@ -40,14 +40,21 @@ message ObjectSessionContext { // Type of request for which the token is issued Verb verb = 1 [json_name = "verb"]; - // Objects involved in the session. `address` MUST be set. - // `container_id` field indicates which container the session is spread to. - // `container_id` MUST be correctly filled and set. - // `object_id` field indicates which objects in the specified container the - // session is spread to. `object_id` MUST be correctly filled or unset. - // If `object_id` field is set, then the session applies only to this object, - // otherwise, to all objects of the specified container. - neo.fs.v2.refs.Address address = 2 [json_name = "address"]; + // Carries objects involved in the object session. + message Target { + // Indicates which container the session is spread to. Field MUST be set + // and correct. + refs.ContainerID container = 1 [json_name = "container"]; + + // Indicates which objects the session is spread to. Objects are expected + // to be stored in the NeoFS container referenced by `container` field. + // Each element MUST have correct format. + repeated refs.ObjectID objects = 2 [json_name = "objects"]; + } + // Object session target. MUST be correctly formed and set. If `objects` + // field is not empty, then the session applies only to these elements, + // otherwise, to all objects from the specified container. + Target target = 2 [json_name = "target"]; } // Context information for Session Tokens related to ContainerService requests. From 4d0140902fceae10e307034d6192753ef9763051 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 20 Sep 2022 13:22:29 +0300 Subject: [PATCH 374/440] [#235] netmap: Add a well-known attribute for additional addresses Signed-off-by: Evgenii Stratonikov --- netmap/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 2be052d..1259a8c 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -202,6 +202,10 @@ message NodeInfo { // Node's continent name according to the [Seven-Continent model] // (https://en.wikipedia.org/wiki/Continent#Number). Calculated // automatically from `UN-LOCODE` attribute. + // * ExternalAddr + // Node's preferred way for communications with external clients. + // Clients SHOULD use these addresses if possible. + // Must contain a comma-separated list of multi-addresses. // // For detailed description of each well-known attribute please see the // corresponding section in NeoFS Technical Specification. From 35a012b0fe71ec02df1070014bb1fe688d6e13e7 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 23 Sep 2022 14:09:32 +0400 Subject: [PATCH 375/440] [#214] netmap: Define keys of `NetworkConfig.Parameter` There is a need to declare all system parameters stored as raw key-value parameters in `NetworkConfig` messages. So applications can interpret raw configurations in a controlled manner. Signed-off-by: Leonard Lyubich --- netmap/types.proto | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/netmap/types.proto b/netmap/types.proto index 1259a8c..6163687 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -256,7 +256,47 @@ message Netmap { // NeoFS network configuration message NetworkConfig { - // Single configuration parameter + // Single configuration parameter. Key MUST be network-unique. + // + // System parameters: + // - **AuditFee** \ + // Fee paid by the storage group owner to the Inner Ring member. + // Value: little-endian integer. Default: 0. + // - **BasicIncomeRate** \ + // Cost of storing one gigabyte of data for a period of one epoch. Paid by + // container owner to container nodes. + // Value: little-endian integer. Default: 0. + // - **ContainerAliasFee** \ + // Fee paid for named container's creation by the container owner. + // Value: little-endian integer. Default: 0. + // - **ContainerFee** \ + // Fee paid for container creation by the container owner. + // Value: little-endian integer. Default: 0. + // - **EigenTrustAlpha** \ + // Alpha parameter of EigenTrust algorithm used in the Reputation system. + // Value: decimal floating-point number in UTF-8 string representation. + // Default: 0. + // - **EigenTrustIterations** \ + // Number of EigenTrust algorithm iterations to pass in the Reputation system. + // Value: little-endian integer. Default: 0. + // - **EpochDuration** \ + // NeoFS epoch duration measured in Sidechain blocks. + // Value: little-endian integer. Default: 0. + // - **HomomorphicHashingDisabled** \ + // Flag of disabling the homomorphic hashing of objects' payload. + // Value: true if any byte != 0. Default: false. + // - **InnerRingCandidateFee** \ + // Fee for entrance to the Inner Ring paid by the candidate. + // Value: little-endian integer. Default: 0. + // - **MaintenanceModeAllowed** \ + // Flag allowing setting the MAINTENANCE state to storage nodes. + // Value: true if any byte != 0. Default: false. + // - **MaxObjectSize** \ + // Maximum size of physically stored NeoFS object measured in bytes. + // Value: little-endian integer. Default: 0. + // - **WithdrawFee** \ + // Fee paid for withdrawal of funds paid by the account owner. + // Value: little-endian integer. Default: 0. message Parameter { // Parameter key. UTF-8 encoded string bytes key = 1 [json_name = "key"]; From ae38b06f9b5e3889d4cb43b9251bf8ed11c74552 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 23 Sep 2022 18:57:44 +0400 Subject: [PATCH 376/440] *: Re-generate protobuf docs Signed-off-by: Leonard Lyubich --- proto-docs/acl.md | 2 +- proto-docs/netmap.md | 121 +++++++++++++++++++++++++++++++++++++++++- proto-docs/object.md | 55 ++++++++++--------- proto-docs/session.md | 15 +++++- proto-docs/status.md | 1 + 5 files changed, 167 insertions(+), 27 deletions(-) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 80416c5..09762a1 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -118,7 +118,7 @@ prefix to the name. Here is the list of fields available via this prefix: * $Object:homomorphicHash \ homomorphic_hash -Please note, that if request or response does not have object's headers or +Please note, that if request or response does not have object's headers of full object (Range, RangeHash, Search, Delete), it will not be possible to filter by object header fields or user attributes. From the well-known list only `$Object:objectID` and `$Object:containerID` will be available, as diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index c029442..2c7545d 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -12,6 +12,10 @@ - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) + - [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) + - [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) + - [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) + - [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) @@ -22,6 +26,7 @@ - Messages - [Filter](#neo.fs.v2.netmap.Filter) + - [Netmap](#neo.fs.v2.netmap.Netmap) - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) @@ -55,6 +60,7 @@ NeoFS nodes. ``` rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); +rpc NetmapSnapshot(NetmapSnapshotRequest) returns (NetmapSnapshotResponse); ``` @@ -86,6 +92,18 @@ information about the current network state has been successfully read; | Name | Input | Output | | ---- | ----- | ------ | | NetworkInfo | [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) | [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) | +#### Method NetmapSnapshot + +Returns network map snapshot of the current NeoFS epoch. + +Statuses: +- **OK** (0, SECTION_SUCCESS): +information about the current network map has been successfully read; +- Common failures (SECTION_FAILURE_COMMON). + +| Name | Input | Output | +| ---- | ----- | ------ | +| NetmapSnapshot | [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) | [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) | @@ -134,6 +152,50 @@ Local Node Info, including API Version in use. | node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo structure with recent information from node itself | + + +### Message NetmapSnapshotRequest +Get netmap snapshot request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) | | Body of get netmap snapshot request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message NetmapSnapshotRequest.Body +Get netmap snapshot request body. + + + + + +### Message NetmapSnapshotResponse +Response with current netmap snapshot + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) | | Body of get netmap snapshot response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect response execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message NetmapSnapshotResponse.Body +Get netmap snapshot response body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| netmap | [Netmap](#neo.fs.v2.netmap.Netmap) | | Structure of the requested network map. | + + ### Message NetworkInfoRequest @@ -209,6 +271,18 @@ results that will satisfy filter's conditions. | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of inner filters. Top level operation will be applied to the whole list. | + + +### Message Netmap +Network map structure + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| epoch | [uint64](#uint64) | | Network map revision number. | +| nodes | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | repeated | Nodes presented in network. | + + ### Message NetworkConfig @@ -223,7 +297,47 @@ NeoFS network configuration ### Message NetworkConfig.Parameter -Single configuration parameter +Single configuration parameter. Key MUST be network-unique. + +System parameters: +- **AuditFee** \ + Fee paid by the storage group owner to the Inner Ring member. + Value: little-endian integer. Default: 0. +- **BasicIncomeRate** \ + Cost of storing one gigabyte of data for a period of one epoch. Paid by + container owner to container nodes. + Value: little-endian integer. Default: 0. +- **ContainerAliasFee** \ + Fee paid for named container's creation by the container owner. + Value: little-endian integer. Default: 0. +- **ContainerFee** \ + Fee paid for container creation by the container owner. + Value: little-endian integer. Default: 0. +- **EigenTrustAlpha** \ + Alpha parameter of EigenTrust algorithm used in the Reputation system. + Value: decimal floating-point number in UTF-8 string representation. + Default: 0. +- **EigenTrustIterations** \ + Number of EigenTrust algorithm iterations to pass in the Reputation system. + Value: little-endian integer. Default: 0. +- **EpochDuration** \ + NeoFS epoch duration measured in Sidechain blocks. + Value: little-endian integer. Default: 0. +- **HomomorphicHashingDisabled** \ + Flag of disabling the homomorphic hashing of objects' payload. + Value: true if any byte != 0. Default: false. +- **InnerRingCandidateFee** \ + Fee for entrance to the Inner Ring paid by the candidate. + Value: little-endian integer. Default: 0. +- **MaintenanceModeAllowed** \ + Flag allowing setting the MAINTENANCE state to storage nodes. + Value: true if any byte != 0. Default: false. +- **MaxObjectSize** \ + Maximum size of physically stored NeoFS object measured in bytes. + Value: little-endian integer. Default: 0. +- **WithdrawFee** \ + Fee paid for withdrawal of funds paid by the account owner. + Value: little-endian integer. Default: 0. | Field | Type | Label | Description | @@ -330,6 +444,10 @@ explicitly set: Node's continent name according to the [Seven-Continent model] (https://en.wikipedia.org/wiki/Continent#Number). Calculated automatically from `UN-LOCODE` attribute. +* ExternalAddr + Node's preferred way for communications with external clients. + Clients SHOULD use these addresses if possible. + Must contain a comma-separated list of multi-addresses. For detailed description of each well-known attribute please see the corresponding section in NeoFS Technical Specification. @@ -416,6 +534,7 @@ Represents the enumeration of various states of the NeoFS node. | UNSPECIFIED | 0 | Unknown state | | ONLINE | 1 | Active state in the network | | OFFLINE | 2 | Network unavailable state | +| MAINTENANCE | 3 | Maintenance state | diff --git a/proto-docs/object.md b/proto-docs/object.md index 025f41f..e22f6c0 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -107,16 +107,16 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ object has been successfully read; - Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - object container not found; - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ read access to the object is denied; - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ object not found in container; -- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - provided session token has expired; - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - the requested object has been marked as deleted. + the requested object has been marked as deleted; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -141,6 +141,8 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ object has been successfully saved in the container; - Common failures (SECTION_FAILURE_COMMON); +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + write access to the container is denied; - **LOCKED** (2050, SECTION_OBJECT): \ placement of an object of type TOMBSTONE that includes at least one locked object is prohibited; @@ -149,8 +151,6 @@ Statuses: type other than REGULAR is prohibited; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object storage container not found; -- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - write access to the container is denied; - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ (for trusted object preparation) session private key does not exist or has been deleted; @@ -176,12 +176,12 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ object has been successfully marked to be removed from the container; - Common failures (SECTION_FAILURE_COMMON); +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + delete access to the object is denied; - **LOCKED** (2050, SECTION_OBJECT): \ deleting a locked object is prohibited; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; -- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ - delete access to the object is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -205,16 +205,16 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ object header has been successfully read; - Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - object container not found; - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ access to operation HEAD of the object is denied; - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ object not found in container; -- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - provided session token has expired; - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ - the requested object has been marked as deleted. + the requested object has been marked as deleted; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -236,10 +236,10 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ objects have been successfully selected; - Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - search container not found; - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ access to operation SEARCH of the object is denied; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + search container not found; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -267,18 +267,18 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ data range of the object payload has been successfully read; - Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - object container not found; - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ access to operation RANGE of the object is denied; - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ object not found in container; -- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ - provided session token has expired; - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ the requested object has been marked as deleted. - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - the requested range is out of bounds. + the requested range is out of bounds; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | @@ -304,14 +304,14 @@ Statuses: - **OK** (0, SECTION_SUCCESS): \ data range of the object payload has been successfully hashed; - Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - object container not found; - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ access to operation RANGEHASH of the object is denied; - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ object not found in container; - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ - the requested range is out of bounds. + the requested range is out of bounds; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object container not found; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -869,6 +869,13 @@ And some well-known attributes used by applications only: Human-friendly name * FileName \ File name to be associated with the object on saving +* FilePath \ + Full path to be associated with the object on saving. Should start with a + '/' and use '/' as a delimiting symbol. Trailing '/' should be + interpreted as a virtual directory marker. If an object has conflicting + FilePath and FileName, FilePath should have higher priority, because it + is used to construct the directory tree. FilePath with trailing '/' and + non-empty FileName attribute should not be used together. * Timestamp \ User-defined local time of object creation in Unix Timestamp format * Content-Type \ diff --git a/proto-docs/session.md b/proto-docs/session.md index 40a48e2..2cdfd1e 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -19,6 +19,7 @@ - Messages - [ContainerSessionContext](#neo.fs.v2.session.ContainerSessionContext) - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) + - [ObjectSessionContext.Target](#neo.fs.v2.session.ObjectSessionContext.Target) - [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) - [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) - [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) @@ -155,7 +156,19 @@ Context information for Session Tokens related to ObjectService requests | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | verb | [ObjectSessionContext.Verb](#neo.fs.v2.session.ObjectSessionContext.Verb) | | Type of request for which the token is issued | -| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | Related Object address | +| target | [ObjectSessionContext.Target](#neo.fs.v2.session.ObjectSessionContext.Target) | | Object session target. MUST be correctly formed and set. If `objects` field is not empty, then the session applies only to these elements, otherwise, to all objects from the specified container. | + + + + +### Message ObjectSessionContext.Target +Carries objects involved in the object session. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| container | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Indicates which container the session is spread to. Field MUST be set and correct. | +| objects | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Indicates which objects the session is spread to. Objects are expected to be stored in the NeoFS container referenced by `container` field. Each element MUST have correct format. | diff --git a/proto-docs/status.md b/proto-docs/status.md index 246292e..b426326 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -89,6 +89,7 @@ Section of failed statuses independent of the operation. | INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed. If the server cannot match failed outcome to the code, it should use this code. | | WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). | | SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. | +| NODE_UNDER_MAINTENANCE | 3 | [**1027**] Node is under maintenance. | From d95228c40283cf6e188073a87a802af7e5dc0a7d Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 23 Sep 2022 19:15:58 +0400 Subject: [PATCH 377/440] =?UTF-8?q?Release=20v2.14.0=20-=20Anmado=20(?= =?UTF-8?q?=EC=95=88=EB=A7=88=EB=8F=84,=20=E9=9E=8D=E9=A6=AC=E5=B3=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonard Lyubich --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca21fbb..81f2852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) + +### Added +- `NetmapSnapsot` RPC to `netmap.NetmapService` (#228) +- Well-known object attribute `FilePath` of `object.Header.Attribute` (#238) +- `MAINTENANCE` value of `netmap.NodeInfo.State` enum (#237) +- `NODE_UNDER_MAINTENANCE` code to `status.CommonFail` status section (#237) +- Well-known node attribute `ExternalAddr` of `netmap.NodeInfo.Attribute` (#235) + +### Changed +- Object session can be issued for a group of objects (#202) +- System network parameters are explicitly declared in `NetworkConfig.Parameter` (#214) + ## [2.13.1] - 2022-08-01 ### Added @@ -471,3 +484,4 @@ Bump major release [2.12.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.11.0...v2.12.0 [2.13.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.12.0...v2.13.0 [2.13.1]: https://github.com/nspcc-dev/neofs-api/compare/v2.13.0...v2.13.1 +[2.14.0]: https://github.com/nspcc-dev/neofs-api/compare/v2.13.1...v2.14.0 From 813c04bea4a23b99fb90666b1b325c95e0a364cf Mon Sep 17 00:00:00 2001 From: anastasia prasolova Date: Sun, 16 Oct 2022 21:02:11 +0300 Subject: [PATCH 378/440] Add CODEOWNERS file Signed-off-by: anastasia prasolova --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..166c90d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @alexvanin @realloc @fyrchik @cthulhu-rider From dcabc511f378bdf7b03357565b2873bc4f9497b7 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 8 Dec 2022 14:21:55 +0300 Subject: [PATCH 379/440] Fix CODEOWNERS Signed-off-by: Stanislav Bogatyrev --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 166c90d..29c4211 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @alexvanin @realloc @fyrchik @cthulhu-rider +* @alexvanin @realloc @fyrchik @anatoly-bogatyrev From 653e1f92aa74952b5d74e5e823f7e700031c07c8 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Thu, 8 Dec 2022 14:22:14 +0300 Subject: [PATCH 380/440] Rebranding FrostFS continues the development of NeoFS. Signed-off-by: Stanislav Bogatyrev --- CONTRIBUTING.md | 16 ++++++++-------- CREDITS.md | 2 ++ README.md | 15 +++++++-------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33ba4ca..c26de50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ First, thank you for contributing! We love and encourage pull requests from everyone. Please follow the guidelines: -- Check the open [issues](https://github.com/nspcc-dev/neofs-api/issues) and - [pull requests](https://github.com/nspcc-dev/neofs-api/pulls) for existing +- Check the open [issues](https://github.com/TrueCloudLab/frostfs-api/issues) and + [pull requests](https://github.com/TrueCloudLab/frostfs-api/pulls) for existing discussions. - Open an issue first, to discuss a new feature or enhancement. @@ -21,23 +21,23 @@ everyone. Please follow the guidelines: ## Development Workflow -Start by forking the `neofs-api` repository, make changes in a branch and then +Start by forking the `frostfs-api` repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: ### Set up your GitHub Repository -Fork [NeoFS node upstream](https://github.com/nspcc-dev/neofs-api/fork) source +Fork [NeoFS node upstream](https://github.com/TrueCloudLab/frostfs-api/fork) source repository to your own personal repository. Copy the URL of your fork (you will need it for the `git clone` command below). ```sh -$ git clone https://github.com/nspcc-dev/neofs-api +$ git clone https://github.com/TrueCloudLab/frostfs-api ``` ### Set up git remote as ``upstream`` ```sh -$ cd neofs-api -$ git remote add upstream https://github.com/nspcc-dev/neofs-api +$ cd frostfs-api +$ git remote add upstream https://github.com/TrueCloudLab/frostfs-api $ git fetch upstream $ git merge upstream/master ... @@ -103,7 +103,7 @@ contributors". To sign your work, just add a line like this at the end of your commit message: ``` -Signed-off-by: Samii Sakisaka +Signed-off-by: Samii Sakisaka ``` This can be done easily with the `--signoff` option to `git commit`. diff --git a/CREDITS.md b/CREDITS.md index f786376..de610a8 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,5 +1,7 @@ # Credits +FrostFS continues the development of NeoFS. + Initial NeoFS research and development (2018-2020) was done by [NeoSPCC](https://nspcc.ru) team. diff --git a/README.md b/README.md index ce5ad24..5a262ae 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@

-NeoFS +FrostFS

- NeoFS API language-agnostic protocol definitions + FrostFS API language-agnostic protocol definitions

--- -![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nspcc-dev/neofs-api?sort=semver) -![License](https://img.shields.io/github/license/nspcc-dev/neofs-api.svg?style=popout) +![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/TrueCloudLab/frostfs-api?sort=semver) +![License](https://img.shields.io/github/license/TrueCloudLab/frostfs-api.svg?style=popout) ## Overview -NeoFS-API repository is the basis for language-specific libraries, e.g.: +FrostFS-API repository is the basis for language-specific libraries, e.g.: -- [neofs-api-go](https://github.com/nspcc-dev/neofs-api-go) -- [neofs-api-csharp](https://github.com/nspcc-dev/neofs-api-csharp) +- [frostfs-api-go](https://github.com/TrueCloudLab/frostfs-api-go) Those libraries contain compiled protocol buffers definitions, wrapped with -language-specific code. Use them to integrate applications with NeoFS. +language-specific code. Use them to integrate applications with FrostFS. This repository contains: From 7431075ca1f7d285301a88a835e65a5d87fd2156 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 9 Dec 2022 14:18:06 +0300 Subject: [PATCH 381/440] Rename go package names Signed-off-by: Evgenii Stratonikov --- accounting/service.proto | 2 +- accounting/types.proto | 2 +- acl/types.proto | 2 +- audit/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- lock/types.proto | 2 +- netmap/service.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 2 +- reputation/service.proto | 2 +- reputation/types.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- status/types.proto | 2 +- storagegroup/types.proto | 2 +- subnet/types.proto | 2 +- tombstone/types.proto | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index bc44b5b..154382a 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "Neo.FileStorage.API.Accounting"; import "accounting/types.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index f1facbf..af16f84 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/accounting/grpc;accounting"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "Neo.FileStorage.API.Accounting"; // Standard floating point data type can't be used in NeoFS due to inexactness diff --git a/acl/types.proto b/acl/types.proto index 2bf5f23..95b18b5 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.acl; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/acl/grpc;acl"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc;acl"; option csharp_namespace = "Neo.FileStorage.API.Acl"; import "refs/types.proto"; diff --git a/audit/types.proto b/audit/types.proto index 8a9bb72..156a31b 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.audit; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/audit/grpc;audit"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/audit/grpc;audit"; option csharp_namespace = "Neo.FileStorage.API.Audit"; import "refs/types.proto"; diff --git a/container/service.proto b/container/service.proto index 69d96a3..249bfb1 100644 --- a/container/service.proto +++ b/container/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option csharp_namespace = "Neo.FileStorage.API.Container"; import "acl/types.proto"; diff --git a/container/types.proto b/container/types.proto index a710a4b..a735f74 100644 --- a/container/types.proto +++ b/container/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/container/grpc;container"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option csharp_namespace = "Neo.FileStorage.API.Container"; import "netmap/types.proto"; diff --git a/lock/types.proto b/lock/types.proto index da811b8..a2eb833 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.lock; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/lock/grpc;lock"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/lock/grpc;lock"; option csharp_namespace = "Neo.FileStorage.API.Lock"; import "refs/types.proto"; diff --git a/netmap/service.proto b/netmap/service.proto index 1898b3a..922cc3e 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; import "netmap/types.proto"; diff --git a/netmap/types.proto b/netmap/types.proto index 6163687..e4b5e6d 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc;netmap"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; import "refs/types.proto"; diff --git a/object/service.proto b/object/service.proto index 853ce00..7170b31 100644 --- a/object/service.proto +++ b/object/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option csharp_namespace = "Neo.FileStorage.API.Object"; import "object/types.proto"; diff --git a/object/types.proto b/object/types.proto index 82d9b9a..78ed3c5 100644 --- a/object/types.proto +++ b/object/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option csharp_namespace = "Neo.FileStorage.API.Object"; import "refs/types.proto"; diff --git a/refs/types.proto b/refs/types.proto index 729fc1b..07659f3 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.refs; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc;refs"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "Neo.FileStorage.API.Refs"; // Objects in NeoFS are addressed by their ContainerID and ObjectID. diff --git a/reputation/service.proto b/reputation/service.proto index c430c5e..ecdb60f 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.reputation; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "reputation/types.proto"; diff --git a/reputation/types.proto b/reputation/types.proto index 627008d..11915ae 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.reputation; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc;reputation"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "refs/types.proto"; diff --git a/session/service.proto b/session/service.proto index 98c2ca4..355d3fc 100644 --- a/session/service.proto +++ b/session/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.session; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; diff --git a/session/types.proto b/session/types.proto index d00e99f..71c0e54 100644 --- a/session/types.proto +++ b/session/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.session; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; diff --git a/status/types.proto b/status/types.proto index 1b4a9fc..4c1eb1d 100644 --- a/status/types.proto +++ b/status/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.status; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/status/grpc;status"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc;status"; option csharp_namespace = "Neo.FileStorage.API.Status"; // Declares the general format of the status returns of the NeoFS RPC protocol. diff --git a/storagegroup/types.proto b/storagegroup/types.proto index c54c741..1522f1f 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.storagegroup; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/storagegroup/grpc;storagegroup"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc;storagegroup"; option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; import "refs/types.proto"; diff --git a/subnet/types.proto b/subnet/types.proto index aa69bba..6fe5f36 100644 --- a/subnet/types.proto +++ b/subnet/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.subnet; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/subnet/grpc;subnet"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/subnet/grpc;subnet"; option csharp_namespace = "Neo.FileStorage.API.Subnet"; import "refs/types.proto"; diff --git a/tombstone/types.proto b/tombstone/types.proto index 5a94d3b..70ff8db 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.tombstone; -option go_package = "github.com/nspcc-dev/neofs-api-go/v2/tombstone/grpc;tombstone"; +option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc;tombstone"; option csharp_namespace = "Neo.FileStorage.API.Tombstone"; import "refs/types.proto"; From 90be159ed474b7d6ea1aca3bafed0397e475934b Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Sun, 8 Jan 2023 10:35:08 +0300 Subject: [PATCH 382/440] Change logo Signed-off-by: Stanislav Bogatyrev --- .github/logo.svg | 197 +++++++++++++++++------------------------------ 1 file changed, 69 insertions(+), 128 deletions(-) diff --git a/.github/logo.svg b/.github/logo.svg index b4da076..148c359 100644 --- a/.github/logo.svg +++ b/.github/logo.svg @@ -1,129 +1,70 @@ - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + From eafcbff11fc3b0fefee45a8569f2a6521d74f3c7 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Tue, 7 Mar 2023 11:50:02 +0300 Subject: [PATCH 383/440] Rename go package names Due to source code relocation from GitHub. Signed-off-by: Alex Vanin --- accounting/service.proto | 2 +- accounting/types.proto | 2 +- acl/types.proto | 2 +- audit/types.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- lock/types.proto | 2 +- netmap/service.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 2 +- reputation/service.proto | 2 +- reputation/types.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- status/types.proto | 2 +- storagegroup/types.proto | 2 +- subnet/types.proto | 2 +- tombstone/types.proto | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index 154382a..6574404 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "Neo.FileStorage.API.Accounting"; import "accounting/types.proto"; diff --git a/accounting/types.proto b/accounting/types.proto index af16f84..205332e 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.accounting; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "Neo.FileStorage.API.Accounting"; // Standard floating point data type can't be used in NeoFS due to inexactness diff --git a/acl/types.proto b/acl/types.proto index 95b18b5..1ca947a 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.acl; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/acl/grpc;acl"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc;acl"; option csharp_namespace = "Neo.FileStorage.API.Acl"; import "refs/types.proto"; diff --git a/audit/types.proto b/audit/types.proto index 156a31b..c83260c 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.audit; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/audit/grpc;audit"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc;audit"; option csharp_namespace = "Neo.FileStorage.API.Audit"; import "refs/types.proto"; diff --git a/container/service.proto b/container/service.proto index 249bfb1..8c5f84e 100644 --- a/container/service.proto +++ b/container/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option csharp_namespace = "Neo.FileStorage.API.Container"; import "acl/types.proto"; diff --git a/container/types.proto b/container/types.proto index a735f74..71fbaa2 100644 --- a/container/types.proto +++ b/container/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.container; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option csharp_namespace = "Neo.FileStorage.API.Container"; import "netmap/types.proto"; diff --git a/lock/types.proto b/lock/types.proto index a2eb833..a278709 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.lock; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/lock/grpc;lock"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/lock/grpc;lock"; option csharp_namespace = "Neo.FileStorage.API.Lock"; import "refs/types.proto"; diff --git a/netmap/service.proto b/netmap/service.proto index 922cc3e..179a2c1 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; import "netmap/types.proto"; diff --git a/netmap/types.proto b/netmap/types.proto index e4b5e6d..f6bd43e 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.netmap; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; import "refs/types.proto"; diff --git a/object/service.proto b/object/service.proto index 7170b31..dfc0892 100644 --- a/object/service.proto +++ b/object/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option csharp_namespace = "Neo.FileStorage.API.Object"; import "object/types.proto"; diff --git a/object/types.proto b/object/types.proto index 78ed3c5..ff970ed 100644 --- a/object/types.proto +++ b/object/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.object; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/grpc;object"; option csharp_namespace = "Neo.FileStorage.API.Object"; import "refs/types.proto"; diff --git a/refs/types.proto b/refs/types.proto index 07659f3..054443e 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.refs; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "Neo.FileStorage.API.Refs"; // Objects in NeoFS are addressed by their ContainerID and ObjectID. diff --git a/reputation/service.proto b/reputation/service.proto index ecdb60f..2b3c9a6 100644 --- a/reputation/service.proto +++ b/reputation/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.reputation; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "reputation/types.proto"; diff --git a/reputation/types.proto b/reputation/types.proto index 11915ae..74262e7 100644 --- a/reputation/types.proto +++ b/reputation/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.reputation; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; option csharp_namespace = "Neo.FileStorage.API.Reputation"; import "refs/types.proto"; diff --git a/session/service.proto b/session/service.proto index 355d3fc..dcda6c8 100644 --- a/session/service.proto +++ b/session/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.session; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; diff --git a/session/types.proto b/session/types.proto index 71c0e54..2a236d6 100644 --- a/session/types.proto +++ b/session/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.session; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc;session"; option csharp_namespace = "Neo.FileStorage.API.Session"; import "refs/types.proto"; diff --git a/status/types.proto b/status/types.proto index 4c1eb1d..34134a4 100644 --- a/status/types.proto +++ b/status/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.status; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/status/grpc;status"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc;status"; option csharp_namespace = "Neo.FileStorage.API.Status"; // Declares the general format of the status returns of the NeoFS RPC protocol. diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 1522f1f..f504afe 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.storagegroup; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc;storagegroup"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc;storagegroup"; option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; import "refs/types.proto"; diff --git a/subnet/types.proto b/subnet/types.proto index 6fe5f36..cc9cae3 100644 --- a/subnet/types.proto +++ b/subnet/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.subnet; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/subnet/grpc;subnet"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/grpc;subnet"; option csharp_namespace = "Neo.FileStorage.API.Subnet"; import "refs/types.proto"; diff --git a/tombstone/types.proto b/tombstone/types.proto index 70ff8db..1a31726 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package neo.fs.v2.tombstone; -option go_package = "github.com/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc;tombstone"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/tombstone/grpc;tombstone"; option csharp_namespace = "Neo.FileStorage.API.Tombstone"; import "refs/types.proto"; From 3adb55c38a9cc4c699f448858593e3d851d682a2 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 6 Mar 2023 14:56:09 +0300 Subject: [PATCH 384/440] [#12] Add __FROSTFS__ system prefix Signed-off-by: Denis Kirillov --- container/types.proto | 10 +++++----- lock/types.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 22 +++++++++++----------- object/types.proto | 10 +++++----- proto-docs/container.md | 10 +++++----- proto-docs/lock.md | 2 +- proto-docs/netmap.md | 2 +- proto-docs/object.md | 32 ++++++++++++++++---------------- proto-docs/session.md | 6 +++--- proto-docs/storagegroup.md | 2 +- proto-docs/tombstone.md | 2 +- session/types.proto | 6 +++--- storagegroup/types.proto | 2 +- tombstone/types.proto | 2 +- 15 files changed, 56 insertions(+), 56 deletions(-) diff --git a/container/types.proto b/container/types.proto index 71fbaa2..050189a 100644 --- a/container/types.proto +++ b/container/types.proto @@ -37,16 +37,16 @@ message Container { // // There are some "well-known" attributes affecting system behaviour: // - // * __NEOFS__SUBNET \ + // * [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ // String ID of a container's storage subnet. Any container can be attached to // one subnet only. - // * __NEOFS__NAME \ + // * [ __NEOFS__NAME | __FROSTFS__NAME ] \ // String of a human-friendly container name registered as a domain in // NNS contract. - // * __NEOFS__ZONE \ - // String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS + // * [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ + // String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS // contract. If no zone is specified, use default zone: `container`. - // * __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ + // * [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ // Disables homomorphic hashing for the container if the value equals "true" string. // Any other values are interpreted as missing attribute. Container could be // accepted in a NeoFS network only if the global network hashing configuration diff --git a/lock/types.proto b/lock/types.proto index a278709..ac52966 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -9,7 +9,7 @@ import "refs/types.proto"; // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. // It is impossible to delete a lock object via ObjectService.Delete RPC call. message Lock { // List of objects to lock. Must not be empty or carry empty IDs. diff --git a/netmap/types.proto b/netmap/types.proto index f6bd43e..6b58cd6 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -164,7 +164,7 @@ message NodeInfo { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. - // * __NEOFS__SUBNET_%s \ + // * [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ // `True` or `False`. Defines if the node is included in the `%s` subnetwork // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). // A node can be included in more than one subnetwork and, therefore, can contain diff --git a/object/service.proto b/object/service.proto index dfc0892..301d526 100644 --- a/object/service.proto +++ b/object/service.proto @@ -20,11 +20,11 @@ service ObjectService { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or + // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -54,7 +54,7 @@ service ObjectService { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -85,7 +85,7 @@ service ObjectService { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -110,7 +110,7 @@ service ObjectService { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -137,7 +137,7 @@ service ObjectService { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -161,10 +161,10 @@ service ObjectService { // order. // // Extended headers can change `GetRange` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ + // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -194,10 +194,10 @@ service ObjectService { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * __NEOFS__NETMAP_EPOCH \ + // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Will use the requsted version of Network Map for object placement // calculation. - // * __NEOFS__NETMAP_LOOKUP_DEPTH \ + // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // diff --git a/object/types.proto b/object/types.proto index ff970ed..ec19334 100644 --- a/object/types.proto +++ b/object/types.proto @@ -114,19 +114,19 @@ message Header { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // - // There are some "well-known" attributes starting with `__NEOFS__` prefix + // There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix // that affect system behaviour: // - // * __NEOFS__UPLOAD_ID \ + // * [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ // Marks smaller parts of a split bigger object - // * __NEOFS__EXPIRATION_EPOCH \ + // * [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ // Tells GC to delete object after that epoch - // * __NEOFS__TICK_EPOCH \ + // * [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ // Decimal number that defines what epoch must produce // object notification with UTF-8 object address in a // body (`0` value produces notification right after // object put) - // * __NEOFS__TICK_TOPIC \ + // * [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ // UTF-8 string topic ID that is used for object notification // // And some well-known attributes used by applications only: diff --git a/proto-docs/container.md b/proto-docs/container.md index b518a67..9cd2d03 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -587,16 +587,16 @@ values will be considered invalid. There are some "well-known" attributes affecting system behaviour: -* __NEOFS__SUBNET \ +* [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ String ID of a container's storage subnet. Any container can be attached to one subnet only. -* __NEOFS__NAME \ +* [ __NEOFS__NAME | __FROSTFS__NAME ] \ String of a human-friendly container name registered as a domain in NNS contract. -* __NEOFS__ZONE \ - String of a zone for `__NEOFS__NAME`. Used as a TLD of a domain name in NNS +* [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ + String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS contract. If no zone is specified, use default zone: `container`. -* __NEOFS__DISABLE_HOMOMORPHIC_HASHING \ +* [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ Disables homomorphic hashing for the container if the value equals "true" string. Any other values are interpreted as missing attribute. Container could be accepted in a NeoFS network only if the global network hashing configuration diff --git a/proto-docs/lock.md b/proto-docs/lock.md index 3bbbf79..80128db 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -27,7 +27,7 @@ ### Message Lock Lock objects protects a list of objects from being deleted. The lifetime of a lock object is limited similar to regular objects in -`__NEOFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +`__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. It is impossible to delete a lock object via ObjectService.Delete RPC call. diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 2c7545d..0a9f376 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -406,7 +406,7 @@ explicitly set: attributes it's a string presenting floating point number with comma or point delimiter for decimal part. In the Network Map it will be saved as 64-bit unsigned integer representing number of minimal token fractions. -* __NEOFS__SUBNET_%s \ +* [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ `True` or `False`. Defines if the node is included in the `%s` subnetwork or not. `%s` must be an existing subnetwork's ID (non-negative integer number). A node can be included in more than one subnetwork and, therefore, can contain diff --git a/proto-docs/object.md b/proto-docs/object.md index e22f6c0..f0e97eb 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -93,11 +93,11 @@ be restored by concatenation of object message payload and all chunks keeping the receiving order. Extended headers can change `Get` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. -* __NEOFS__NETMAP_LOOKUP_DEPTH \ - Will try older versions (starting from `__NEOFS__NETMAP_EPOCH` if specified or +* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or the latest one otherwise) of Network Map to find an object until the depth limit is reached. @@ -131,7 +131,7 @@ object payload. All messages, except first one, SHOULD be payload chunks. Chunk messages SHOULD be sent in the direct order of fragmentation. Extended headers can change `Put` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ Will use the requsted version of Network Map for object placement calculation. @@ -166,7 +166,7 @@ Delete the object from a container. There is no immediate removal guarantee. Object will be marked for removal and deleted eventually. Extended headers can change `Delete` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. @@ -195,7 +195,7 @@ returned. If `main_only` request field is set, the short header with only the very minimal information will be returned instead. Extended headers can change `Head` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. @@ -226,7 +226,7 @@ Header's filed values. Please see the corresponding NeoFS Technical Specification section for more details. Extended headers can change `Search` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. @@ -254,10 +254,10 @@ restored by concatenation of all received payload chunks keeping the receiving order. Extended headers can change `GetRange` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. -* __NEOFS__NETMAP_LOOKUP_DEPTH \ +* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ Will try older versions of Network Map to find an object until the depth limit is reached. @@ -291,10 +291,10 @@ length) tuples. Hashes order in response corresponds to the ranges order in the request. Note that hash is calculated for XORed data. Extended headers can change `GetRangeHash` behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Will use the requsted version of Network Map for object placement calculation. -* __NEOFS__NETMAP_LOOKUP_DEPTH \ +* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ Will try older versions of Network Map to find an object until the depth limit is reached. @@ -848,19 +848,19 @@ Key name must be an object-unique valid UTF-8 string. Value can't be empty. Objects with duplicated attribute names or attributes with empty values will be considered invalid. -There are some "well-known" attributes starting with `__NEOFS__` prefix +There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix that affect system behaviour: -* __NEOFS__UPLOAD_ID \ +* [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ Marks smaller parts of a split bigger object -* __NEOFS__EXPIRATION_EPOCH \ +* [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ Tells GC to delete object after that epoch -* __NEOFS__TICK_EPOCH \ +* [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ Decimal number that defines what epoch must produce object notification with UTF-8 object address in a body (`0` value produces notification right after object put) -* __NEOFS__TICK_TOPIC \ +* [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ UTF-8 string topic ID that is used for object notification And some well-known attributes used by applications only: diff --git a/proto-docs/session.md b/proto-docs/session.md index 2cdfd1e..8dcc6bc 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -285,14 +285,14 @@ Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or Responses with duplicated header names or headers with empty values will be considered invalid. -There are some "well-known" headers starting with `__NEOFS__` prefix that +There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that affect system behaviour: -* __NEOFS__NETMAP_EPOCH \ +* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ Netmap epoch to use for object placement calculation. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, the current epoch only will be used. -* __NEOFS__NETMAP_LOOKUP_DEPTH \ +* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ If object can't be found using current epoch's netmap, this header limits how many past epochs the node can look up through. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index 3bc0b5e..c31f3e4 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -31,7 +31,7 @@ additional information used for the proof of storage. `StorageGroup` only contains objects from the same container. Being an object payload, StorageGroup may have expiration Epoch set with -`__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +`__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup will be ignored by InnerRing nodes during Data Audit cycles and will be deleted by Storage Nodes. diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 4657935..3da8c4b 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -31,7 +31,7 @@ purged from the NeoFS network. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` attribute. Otherwise, the tombstone will be rejected by a storage node. | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Otherwise, the tombstone will be rejected by a storage node. | | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside a container. All objects participating in the split must have the same `split_id` value. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | diff --git a/session/types.proto b/session/types.proto index 2a236d6..5963c40 100644 --- a/session/types.proto +++ b/session/types.proto @@ -137,14 +137,14 @@ message SessionToken { // Responses with duplicated header names or headers with empty values will be // considered invalid. // -// There are some "well-known" headers starting with `__NEOFS__` prefix that +// There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that // affect system behaviour: // -// * __NEOFS__NETMAP_EPOCH \ +// * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ // Netmap epoch to use for object placement calculation. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, the // current epoch only will be used. -// * __NEOFS__NETMAP_LOOKUP_DEPTH \ +// * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/storagegroup/types.proto b/storagegroup/types.proto index f504afe..946affe 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -13,7 +13,7 @@ import "refs/types.proto"; // contains objects from the same container. // // Being an object payload, StorageGroup may have expiration Epoch set with -// `__NEOFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup // will be ignored by InnerRing nodes during Data Audit cycles and will be // deleted by Storage Nodes. // diff --git a/tombstone/types.proto b/tombstone/types.proto index 1a31726..1e475d6 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -12,7 +12,7 @@ import "refs/types.proto"; message Tombstone { // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH` + // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` // attribute. Otherwise, the tombstone will be rejected by a storage node. uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; From 5fd4059061b8922d671b7e6e4615e1a865edf527 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 14 Mar 2023 10:24:35 +0300 Subject: [PATCH 385/440] [#14] Rename __FROSTFS__ to __SYSTEM__ Signed-off-by: Denis Kirillov --- CHANGELOG.md | 5 ++++ container/types.proto | 14 ++++++---- lock/types.proto | 2 +- netmap/types.proto | 3 +- object/service.proto | 42 +++++++++++++++++----------- object/types.proto | 14 ++++++---- proto-docs/container.md | 14 ++++++---- proto-docs/lock.md | 2 +- proto-docs/netmap.md | 3 +- proto-docs/object.md | 56 ++++++++++++++++++++++++-------------- proto-docs/session.md | 8 ++++-- proto-docs/storagegroup.md | 2 +- proto-docs/tombstone.md | 2 +- session/types.proto | 8 ++++-- storagegroup/types.proto | 2 +- tombstone/types.proto | 2 +- 16 files changed, 113 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f2852..db99bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [Unreleased] + +### Changed +- Add `__SYSTEM__` attribute prefix (#12, #14) + ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) ### Added diff --git a/container/types.proto b/container/types.proto index 050189a..17ce39c 100644 --- a/container/types.proto +++ b/container/types.proto @@ -37,16 +37,20 @@ message Container { // // There are some "well-known" attributes affecting system behaviour: // - // * [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ + // * [ __SYSTEM__SUBNET ] \ + // (`__NEOFS__SUBNET` is deprecated) \ // String ID of a container's storage subnet. Any container can be attached to // one subnet only. - // * [ __NEOFS__NAME | __FROSTFS__NAME ] \ + // * [ __SYSTEM__NAME ] \ + // (`__NEOFS__NAME` is deprecated) \ // String of a human-friendly container name registered as a domain in // NNS contract. - // * [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ - // String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS + // * [ __SYSTEM__ZONE ] \ + // (`__NEOFS__ZONE` is deprecated) \ + // String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS // contract. If no zone is specified, use default zone: `container`. - // * [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ + // * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ + // (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ // Disables homomorphic hashing for the container if the value equals "true" string. // Any other values are interpreted as missing attribute. Container could be // accepted in a NeoFS network only if the global network hashing configuration diff --git a/lock/types.proto b/lock/types.proto index ac52966..52cbdea 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -9,7 +9,7 @@ import "refs/types.proto"; // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch. // It is impossible to delete a lock object via ObjectService.Delete RPC call. message Lock { // List of objects to lock. Must not be empty or carry empty IDs. diff --git a/netmap/types.proto b/netmap/types.proto index 6b58cd6..750e523 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -164,7 +164,8 @@ message NodeInfo { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. - // * [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ + // * [ __SYSTEM__SUBNET_%s ] \ + // (`__NEOFS__SUBNET_%s` is deprecated) \ // `True` or `False`. Defines if the node is included in the `%s` subnetwork // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). // A node can be included in more than one subnetwork and, therefore, can contain diff --git a/object/service.proto b/object/service.proto index 301d526..17be2c1 100644 --- a/object/service.proto +++ b/object/service.proto @@ -20,11 +20,13 @@ service ObjectService { // keeping the receiving order. // // Extended headers can change `Get` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. - // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ - // Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or // the latest one otherwise) of Network Map to find an object until the depth // limit is reached. // @@ -54,7 +56,8 @@ service ObjectService { // Chunk messages SHOULD be sent in the direct order of fragmentation. // // Extended headers can change `Put` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Will use the requsted version of Network Map for object placement // calculation. // @@ -85,8 +88,9 @@ service ObjectService { // guarantee. Object will be marked for removal and deleted eventually. // // Extended headers can change `Delete` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -110,8 +114,9 @@ service ObjectService { // the very minimal information will be returned instead. // // Extended headers can change `Head` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -137,8 +142,9 @@ service ObjectService { // Specification section for more details. // // Extended headers can change `Search` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. // // Please refer to detailed `XHeader` description. @@ -161,10 +167,12 @@ service ObjectService { // order. // // Extended headers can change `GetRange` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // @@ -194,10 +202,12 @@ service ObjectService { // the request. Note that hash is calculated for XORed data. // // Extended headers can change `GetRangeHash` behaviour: - // * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - // Will use the requsted version of Network Map for object placement + // * [ __SYSTEM__NETMAP_EPOCH ] \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement // calculation. - // * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ + // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // Will try older versions of Network Map to find an object until the depth // limit is reached. // diff --git a/object/types.proto b/object/types.proto index ec19334..2af9b6a 100644 --- a/object/types.proto +++ b/object/types.proto @@ -114,19 +114,23 @@ message Header { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // - // There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix + // There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix // that affect system behaviour: // - // * [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ + // * [ __SYSTEM__UPLOAD_ID ] \ + // (`__NEOFS__UPLOAD_ID` is deprecated) \ // Marks smaller parts of a split bigger object - // * [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ + // * [ __SYSTEM__EXPIRATION_EPOCH ] \ + // (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ // Tells GC to delete object after that epoch - // * [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ + // * [ __SYSTEM__TICK_EPOCH ] \ + // (`__NEOFS__TICK_EPOCH` is deprecated) \ // Decimal number that defines what epoch must produce // object notification with UTF-8 object address in a // body (`0` value produces notification right after // object put) - // * [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ + // * [ __SYSTEM__TICK_TOPIC ] \ + // (`__NEOFS__TICK_TOPIC` is deprecated) \ // UTF-8 string topic ID that is used for object notification // // And some well-known attributes used by applications only: diff --git a/proto-docs/container.md b/proto-docs/container.md index 9cd2d03..aae323d 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -587,16 +587,20 @@ values will be considered invalid. There are some "well-known" attributes affecting system behaviour: -* [ __NEOFS__SUBNET | __FROSTFS__SUBNET ] \ +* [ __SYSTEM__SUBNET ] \ + (`__NEOFS__SUBNET` is deprecated) \ String ID of a container's storage subnet. Any container can be attached to one subnet only. -* [ __NEOFS__NAME | __FROSTFS__NAME ] \ +* [ __SYSTEM__NAME ] \ + (`__NEOFS__NAME` is deprecated) \ String of a human-friendly container name registered as a domain in NNS contract. -* [ __NEOFS__ZONE | __FROSTFS__ZONE ] \ - String of a zone for `__NEOFS__NAME`/`__FROSTFS__NAME`. Used as a TLD of a domain name in NNS +* [ __SYSTEM__ZONE ] \ + (`__NEOFS__ZONE` is deprecated) \ + String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS contract. If no zone is specified, use default zone: `container`. -* [ __NEOFS__DISABLE_HOMOMORPHIC_HASHING | __FROSTFS__DISABLE_HOMOMORPHIC_HASHING ] \ +* [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ + (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ Disables homomorphic hashing for the container if the value equals "true" string. Any other values are interpreted as missing attribute. Container could be accepted in a NeoFS network only if the global network hashing configuration diff --git a/proto-docs/lock.md b/proto-docs/lock.md index 80128db..5ed9780 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -27,7 +27,7 @@ ### Message Lock Lock objects protects a list of objects from being deleted. The lifetime of a lock object is limited similar to regular objects in -`__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Lock object MUST have expiration epoch. +`__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch. It is impossible to delete a lock object via ObjectService.Delete RPC call. diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 0a9f376..e746b78 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -406,7 +406,8 @@ explicitly set: attributes it's a string presenting floating point number with comma or point delimiter for decimal part. In the Network Map it will be saved as 64-bit unsigned integer representing number of minimal token fractions. -* [ __NEOFS__SUBNET_%s | __FROSTFS__SUBNET_%s ] \ +* [ __SYSTEM__SUBNET_%s ] \ + (`__NEOFS__SUBNET_%s` is deprecated) \ `True` or `False`. Defines if the node is included in the `%s` subnetwork or not. `%s` must be an existing subnetwork's ID (non-negative integer number). A node can be included in more than one subnetwork and, therefore, can contain diff --git a/proto-docs/object.md b/proto-docs/object.md index f0e97eb..b25fa57 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -93,11 +93,13 @@ be restored by concatenation of object message payload and all chunks keeping the receiving order. Extended headers can change `Get` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ Will use the requsted version of Network Map for object placement calculation. -* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ - Will try older versions (starting from `__NEOFS__NETMAP_EPOCH`/`__FROSTFS__NETMAP_EPOCH` if specified or +* [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ + Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one otherwise) of Network Map to find an object until the depth limit is reached. @@ -131,7 +133,8 @@ object payload. All messages, except first one, SHOULD be payload chunks. Chunk messages SHOULD be sent in the direct order of fragmentation. Extended headers can change `Put` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH \ +* [ __SYSTEM__NETMAP_EPOCH \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ Will use the requsted version of Network Map for object placement calculation. @@ -166,8 +169,9 @@ Delete the object from a container. There is no immediate removal guarantee. Object will be marked for removal and deleted eventually. Extended headers can change `Delete` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - Will use the requsted version of Network Map for object placement +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement calculation. Please refer to detailed `XHeader` description. @@ -195,8 +199,9 @@ returned. If `main_only` request field is set, the short header with only the very minimal information will be returned instead. Extended headers can change `Head` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - Will use the requsted version of Network Map for object placement +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement calculation. Please refer to detailed `XHeader` description. @@ -226,8 +231,9 @@ Header's filed values. Please see the corresponding NeoFS Technical Specification section for more details. Extended headers can change `Search` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - Will use the requsted version of Network Map for object placement +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement calculation. Please refer to detailed `XHeader` description. @@ -254,10 +260,12 @@ restored by concatenation of all received payload chunks keeping the receiving order. Extended headers can change `GetRange` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - Will use the requsted version of Network Map for object placement +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement calculation. -* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ +* [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ Will try older versions of Network Map to find an object until the depth limit is reached. @@ -291,10 +299,12 @@ length) tuples. Hashes order in response corresponds to the ranges order in the request. Note that hash is calculated for XORed data. Extended headers can change `GetRangeHash` behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ - Will use the requsted version of Network Map for object placement +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement calculation. -* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ +* [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ Will try older versions of Network Map to find an object until the depth limit is reached. @@ -848,19 +858,23 @@ Key name must be an object-unique valid UTF-8 string. Value can't be empty. Objects with duplicated attribute names or attributes with empty values will be considered invalid. -There are some "well-known" attributes starting with `__NEOFS__`/`__FROSTFS__` prefix +There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that affect system behaviour: -* [ __NEOFS__UPLOAD_ID | __FROSTFS__UPLOAD_ID ] \ +* [ __SYSTEM__UPLOAD_ID ] \ + (`__NEOFS__UPLOAD_ID` is deprecated) \ Marks smaller parts of a split bigger object -* [ __NEOFS__EXPIRATION_EPOCH | __FROSTFS__EXPIRATION_EPOCH ] \ +* [ __SYSTEM__EXPIRATION_EPOCH ] \ + (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ Tells GC to delete object after that epoch -* [ __NEOFS__TICK_EPOCH | __FROSTFS__TICK_EPOCH ] \ +* [ __SYSTEM__TICK_EPOCH ] \ + (`__NEOFS__TICK_EPOCH` is deprecated) \ Decimal number that defines what epoch must produce object notification with UTF-8 object address in a body (`0` value produces notification right after object put) -* [ __NEOFS__TICK_TOPIC | __FROSTFS__TICK_TOPIC ] \ +* [ __SYSTEM__TICK_TOPIC ] \ + (`__NEOFS__TICK_TOPIC` is deprecated) \ UTF-8 string topic ID that is used for object notification And some well-known attributes used by applications only: diff --git a/proto-docs/session.md b/proto-docs/session.md index 8dcc6bc..facb292 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -285,14 +285,16 @@ Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or Responses with duplicated header names or headers with empty values will be considered invalid. -There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that +There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that affect system behaviour: -* [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ +* [ __SYSTEM__NETMAP_EPOCH ] \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ Netmap epoch to use for object placement calculation. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, the current epoch only will be used. -* [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ +* [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ + (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ If object can't be found using current epoch's netmap, this header limits how many past epochs the node can look up through. The `value` is string encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md index c31f3e4..da765f1 100644 --- a/proto-docs/storagegroup.md +++ b/proto-docs/storagegroup.md @@ -31,7 +31,7 @@ additional information used for the proof of storage. `StorageGroup` only contains objects from the same container. Being an object payload, StorageGroup may have expiration Epoch set with -`__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +`__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup will be ignored by InnerRing nodes during Data Audit cycles and will be deleted by Storage Nodes. diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 3da8c4b..9056ad2 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -31,7 +31,7 @@ purged from the NeoFS network. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` attribute. Otherwise, the tombstone will be rejected by a storage node. | +| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Otherwise, the tombstone will be rejected by a storage node. | | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside a container. All objects participating in the split must have the same `split_id` value. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | diff --git a/session/types.proto b/session/types.proto index 5963c40..63e5ded 100644 --- a/session/types.proto +++ b/session/types.proto @@ -137,14 +137,16 @@ message SessionToken { // Responses with duplicated header names or headers with empty values will be // considered invalid. // -// There are some "well-known" headers starting with `__NEOFS__` or `__FROSTFS__` prefix that +// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that // affect system behaviour: // -// * [ __NEOFS__NETMAP_EPOCH | __FROSTFS__NETMAP_EPOCH ] \ +// * [ __SYSTEM__NETMAP_EPOCH ] \ +// (`__NEOFS__NETMAP_EPOCH` is deprecated) \ // Netmap epoch to use for object placement calculation. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, the // current epoch only will be used. -// * [ __NEOFS__NETMAP_LOOKUP_DEPTH | __FROSTFS__NETMAP_LOOKUP_DEPTH ] \ +// * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ +// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string // encoded `uint64` in decimal presentation. If set to '0' or not set, only the diff --git a/storagegroup/types.proto b/storagegroup/types.proto index 946affe..b74f755 100644 --- a/storagegroup/types.proto +++ b/storagegroup/types.proto @@ -13,7 +13,7 @@ import "refs/types.proto"; // contains objects from the same container. // // Being an object payload, StorageGroup may have expiration Epoch set with -// `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` well-known attribute. When expired, StorageGroup +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup // will be ignored by InnerRing nodes during Data Audit cycles and will be // deleted by Storage Nodes. // diff --git a/tombstone/types.proto b/tombstone/types.proto index 1e475d6..aa44a45 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -12,7 +12,7 @@ import "refs/types.proto"; message Tombstone { // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__NEOFS__EXPIRATION_EPOCH`/`__FROSTFS__EXPIRATION_EPOCH` + // must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; From fc393d4605e7e4c5545e882ef20d5dc171e25ce8 Mon Sep 17 00:00:00 2001 From: Liza Date: Wed, 22 Mar 2023 19:59:07 +0300 Subject: [PATCH 386/440] [#16] Add Issue Template Add bug report and feature request templates Signed-off-by: Liza --- .github/ISSUE_TEMPLATE/bug_report.md | 45 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..7e778d2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,45 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: community, triage, bug +assignees: '' + +--- + + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + + + + +## Steps to Reproduce (for bugs) + + + +1. + +## Context + + + +## Regression + + + +## Your Environment + +* Version used: +* Server setup and configuration: +* Operating System and version (`uname -a`): diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..3ba13e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..d6d1162 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: community, triage +assignees: '' + +--- + +## Is your feature request related to a problem? Please describe. + + +## Describe the solution you'd like + + +## Describe alternatives you've considered + + +## Additional context + From cbc038f84e7e8bf398bcc03ab53527c6b8cd18d1 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Thu, 6 Apr 2023 00:44:42 +0300 Subject: [PATCH 387/440] [#17] object: Allow set `copy_number` for every placement vector Signed-off-by: Pavel Karpy --- object/service.proto | 12 ++++++++++-- proto-docs/object.md | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/object/service.proto b/object/service.proto index 17be2c1..1d08ff5 100644 --- a/object/service.proto +++ b/object/service.proto @@ -311,9 +311,17 @@ message PutRequest { // Object's Header Header header = 3; - // Number of the object copies to store within the RPC call. By default + // Number of copies of the object to store within the RPC call. By default, // object is processed according to the container's placement policy. - uint32 copies_number = 4; + // Can be one of: + // 1. A single number; applied to the whole request and is treated as + // a minimal number of nodes that must store an object to complete the + // request successfully. + // 2. An ordered array; every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + repeated uint32 copies_number = 4; } // Single message in the request stream. oneof object_part { diff --git a/proto-docs/object.md b/proto-docs/object.md index b25fa57..8b5f460 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -658,7 +658,7 @@ are not set, they will be calculated by a peer node. | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | ObjectID if available. | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature if available | | header | [Header](#neo.fs.v2.object.Header) | | Object's Header | -| copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. By default object is processed according to the container's placement policy. | +| copies_number | [uint32](#uint32) | repeated | Number of copies of the object to store within the RPC call. By default, object is processed according to the container's placement policy. Can be one of: 1. A single number; applied to the whole request and is treated as a minimal number of nodes that must store an object to complete the request successfully. 2. An ordered array; every number is treated as a minimal number of nodes in a corresponding placement vector that must store an object to complete the request successfully. The length MUST equal the placement vectors number, otherwise request is considered malformed. | From bd50db11514ab543255c48cc5d3dfe7da7e3163c Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 21 Feb 2023 11:18:35 +0300 Subject: [PATCH 388/440] [#18] acl: Add impersonate field to bearer token Signed-off-by: Denis Kirillov --- CHANGELOG.md | 1 + acl/types.proto | 4 ++++ proto-docs/acl.md | 1 + 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db99bc4..9b67e88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changed - Add `__SYSTEM__` attribute prefix (#12, #14) +- Add `allow_impersonate` flag to bearer token (#18) ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) diff --git a/acl/types.proto b/acl/types.proto index 1ca947a..31a43d4 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -213,6 +213,10 @@ message BearerToken { } // Token expiration and valid time period parameters TokenLifetime lifetime = 3 [json_name="lifetime"]; + + // AllowImpersonate flag to consider token signer as request owner. + // If this field is true extended ACL table in token body isn't processed. + bool allow_impersonate = 4 [json_name="allowImpersonate"]; } // Bearer Token body Body body = 1 [json_name="body"]; diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 09762a1..c32f958 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -60,6 +60,7 @@ owner with additional information preventing token abuse. | eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container. If it contains `container_id` field, bearer token is only valid for this specific container. Otherwise, any container of the same owner is allowed. | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` defines to whom the token was issued. It must match the request originator's `OwnerID`. If empty, any token bearer will be accepted. | | lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | +| allow_impersonate | [bool](#bool) | | AllowImpersonate flag to consider token signer as request owner. If this field is true extended ACL table in token body isn't processed. | From b5be17014eb2e9bf457960e3420143866c923e49 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 14 Apr 2023 16:57:20 +0300 Subject: [PATCH 389/440] [#22] reputation: Drop reputation system support Signed-off-by: Pavel Karpy --- CHANGELOG.md | 3 + netmap/types.proto | 7 - proto-docs/netmap.md | 7 - proto-docs/reputation.md | 289 --------------------------------------- reputation/service.proto | 128 ----------------- reputation/types.proto | 63 --------- 6 files changed, 3 insertions(+), 494 deletions(-) delete mode 100644 proto-docs/reputation.md delete mode 100644 reputation/service.proto delete mode 100644 reputation/types.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b67e88..542f6e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ - Add `__SYSTEM__` attribute prefix (#12, #14) - Add `allow_impersonate` flag to bearer token (#18) +### Removed +- Reputation system (#22) + ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) ### Added diff --git a/netmap/types.proto b/netmap/types.proto index 750e523..8b317dc 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -273,13 +273,6 @@ message NetworkConfig { // - **ContainerFee** \ // Fee paid for container creation by the container owner. // Value: little-endian integer. Default: 0. - // - **EigenTrustAlpha** \ - // Alpha parameter of EigenTrust algorithm used in the Reputation system. - // Value: decimal floating-point number in UTF-8 string representation. - // Default: 0. - // - **EigenTrustIterations** \ - // Number of EigenTrust algorithm iterations to pass in the Reputation system. - // Value: little-endian integer. Default: 0. // - **EpochDuration** \ // NeoFS epoch duration measured in Sidechain blocks. // Value: little-endian integer. Default: 0. diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index e746b78..1467a5d 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -313,13 +313,6 @@ System parameters: - **ContainerFee** \ Fee paid for container creation by the container owner. Value: little-endian integer. Default: 0. -- **EigenTrustAlpha** \ - Alpha parameter of EigenTrust algorithm used in the Reputation system. - Value: decimal floating-point number in UTF-8 string representation. - Default: 0. -- **EigenTrustIterations** \ - Number of EigenTrust algorithm iterations to pass in the Reputation system. - Value: little-endian integer. Default: 0. - **EpochDuration** \ NeoFS epoch duration measured in Sidechain blocks. Value: little-endian integer. Default: 0. diff --git a/proto-docs/reputation.md b/proto-docs/reputation.md deleted file mode 100644 index 19558f3..0000000 --- a/proto-docs/reputation.md +++ /dev/null @@ -1,289 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [reputation/service.proto](#reputation/service.proto) - - Services - - [ReputationService](#neo.fs.v2.reputation.ReputationService) - - - Messages - - [AnnounceIntermediateResultRequest](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest) - - [AnnounceIntermediateResultRequest.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body) - - [AnnounceIntermediateResultResponse](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse) - - [AnnounceIntermediateResultResponse.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body) - - [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) - - [AnnounceLocalTrustRequest.Body](#neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body) - - [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) - - [AnnounceLocalTrustResponse.Body](#neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body) - - -- [reputation/types.proto](#reputation/types.proto) - - - Messages - - [GlobalTrust](#neo.fs.v2.reputation.GlobalTrust) - - [GlobalTrust.Body](#neo.fs.v2.reputation.GlobalTrust.Body) - - [PeerID](#neo.fs.v2.reputation.PeerID) - - [PeerToPeerTrust](#neo.fs.v2.reputation.PeerToPeerTrust) - - [Trust](#neo.fs.v2.reputation.Trust) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## reputation/service.proto - - - - - - -### Service "neo.fs.v2.reputation.ReputationService" -`ReputationService` provides mechanisms for exchanging trust values with -other NeoFS nodes. Nodes rate each other's reputation based on how good they -process requests and set a trust level based on that rating. The trust -information is passed to the next nodes to check and aggregate unless the -final result is recorded. - -``` -rpc AnnounceLocalTrust(AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); -rpc AnnounceIntermediateResult(AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse); - -``` - -#### Method AnnounceLocalTrust - -Announce local client trust information to any node in NeoFS network. - -Statuses: -- **OK** (0, SECTION_SUCCESS): -local trust has been successfully announced; -- Common failures (SECTION_FAILURE_COMMON). - -| Name | Input | Output | -| ---- | ----- | ------ | -| AnnounceLocalTrust | [AnnounceLocalTrustRequest](#neo.fs.v2.reputation.AnnounceLocalTrustRequest) | [AnnounceLocalTrustResponse](#neo.fs.v2.reputation.AnnounceLocalTrustResponse) | -#### Method AnnounceIntermediateResult - -Announce the intermediate result of the iterative algorithm for -calculating the global reputation of the node in NeoFS network. - -Statuses: -- **OK** (0, SECTION_SUCCESS): -intermediate trust estimation has been successfully announced; -- Common failures (SECTION_FAILURE_COMMON). - -| Name | Input | Output | -| ---- | ----- | ------ | -| AnnounceIntermediateResult | [AnnounceIntermediateResultRequest](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest) | [AnnounceIntermediateResultResponse](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse) | - - - - - -### Message AnnounceIntermediateResultRequest -Announce intermediate global trust information. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceIntermediateResultRequest.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultRequest.Body) | | Body of the request message. | -| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceIntermediateResultRequest.Body -Announce intermediate global trust information. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| epoch | [uint64](#uint64) | | Iteration execution Epoch number | -| iteration | [uint32](#uint32) | | Iteration sequence number | -| trust | [PeerToPeerTrust](#neo.fs.v2.reputation.PeerToPeerTrust) | | Current global trust value calculated at the specified iteration | - - - - -### Message AnnounceIntermediateResultResponse -Intermediate global trust information announcement response. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceIntermediateResultResponse.Body](#neo.fs.v2.reputation.AnnounceIntermediateResultResponse.Body) | | Body of the response message. | -| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceIntermediateResultResponse.Body -Response to the node's intermediate global trust information announcement has -an empty body because the trust exchange operation is asynchronous. If -Trust information does not pass sanity checks, it is silently ignored. - - - - - -### Message AnnounceLocalTrustRequest -Announce node's local trust information. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceLocalTrustRequest.Body](#neo.fs.v2.reputation.AnnounceLocalTrustRequest.Body) | | Body of the request message. | -| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceLocalTrustRequest.Body -Announce node's local trust information. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| epoch | [uint64](#uint64) | | Trust assessment Epoch number | -| trusts | [Trust](#neo.fs.v2.reputation.Trust) | repeated | List of normalized local trust values to other NeoFS nodes. The value is calculated according to EigenTrust++ algorithm and must be a floating point number in [0;1] range. | - - - - -### Message AnnounceLocalTrustResponse -Node's local trust information announcement response. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceLocalTrustResponse.Body](#neo.fs.v2.reputation.AnnounceLocalTrustResponse.Body) | | Body of the response message. | -| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceLocalTrustResponse.Body -Response to the node's local trust information announcement has an empty body -because the trust exchange operation is asynchronous. If Trust information -does not pass sanity checks, it is silently ignored. - - - - - - - - - -

Top

- -## reputation/types.proto - - - - - - - -### Message GlobalTrust -Global trust level to NeoFS node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Message format version. Effectively, the version of API library used to create the message. | -| body | [GlobalTrust.Body](#neo.fs.v2.reputation.GlobalTrust.Body) | | Message body | -| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of the binary `body` field by the manager. | - - - - -### Message GlobalTrust.Body -Message body structure. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| manager | [PeerID](#neo.fs.v2.reputation.PeerID) | | Node manager ID | -| trust | [Trust](#neo.fs.v2.reputation.Trust) | | Global trust level | - - - - -### Message PeerID -NeoFS unique peer identifier is a 33 byte long compressed public key of the -node, the same as the one stored in the network map. - -String presentation is a -[base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. - -JSON value will be data encoded as a string using standard base64 -encoding with paddings. Either -[standard](https://tools.ietf.org/html/rfc4648#section-4) or -[URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -with/without paddings are accepted. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| public_key | [bytes](#bytes) | | Peer node's public key | - - - - -### Message PeerToPeerTrust -Trust level of a peer to a peer. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| trusting_peer | [PeerID](#neo.fs.v2.reputation.PeerID) | | Identifier of the trusting peer | -| trust | [Trust](#neo.fs.v2.reputation.Trust) | | Trust level | - - - - -### Message Trust -Trust level to a NeoFS network peer. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| peer | [PeerID](#neo.fs.v2.reputation.PeerID) | | Identifier of the trusted peer | -| value | [double](#double) | | Trust level in [0:1] range | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/reputation/service.proto b/reputation/service.proto deleted file mode 100644 index 2b3c9a6..0000000 --- a/reputation/service.proto +++ /dev/null @@ -1,128 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.reputation; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; -option csharp_namespace = "Neo.FileStorage.API.Reputation"; - -import "reputation/types.proto"; -import "session/types.proto"; - -// `ReputationService` provides mechanisms for exchanging trust values with -// other NeoFS nodes. Nodes rate each other's reputation based on how good they -// process requests and set a trust level based on that rating. The trust -// information is passed to the next nodes to check and aggregate unless the -// final result is recorded. -service ReputationService { - // Announce local client trust information to any node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // local trust has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - rpc AnnounceLocalTrust (AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse); - - // Announce the intermediate result of the iterative algorithm for - // calculating the global reputation of the node in NeoFS network. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): - // intermediate trust estimation has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - rpc AnnounceIntermediateResult (AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse); -} - -// Announce node's local trust information. -message AnnounceLocalTrustRequest { - // Announce node's local trust information. - message Body { - // Trust assessment Epoch number - uint64 epoch = 1; - - // List of normalized local trust values to other NeoFS nodes. The value - // is calculated according to EigenTrust++ algorithm and must be a - // floating point number in [0;1] range. - repeated Trust trusts = 2; - } - - // Body of the request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; -} - -// Node's local trust information announcement response. -message AnnounceLocalTrustResponse { - // Response to the node's local trust information announcement has an empty body - // because the trust exchange operation is asynchronous. If Trust information - // does not pass sanity checks, it is silently ignored. - message Body { - } - - // Body of the response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} - -// Announce intermediate global trust information. -message AnnounceIntermediateResultRequest { - // Announce intermediate global trust information. - message Body { - // Iteration execution Epoch number - uint64 epoch = 1; - - // Iteration sequence number - uint32 iteration = 2; - - // Current global trust value calculated at the specified iteration - PeerToPeerTrust trust = 3; - } - - // Body of the request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; -} - -// Intermediate global trust information announcement response. -message AnnounceIntermediateResultResponse { - // Response to the node's intermediate global trust information announcement has - // an empty body because the trust exchange operation is asynchronous. If - // Trust information does not pass sanity checks, it is silently ignored. - message Body { - } - - // Body of the response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} diff --git a/reputation/types.proto b/reputation/types.proto deleted file mode 100644 index 74262e7..0000000 --- a/reputation/types.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.reputation; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/reputation/grpc;reputation"; -option csharp_namespace = "Neo.FileStorage.API.Reputation"; - -import "refs/types.proto"; - -// NeoFS unique peer identifier is a 33 byte long compressed public key of the -// node, the same as the one stored in the network map. -// -// String presentation is a -// [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. -// -// JSON value will be data encoded as a string using standard base64 -// encoding with paddings. Either -// [standard](https://tools.ietf.org/html/rfc4648#section-4) or -// [URL-safe](https://tools.ietf.org/html/rfc4648#section-5) base64 encoding -// with/without paddings are accepted. -message PeerID { - // Peer node's public key - bytes public_key = 1 [json_name = "publicKey"]; -} - -// Trust level to a NeoFS network peer. -message Trust { - // Identifier of the trusted peer - PeerID peer = 1 [json_name = "peer"]; - - // Trust level in [0:1] range - double value = 2 [json_name = "value"]; -} - -// Trust level of a peer to a peer. -message PeerToPeerTrust { - // Identifier of the trusting peer - PeerID trusting_peer = 1 [json_name = "trustingPeer"]; - - // Trust level - Trust trust = 2 [json_name = "trust"]; -} - -// Global trust level to NeoFS node. -message GlobalTrust { - // Message format version. Effectively, the version of API library used to create - // the message. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; - // Message body structure. - message Body { - // Node manager ID - PeerID manager = 1 [json_name = "manager"]; - - // Global trust level - Trust trust = 2 [json_name = "trust"]; - } - - // Message body - Body body = 2 [json_name = "body"]; - - // Signature of the binary `body` field by the manager. - neo.fs.v2.refs.Signature signature = 3 [json_name = "signature"]; -} From 7f59b8aaeb605f055a61bd0c327f5d84da772d0b Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 17 Apr 2023 10:32:18 +0300 Subject: [PATCH 390/440] [#25] subnet: Drop fields and types Signed-off-by: Dmitrii Stepanov --- CHANGELOG.md | 1 + container/types.proto | 4 -- netmap/types.proto | 14 ------- proto-docs/container.md | 92 ++++++++++++++++++++--------------------- proto-docs/netmap.md | 78 +++++++++++++++------------------- proto-docs/refs.md | 44 +++++++------------- proto-docs/subnet.md | 61 --------------------------- refs/types.proto | 10 ----- subnet/types.proto | 18 -------- 9 files changed, 93 insertions(+), 229 deletions(-) delete mode 100644 proto-docs/subnet.md delete mode 100644 subnet/types.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index 542f6e5..91ebf2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Removed - Reputation system (#22) +- All `subnet` related fields and types (#25) ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) diff --git a/container/types.proto b/container/types.proto index 17ce39c..5f7f76b 100644 --- a/container/types.proto +++ b/container/types.proto @@ -37,10 +37,6 @@ message Container { // // There are some "well-known" attributes affecting system behaviour: // - // * [ __SYSTEM__SUBNET ] \ - // (`__NEOFS__SUBNET` is deprecated) \ - // String ID of a container's storage subnet. Any container can be attached to - // one subnet only. // * [ __SYSTEM__NAME ] \ // (`__NEOFS__NAME` is deprecated) \ // String of a human-friendly container name registered as a domain in diff --git a/netmap/types.proto b/netmap/types.proto index 8b317dc..fb5cf82 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -5,8 +5,6 @@ package neo.fs.v2.netmap; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/netmap/grpc;netmap"; option csharp_namespace = "Neo.FileStorage.API.Netmap"; -import "refs/types.proto"; - // Operations on filters enum Operation { // No Operation defined @@ -121,10 +119,6 @@ message PlacementPolicy { // List of named filters to reference in selectors repeated Filter filters = 4 [json_name = "filters"]; - - // Subnetwork ID to select nodes from. Zero subnet (default) represents - // all of the nodes which didn't explicitly opt out of membership. - refs.SubnetID subnet_id = 5 [json_name = "subnetId"]; } // NeoFS node description @@ -164,14 +158,6 @@ message NodeInfo { // attributes it's a string presenting floating point number with comma or // point delimiter for decimal part. In the Network Map it will be saved as // 64-bit unsigned integer representing number of minimal token fractions. - // * [ __SYSTEM__SUBNET_%s ] \ - // (`__NEOFS__SUBNET_%s` is deprecated) \ - // `True` or `False`. Defines if the node is included in the `%s` subnetwork - // or not. `%s` must be an existing subnetwork's ID (non-negative integer number). - // A node can be included in more than one subnetwork and, therefore, can contain - // more than one subnet attribute. A missing attribute is equivalent to the - // presence of the attribute with `False` value (except default zero subnetwork - // (with `%s` == 0) for which missing attribute means inclusion in that network). // * UN-LOCODE \ // Node's geographic location in // [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) diff --git a/proto-docs/container.md b/proto-docs/container.md index aae323d..6368889 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -3,50 +3,50 @@ ## Table of Contents -- [container/service.proto](#container/service.proto) - - Services - - [ContainerService](#neo.fs.v2.container.ContainerService) - - - Messages - - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) - - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) - - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) - - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) - - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) - - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) - - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) - - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) - - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) - - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) - - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) - - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) - - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) - - [GetRequest](#neo.fs.v2.container.GetRequest) - - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) - - [GetResponse](#neo.fs.v2.container.GetResponse) - - [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) - - [ListRequest](#neo.fs.v2.container.ListRequest) - - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) - - [ListResponse](#neo.fs.v2.container.ListResponse) - - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) - - [PutRequest](#neo.fs.v2.container.PutRequest) - - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) - - [PutResponse](#neo.fs.v2.container.PutResponse) - - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) - - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) - - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) - - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) - - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) - - -- [container/types.proto](#container/types.proto) - - - Messages - - [Container](#neo.fs.v2.container.Container) - - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) - - -- [Scalar Value Types](#scalar-value-types) +- [Protocol Documentation](#protocol-documentation) + - [Table of Contents](#table-of-contents) + - [container/service.proto](#containerserviceproto) + - [Service "neo.fs.v2.container.ContainerService"](#service-neofsv2containercontainerservice) + - [Method Put](#method-put) + - [Method Delete](#method-delete) + - [Method Get](#method-get) + - [Method List](#method-list) + - [Method SetExtendedACL](#method-setextendedacl) + - [Method GetExtendedACL](#method-getextendedacl) + - [Method AnnounceUsedSpace](#method-announceusedspace) + - [Message AnnounceUsedSpaceRequest](#message-announceusedspacerequest) + - [Message AnnounceUsedSpaceRequest.Body](#message-announceusedspacerequestbody) + - [Message AnnounceUsedSpaceRequest.Body.Announcement](#message-announceusedspacerequestbodyannouncement) + - [Message AnnounceUsedSpaceResponse](#message-announceusedspaceresponse) + - [Message AnnounceUsedSpaceResponse.Body](#message-announceusedspaceresponsebody) + - [Message DeleteRequest](#message-deleterequest) + - [Message DeleteRequest.Body](#message-deleterequestbody) + - [Message DeleteResponse](#message-deleteresponse) + - [Message DeleteResponse.Body](#message-deleteresponsebody) + - [Message GetExtendedACLRequest](#message-getextendedaclrequest) + - [Message GetExtendedACLRequest.Body](#message-getextendedaclrequestbody) + - [Message GetExtendedACLResponse](#message-getextendedaclresponse) + - [Message GetExtendedACLResponse.Body](#message-getextendedaclresponsebody) + - [Message GetRequest](#message-getrequest) + - [Message GetRequest.Body](#message-getrequestbody) + - [Message GetResponse](#message-getresponse) + - [Message GetResponse.Body](#message-getresponsebody) + - [Message ListRequest](#message-listrequest) + - [Message ListRequest.Body](#message-listrequestbody) + - [Message ListResponse](#message-listresponse) + - [Message ListResponse.Body](#message-listresponsebody) + - [Message PutRequest](#message-putrequest) + - [Message PutRequest.Body](#message-putrequestbody) + - [Message PutResponse](#message-putresponse) + - [Message PutResponse.Body](#message-putresponsebody) + - [Message SetExtendedACLRequest](#message-setextendedaclrequest) + - [Message SetExtendedACLRequest.Body](#message-setextendedaclrequestbody) + - [Message SetExtendedACLResponse](#message-setextendedaclresponse) + - [Message SetExtendedACLResponse.Body](#message-setextendedaclresponsebody) + - [container/types.proto](#containertypesproto) + - [Message Container](#message-container) + - [Message Container.Attribute](#message-containerattribute) + - [Scalar Value Types](#scalar-value-types) @@ -587,10 +587,6 @@ values will be considered invalid. There are some "well-known" attributes affecting system behaviour: -* [ __SYSTEM__SUBNET ] \ - (`__NEOFS__SUBNET` is deprecated) \ - String ID of a container's storage subnet. Any container can be attached to - one subnet only. * [ __SYSTEM__NAME ] \ (`__NEOFS__NAME` is deprecated) \ String of a human-friendly container name registered as a domain in diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 1467a5d..19b8bd2 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -3,41 +3,40 @@ ## Table of Contents -- [netmap/service.proto](#netmap/service.proto) - - Services - - [NetmapService](#neo.fs.v2.netmap.NetmapService) - - - Messages - - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) - - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) - - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) - - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) - - [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) - - [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) - - [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) - - [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) - - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) - - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) - - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) - - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) - - -- [netmap/types.proto](#netmap/types.proto) - - - Messages - - [Filter](#neo.fs.v2.netmap.Filter) - - [Netmap](#neo.fs.v2.netmap.Netmap) - - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) - - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) - - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) - - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) - - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) - - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) - - [Replica](#neo.fs.v2.netmap.Replica) - - [Selector](#neo.fs.v2.netmap.Selector) - - -- [Scalar Value Types](#scalar-value-types) +- [Protocol Documentation](#protocol-documentation) + - [Table of Contents](#table-of-contents) + - [netmap/service.proto](#netmapserviceproto) + - [Service "neo.fs.v2.netmap.NetmapService"](#service-neofsv2netmapnetmapservice) + - [Method LocalNodeInfo](#method-localnodeinfo) + - [Method NetworkInfo](#method-networkinfo) + - [Method NetmapSnapshot](#method-netmapsnapshot) + - [Message LocalNodeInfoRequest](#message-localnodeinforequest) + - [Message LocalNodeInfoRequest.Body](#message-localnodeinforequestbody) + - [Message LocalNodeInfoResponse](#message-localnodeinforesponse) + - [Message LocalNodeInfoResponse.Body](#message-localnodeinforesponsebody) + - [Message NetmapSnapshotRequest](#message-netmapsnapshotrequest) + - [Message NetmapSnapshotRequest.Body](#message-netmapsnapshotrequestbody) + - [Message NetmapSnapshotResponse](#message-netmapsnapshotresponse) + - [Message NetmapSnapshotResponse.Body](#message-netmapsnapshotresponsebody) + - [Message NetworkInfoRequest](#message-networkinforequest) + - [Message NetworkInfoRequest.Body](#message-networkinforequestbody) + - [Message NetworkInfoResponse](#message-networkinforesponse) + - [Message NetworkInfoResponse.Body](#message-networkinforesponsebody) + - [netmap/types.proto](#netmaptypesproto) + - [Message Filter](#message-filter) + - [Message Netmap](#message-netmap) + - [Message NetworkConfig](#message-networkconfig) + - [Message NetworkConfig.Parameter](#message-networkconfigparameter) + - [Message NetworkInfo](#message-networkinfo) + - [Message NodeInfo](#message-nodeinfo) + - [Message NodeInfo.Attribute](#message-nodeinfoattribute) + - [Message PlacementPolicy](#message-placementpolicy) + - [Message Replica](#message-replica) + - [Message Selector](#message-selector) + - [Clause](#clause) + - [NodeInfo.State](#nodeinfostate) + - [Operation](#operation) + - [Scalar Value Types](#scalar-value-types) @@ -399,14 +398,6 @@ explicitly set: attributes it's a string presenting floating point number with comma or point delimiter for decimal part. In the Network Map it will be saved as 64-bit unsigned integer representing number of minimal token fractions. -* [ __SYSTEM__SUBNET_%s ] \ - (`__NEOFS__SUBNET_%s` is deprecated) \ - `True` or `False`. Defines if the node is included in the `%s` subnetwork - or not. `%s` must be an existing subnetwork's ID (non-negative integer number). - A node can be included in more than one subnetwork and, therefore, can contain - more than one subnet attribute. A missing attribute is equivalent to the - presence of the attribute with `False` value (except default zero subnetwork - (with `%s` == 0) for which missing attribute means inclusion in that network). * UN-LOCODE \ Node's geographic location in [UN/LOCODE](https://www.unece.org/cefact/codesfortrade/codes_index.html) @@ -468,7 +459,6 @@ storage policy definition languages. | container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset | | selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | -| subnet_id | [neo.fs.v2.refs.SubnetID](#neo.fs.v2.refs.SubnetID) | | Subnetwork ID to select nodes from. Zero subnet (default) represents all of the nodes which didn't explicitly opt out of membership. | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 651822f..7d66e5a 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -3,21 +3,20 @@ ## Table of Contents -- [refs/types.proto](#refs/types.proto) - - - Messages - - [Address](#neo.fs.v2.refs.Address) - - [Checksum](#neo.fs.v2.refs.Checksum) - - [ContainerID](#neo.fs.v2.refs.ContainerID) - - [ObjectID](#neo.fs.v2.refs.ObjectID) - - [OwnerID](#neo.fs.v2.refs.OwnerID) - - [Signature](#neo.fs.v2.refs.Signature) - - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) - - [SubnetID](#neo.fs.v2.refs.SubnetID) - - [Version](#neo.fs.v2.refs.Version) - - -- [Scalar Value Types](#scalar-value-types) +- [Protocol Documentation](#protocol-documentation) + - [Table of Contents](#table-of-contents) + - [refs/types.proto](#refstypesproto) + - [Message Address](#message-address) + - [Message Checksum](#message-checksum) + - [Message ContainerID](#message-containerid) + - [Message ObjectID](#message-objectid) + - [Message OwnerID](#message-ownerid) + - [Message Signature](#message-signature) + - [Message SignatureRFC6979](#message-signaturerfc6979) + - [Message Version](#message-version) + - [ChecksumType](#checksumtype) + - [SignatureScheme](#signaturescheme) + - [Scalar Value Types](#scalar-value-types) @@ -164,21 +163,6 @@ RFC 6979 signature. | sign | [bytes](#bytes) | | Deterministic ECDSA with SHA-256 hashing | - - -### Message SubnetID -NeoFS subnetwork identifier. - -String representation of a value is base-10 integer. - -JSON representation is an object containing a single `value` number field. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| value | [fixed32](#fixed32) | | 4-byte integer subnetwork identifier. | - - ### Message Version diff --git a/proto-docs/subnet.md b/proto-docs/subnet.md deleted file mode 100644 index a766dc6..0000000 --- a/proto-docs/subnet.md +++ /dev/null @@ -1,61 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [subnet/types.proto](#subnet/types.proto) - - - Messages - - [SubnetInfo](#neo.fs.v2.subnet.SubnetInfo) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## subnet/types.proto - - - - - - - -### Message SubnetInfo -NeoFS subnetwork description - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [neo.fs.v2.refs.SubnetID](#neo.fs.v2.refs.SubnetID) | | Unique subnet identifier. Missing ID is equivalent to zero (default subnetwork) ID. | -| owner | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the subnetwork owner | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/refs/types.proto b/refs/types.proto index 054443e..2f94dd2 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -77,16 +77,6 @@ message OwnerID { bytes value = 1 [json_name = "value"]; } -// NeoFS subnetwork identifier. -// -// String representation of a value is base-10 integer. -// -// JSON representation is an object containing a single `value` number field. -message SubnetID { - // 4-byte integer subnetwork identifier. - fixed32 value = 1 [json_name = "value"]; -} - // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string diff --git a/subnet/types.proto b/subnet/types.proto deleted file mode 100644 index cc9cae3..0000000 --- a/subnet/types.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.subnet; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/subnet/grpc;subnet"; -option csharp_namespace = "Neo.FileStorage.API.Subnet"; - -import "refs/types.proto"; - -// NeoFS subnetwork description -message SubnetInfo { - // Unique subnet identifier. Missing ID is - // equivalent to zero (default subnetwork) ID. - neo.fs.v2.refs.SubnetID id = 1; - - // Identifier of the subnetwork owner - neo.fs.v2.refs.OwnerID owner = 2; -} From dbfa9c944bd7486f96daad3090cad6c238e9f833 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 23 May 2023 18:47:09 +0300 Subject: [PATCH 391/440] [#26] netmap: Add NOT and UNIQUE keywords Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- netmap/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index fb5cf82..2d72c7e 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -33,6 +33,9 @@ enum Operation { // Logical AND AND = 8; + + // Logical negation + NOT = 9; } // Selector modifier shows how the node set will be formed. By default selector @@ -119,6 +122,9 @@ message PlacementPolicy { // List of named filters to reference in selectors repeated Filter filters = 4 [json_name = "filters"]; + + // Unique flag defines non-overlapping application for replicas + bool unique = 5 [json_name = "unique"]; } // NeoFS node description From b471eaaba91bac2da1a7772c8771695318dd41f3 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 15 Jun 2023 11:39:55 +0300 Subject: [PATCH 392/440] [#29] object: Extend Delete rpc specification * Add OBJECT_NOT_FOUND status specification Signed-off-by: Airat Arifullin a.arifullin@yadro.com --- object/service.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/object/service.proto b/object/service.proto index 1d08ff5..fae833e 100644 --- a/object/service.proto +++ b/object/service.proto @@ -101,6 +101,9 @@ service ObjectService { // - Common failures (SECTION_FAILURE_COMMON); // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // delete access to the object is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // the object could not be deleted because it has not been \ + // found within the container; // - **LOCKED** (2050, SECTION_OBJECT): \ // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ From f2a60016abfc7396029823972d59c664ea934079 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 29 Jun 2023 12:05:30 +0300 Subject: [PATCH 393/440] [#9] object service: Add PutSingle RPC Signed-off-by: Dmitrii Stepanov --- object/service.proto | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/object/service.proto b/object/service.proto index fae833e..3a0a3de 100644 --- a/object/service.proto +++ b/object/service.proto @@ -231,6 +231,38 @@ service ObjectService { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); + + // Put the prepared object into container. + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of an object MUST be set. + // + // Extended headers can change `Put` behaviour: + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requested version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **LOCKED** (2050, SECTION_OBJECT): \ + // placement of an object of type TOMBSTONE that includes at least one locked + // object is prohibited; + // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + // placement of an object of type LOCK that includes at least one object of + // type other than REGULAR is prohibited; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or has + // been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + rpc PutSingle(PutSingleRequest) returns (PutSingleResponse); } // GET object request @@ -709,3 +741,48 @@ message GetRangeHashResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +// Object PUT Single request +message PutSingleRequest { + // PUT Single request body + message Body { + // Prepared object with payload. + Object object = 1; + // Number of copies of the object to store within the RPC call. By default, + // object is processed according to the container's placement policy. + // Every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + repeated uint32 copies_number = 2; + } + // Body of put single object request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Object PUT Single response +message PutSingleResponse { + // PUT Single Object response body + message Body { + } + // Body of put single object response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} \ No newline at end of file From 51d330b06a1aaf72d52fe13214a7251abe4b8e13 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 17 Aug 2023 11:04:47 +0300 Subject: [PATCH 394/440] [#19] Remove storage groups Signed-off-by: Evgenii Stratonikov --- CHANGELOG.md | 1 + object/service.proto | 129 ++++++++++++++++++++------------------- object/types.proto | 86 +++++++++++++------------- storagegroup/types.proto | 34 ----------- 4 files changed, 111 insertions(+), 139 deletions(-) delete mode 100644 storagegroup/types.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index 91ebf2f..ee28fa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Removed - Reputation system (#22) - All `subnet` related fields and types (#25) +- Storage group (#19) ## [2.14.0] - 2022-09-23 - Anmado (안마도, 鞍馬島) diff --git a/object/service.proto b/object/service.proto index 3a0a3de..2a3c6ff 100644 --- a/object/service.proto +++ b/object/service.proto @@ -13,11 +13,11 @@ import "session/types.proto"; // not affect the sidechain and are only served by nodes in p2p style. service ObjectService { // Receive full object structure, including Headers and payload. Response uses - // gRPC stream. First response message carries the object with the requested address. - // Chunk messages are parts of the object's payload if it is needed. All - // messages, except the first one, carry payload chunks. The requested object can - // be restored by concatenation of object message payload and all chunks - // keeping the receiving order. + // gRPC stream. First response message carries the object with the requested + // address. Chunk messages are parts of the object's payload if it is needed. + // All messages, except the first one, carry payload chunks. The requested + // object can be restored by concatenation of object message payload and all + // chunks keeping the receiving order. // // Extended headers can change `Get` behaviour: // * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -26,9 +26,10 @@ service ObjectService { // calculation. // * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - // the latest one otherwise) of Network Map to find an object until the depth - // limit is reached. + // Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` + // (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one + // otherwise) of Network Map to find an object until the depth limit is + // reached. // // Please refer to detailed `XHeader` description. // @@ -70,15 +71,16 @@ service ObjectService { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. @@ -166,8 +168,8 @@ service ObjectService { // Get byte range of data payload. Range is set as an (offset, length) tuple. // Like in `Get` method, the response uses gRPC stream. Requested range can be - // restored by concatenation of all received payload chunks keeping the receiving - // order. + // restored by concatenation of all received payload chunks keeping the + // receiving order. // // Extended headers can change `GetRange` behaviour: // * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -233,7 +235,8 @@ service ObjectService { rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); // Put the prepared object into container. - // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of an object MUST be set. + // `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of + // an object MUST be set. // // Extended headers can change `Put` behaviour: // * [ __SYSTEM__NETMAP_EPOCH \ @@ -250,15 +253,16 @@ service ObjectService { // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ // write access to the container is denied; // - **LOCKED** (2050, SECTION_OBJECT): \ - // placement of an object of type TOMBSTONE that includes at least one locked - // object is prohibited; + // placement of an object of type TOMBSTONE that includes at least one + // locked object is prohibited; // - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ // placement of an object of type LOCK that includes at least one object of // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - // (for trusted object preparation) session private key does not exist or has + // (for trusted object preparation) session private key does not exist or + // has // been deleted; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. @@ -346,16 +350,16 @@ message PutRequest { // Object's Header Header header = 3; - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Can be one of: + // Number of copies of the object to store within the RPC call. By + // default, object is processed according to the container's placement + // policy. Can be one of: // 1. A single number; applied to the whole request and is treated as // a minimal number of nodes that must store an object to complete the // request successfully. // 2. An ordered array; every number is treated as a minimal number of // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. + // to complete the request successfully. The length MUST equal the + // placement vectors number, otherwise request is considered malformed. repeated uint32 copies_number = 4; } // Single message in the request stream. @@ -406,7 +410,7 @@ message DeleteRequest { message Body { // Address of the object to be deleted neo.fs.v2.refs.Address address = 1; - } + } // Body of delete object request message. Body body = 1; @@ -478,10 +482,10 @@ message HeadRequest { // 3. Check if `ObjectID` signature in `signature` field is correct message HeaderWithSignature { // Full object header - Header header = 1 [json_name = "header"]; + Header header = 1 [ json_name = "header" ]; // Signed `ObjectID` to verify full header's authenticity - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } // Object HEAD response @@ -490,7 +494,7 @@ message HeadResponse { message Body { // Requested object header, it's part or meta information about split // object. - oneof head{ + oneof head { // Full object's `Header` with `ObjectID` signature HeaderWithSignature header = 1; @@ -523,11 +527,11 @@ message SearchRequest { // Version of the Query Language used uint32 version = 2; - // Filter structure checks if the object header field or the attribute content - // matches a value. + // Filter structure checks if the object header field or the attribute + // content matches a value. // // If no filters are set, search request will return all objects of the - // container, including Regular object, Tombstones and Storage Group + // container, including Regular object and Tombstone // objects. Most human users expect to get only object they can directly // work with. In that case, `$Object:ROOT` filter should be used. // @@ -562,11 +566,11 @@ message SearchRequest { // properties: // // * $Object:ROOT \ - // Returns only `REGULAR` type objects that are not split or that are the top - // level root objects in a split hierarchy. This includes objects not + // Returns only `REGULAR` type objects that are not split or that are the + // top level root objects in a split hierarchy. This includes objects not // present physically, like large objects split into smaller objects // without a separate top-level root object. Objects of other types like - // StorageGroups and Tombstones will not be shown. This filter may be + // Locks and Tombstones will not be shown. This filter may be // useful for listing objects like `ls` command of some virtual file // system. This filter is activated if the `key` exists, disregarding the // value and matcher type. @@ -575,17 +579,17 @@ message SearchRequest { // activated if the `key` exists, disregarding the value and matcher type. // // Note: using filters with a key with prefix `$Object:` and match type - // `NOT_PRESENT `is not recommended since this is not a cross-version approach. - // Behavior when processing this kind of filters is undefined. + // `NOT_PRESENT `is not recommended since this is not a cross-version + // approach. Behavior when processing this kind of filters is undefined. message Filter { // Match type to use - MatchType match_type = 1 [json_name = "matchType"]; + MatchType match_type = 1 [ json_name = "matchType" ]; // Attribute or Header fields to match - string key = 2 [json_name = "key"]; + string key = 2 [ json_name = "key" ]; // Value to match - string value = 3 [json_name = "value"]; + string value = 3 [ json_name = "value" ]; } // List of search expressions repeated Filter filters = 3; @@ -668,7 +672,7 @@ message GetRangeResponse { // chunks. message Body { // Requested object range or meta information about split object. - oneof range_part{ + oneof range_part { // Chunked object payload's range. bytes chunk = 1; @@ -744,36 +748,35 @@ message GetRangeHashResponse { // Object PUT Single request message PutSingleRequest { - // PUT Single request body - message Body { - // Prepared object with payload. - Object object = 1; - // Number of copies of the object to store within the RPC call. By default, - // object is processed according to the container's placement policy. - // Every number is treated as a minimal number of - // nodes in a corresponding placement vector that must store an object - // to complete the request successfully. The length MUST equal the placement - // vectors number, otherwise request is considered malformed. - repeated uint32 copies_number = 2; - } - // Body of put single object request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // PUT Single request body + message Body { + // Prepared object with payload. + Object object = 1; + // Number of copies of the object to store within the RPC call. By default, + // object is processed according to the container's placement policy. + // Every number is treated as a minimal number of + // nodes in a corresponding placement vector that must store an object + // to complete the request successfully. The length MUST equal the placement + // vectors number, otherwise request is considered malformed. + repeated uint32 copies_number = 2; + } + // Body of put single object request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Object PUT Single response message PutSingleResponse { // PUT Single Object response body - message Body { - } + message Body {} // Body of put single object response message. Body body = 1; diff --git a/object/types.proto b/object/types.proto index 2af9b6a..41b785b 100644 --- a/object/types.proto +++ b/object/types.proto @@ -9,13 +9,12 @@ import "refs/types.proto"; import "session/types.proto"; // Type of the object payload content. Only `REGULAR` type objects can be split, -// hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum -// object size. +// hence `TOMBSTONE` and `LOCK` payload is limited by the +// maximum object size. // // String presentation of object type is the same as definition: // * REGULAR // * TOMBSTONE -// * STORAGE_GROUP // * LOCK enum ObjectType { // Just a normal object @@ -24,8 +23,8 @@ enum ObjectType { // Used internally to identify deleted objects TOMBSTONE = 1; - // StorageGroup information - STORAGE_GROUP = 2; + // Unused (previously storageGroup information) + // _ = 2; // Object lock LOCK = 3; @@ -53,59 +52,62 @@ enum MatchType { message ShortHeader { // Object format version. Effectively, the version of API library used to // create particular object. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Epoch when the object was created - uint64 creation_epoch = 2 [json_name = "creationEpoch"]; + uint64 creation_epoch = 2 [ json_name = "creationEpoch" ]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ]; // Type of the object payload content - ObjectType object_type = 4 [json_name = "objectType"]; + ObjectType object_type = 4 [ json_name = "objectType" ]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown - uint64 payload_length = 5 [json_name = "payloadLength"]; + uint64 payload_length = 5 [ json_name = "payloadLength" ]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ]; // Homomorphic hash of the object payload - neo.fs.v2.refs.Checksum homomorphic_hash = 7 [json_name = "homomorphicHash"]; + neo.fs.v2.refs.Checksum homomorphic_hash = 7 + [ json_name = "homomorphicHash" ]; } // Object Header message Header { // Object format version. Effectively, the version of API library used to // create particular object - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Object's container - neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "containerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ]; // Object's owner - neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 3 [ json_name = "ownerID" ]; // Object creation Epoch - uint64 creation_epoch = 4 [json_name = "creationEpoch"]; + uint64 creation_epoch = 4 [ json_name = "creationEpoch" ]; // Size of payload in bytes. // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown. - uint64 payload_length = 5 [json_name = "payloadLength"]; + uint64 payload_length = 5 [ json_name = "payloadLength" ]; // Hash of payload bytes - neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; + neo.fs.v2.refs.Checksum payload_hash = 6 [ json_name = "payloadHash" ]; // Type of the object payload content - ObjectType object_type = 7 [json_name = "objectType"]; + ObjectType object_type = 7 [ json_name = "objectType" ]; // Homomorphic hash of the object payload - neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"]; + neo.fs.v2.refs.Checksum homomorphic_hash = 8 + [ json_name = "homomorphicHash" ]; // Session token, if it was used during Object creation. Need it to verify // integrity and authenticity out of Request scope. - neo.fs.v2.session.SessionToken session_token = 9 [json_name = "sessionToken"]; + neo.fs.v2.session.SessionToken session_token = 9 + [ json_name = "sessionToken" ]; // `Attribute` is a user-defined Key-Value metadata pair attached to an // object. @@ -114,8 +116,8 @@ message Header { // Objects with duplicated attribute names or attributes with empty values // will be considered invalid. // - // There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix - // that affect system behaviour: + // There are some "well-known" attributes starting with `__SYSTEM__` + // (`__NEOFS__` is deprecated) prefix that affect system behaviour: // // * [ __SYSTEM__UPLOAD_ID ] \ // (`__NEOFS__UPLOAD_ID` is deprecated) \ @@ -155,12 +157,12 @@ message Header { // corresponding section in NeoFS Technical Specification. message Attribute { // string key to the object attribute - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // string value of the object attribute - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // User-defined object attributes - repeated Attribute attributes = 10 [json_name = "attributes"]; + repeated Attribute attributes = 10 [ json_name = "attributes" ]; // Bigger objects can be split into a chain of smaller objects. Information // about inter-dependencies between spawned objects and how to re-construct @@ -168,54 +170,54 @@ message Header { // must be within the same container. message Split { // Identifier of the origin object. Known only to the minor child. - neo.fs.v2.refs.ObjectID parent = 1 [json_name = "parent"]; + neo.fs.v2.refs.ObjectID parent = 1 [ json_name = "parent" ]; // Identifier of the left split neighbor - neo.fs.v2.refs.ObjectID previous = 2 [json_name = "previous"]; + neo.fs.v2.refs.ObjectID previous = 2 [ json_name = "previous" ]; // `signature` field of the parent object. Used to reconstruct parent. - neo.fs.v2.refs.Signature parent_signature = 3 [json_name = "parentSignature"]; + neo.fs.v2.refs.Signature parent_signature = 3 + [ json_name = "parentSignature" ]; // `header` field of the parent object. Used to reconstruct parent. - Header parent_header = 4 [json_name = "parentHeader"]; + Header parent_header = 4 [ json_name = "parentHeader" ]; // List of identifiers of the objects generated by splitting current one. - repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; + repeated neo.fs.v2.refs.ObjectID children = 5 [ json_name = "children" ]; // 16 byte UUIDv4 used to identify the split object hierarchy parts. Must be // unique inside container. All objects participating in the split must have // the same `split_id` value. - bytes split_id = 6 [json_name = "splitID"]; - + bytes split_id = 6 [ json_name = "splitID" ]; } // Position of the object in the split hierarchy - Split split = 11 [json_name = "split"]; + Split split = 11 [ json_name = "split" ]; } // Object structure. Object is immutable and content-addressed. It means -// `ObjectID` will change if the header or the payload changes. It's calculated as a -// hash of header field which contains hash of the object's payload. +// `ObjectID` will change if the header or the payload changes. It's calculated +// as a hash of header field which contains hash of the object's payload. // // For non-regular object types payload format depends on object type specified // in the header. message Object { // Object's unique identifier. - neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"]; + neo.fs.v2.refs.ObjectID object_id = 1 [ json_name = "objectID" ]; // Signed object_id - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; // Object metadata headers - Header header = 3 [json_name = "header"]; + Header header = 3 [ json_name = "header" ]; // Payload bytes - bytes payload = 4 [json_name = "payload"]; + bytes payload = 4 [ json_name = "payload" ]; } // Meta information of split hierarchy for object assembly. With the last part // one can traverse linked list of split hierarchy back to the first part and -// assemble the original object. With a linking object one can assemble an object -// right from the object parts. +// assemble the original object. With a linking object one can assemble an +// object right from the object parts. message SplitInfo { // 16 byte UUID used to identify the split object hierarchy parts. bytes split_id = 1; diff --git a/storagegroup/types.proto b/storagegroup/types.proto deleted file mode 100644 index b74f755..0000000 --- a/storagegroup/types.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.storagegroup; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/storagegroup/grpc;storagegroup"; -option csharp_namespace = "Neo.FileStorage.API.StorageGroup"; - -import "refs/types.proto"; - -// StorageGroup keeps verification information for Data Audit sessions. Objects -// that require paid storage guarantees are gathered in `StorageGroups` with -// additional information used for the proof of storage. `StorageGroup` only -// contains objects from the same container. -// -// Being an object payload, StorageGroup may have expiration Epoch set with -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup -// will be ignored by InnerRing nodes during Data Audit cycles and will be -// deleted by Storage Nodes. -// -message StorageGroup { - // Total size of the payloads of objects in the storage group - uint64 validation_data_size = 1 [json_name = "validationDataSize"]; - - // Homomorphic hash from the concatenation of the payloads of the storage - // group members. The order of concatenation is the same as the order of the - // members in the `members` field. - neo.fs.v2.refs.Checksum validation_hash = 2 [json_name = "validationHash"]; - - // DEPRECATED. Last NeoFS epoch number of the storage group lifetime - uint64 expiration_epoch = 3 [json_name = "expirationEpoch", deprecated = true]; - - // Strictly ordered list of storage group member objects. Members MUST be unique - repeated neo.fs.v2.refs.ObjectID members = 4 [json_name = "members"]; -} From 188f580e469c9fafc603a1ff3c54933e7cf8b820 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 5 Sep 2023 09:55:35 +0300 Subject: [PATCH 395/440] [#2] object: Clarify locked object expiration Signed-off-by: Evgenii Stratonikov --- object/types.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/object/types.proto b/object/types.proto index 41b785b..dfc3afc 100644 --- a/object/types.proto +++ b/object/types.proto @@ -124,7 +124,8 @@ message Header { // Marks smaller parts of a split bigger object // * [ __SYSTEM__EXPIRATION_EPOCH ] \ // (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ - // Tells GC to delete object after that epoch + // The epoch after which object with no LOCKs on it becomes unavailable. + // Locked object continues to be available until each of the LOCKs expire. // * [ __SYSTEM__TICK_EPOCH ] \ // (`__NEOFS__TICK_EPOCH` is deprecated) \ // Decimal number that defines what epoch must produce From 4c68d92468503b10282c8a92af83a56f170c8a3a Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 28 Feb 2024 18:53:04 +0300 Subject: [PATCH 396/440] [#39] Makefile: Add fmt target Signed-off-by: Evgenii Stratonikov --- Makefile | 6 ++ accounting/service.proto | 5 +- accounting/types.proto | 4 +- acl/types.proto | 59 ++++++++--------- audit/types.proto | 38 +++++------ container/service.proto | 30 +++++---- container/types.proto | 44 +++++++------ lock/types.proto | 7 +- netmap/service.proto | 132 ++++++++++++++++++------------------- netmap/types.proto | 95 +++++++++++++-------------- refs/types.proto | 38 +++++------ session/service.proto | 2 +- session/types.proto | 136 ++++++++++++++++++++------------------- status/types.proto | 134 +++++++++++++++++++------------------- tombstone/types.proto | 13 ++-- 15 files changed, 379 insertions(+), 364 deletions(-) diff --git a/Makefile b/Makefile index d66c98a..532d8b0 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,9 @@ doc: --proto_path=.:/usr/local/include \ --doc_out=proto-docs/ $${f}/*.proto; \ done + +fmt: + @for f in `ls **/*.proto`; do \ + echo "⇒ Formatting $$f"; \ + clang-format -i $$f; \ + done diff --git a/accounting/service.proto b/accounting/service.proto index 6574404..ac988c9 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -21,7 +21,7 @@ service AccountingService { // - **OK** (0, SECTION_SUCCESS): // balance has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc Balance (BalanceRequest) returns (BalanceResponse); + rpc Balance(BalanceRequest) returns (BalanceResponse); } // BalanceRequest message @@ -51,7 +51,8 @@ message BalanceRequest { // BalanceResponse message message BalanceResponse { // The amount of funds in GAS token for the `OwnerID`'s account requested. - // Balance is given in the `Decimal` format to avoid precision issues with rounding. + // Balance is given in the `Decimal` format to avoid precision issues with + // rounding. message Body { // Amount of funds in GAS token for the requested account. Decimal balance = 1; diff --git a/accounting/types.proto b/accounting/types.proto index 205332e..eadf9a8 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -14,9 +14,9 @@ option csharp_namespace = "Neo.FileStorage.API.Accounting"; // description. message Decimal { // Number in the smallest Token fractions. - int64 value = 1 [json_name = "value"]; + int64 value = 1 [ json_name = "value" ]; // Precision value indicating how many smallest fractions can be in one // integer. - uint32 precision = 2 [json_name = "precision"]; + uint32 precision = 2 [ json_name = "precision" ]; } diff --git a/acl/types.proto b/acl/types.proto index 31a43d4..e9ea987 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -19,7 +19,8 @@ enum Role { // container or an inner ring node SYSTEM = 2; - // Others target rule is applied if sender is neither a user nor a system target + // Others target rule is applied if sender is neither a user nor a system + // target OTHERS = 3; } @@ -95,10 +96,10 @@ enum HeaderType { // Describes a single eACL rule. message EACLRecord { // NeoFS request Verb to match - Operation operation = 1 [json_name = "operation"]; + Operation operation = 1 [ json_name = "operation" ]; // Rule execution result. Either allows or denies access if filters match. - Action action = 2 [json_name = "action"]; + Action action = 2 [ json_name = "action" ]; // Filter to check particular properties of the request or the object. // @@ -132,32 +133,32 @@ message EACLRecord { // it's possible to take that information from the requested address. message Filter { // Define if Object or Request header will be used - HeaderType header_type = 1 [json_name = "headerType"]; + HeaderType header_type = 1 [ json_name = "headerType" ]; // Match operation type - MatchType match_type = 2 [json_name = "matchType"]; + MatchType match_type = 2 [ json_name = "matchType" ]; // Name of the Header to use - string key = 3 [json_name="key"]; + string key = 3 [ json_name = "key" ]; // Expected Header Value or pattern to match - string value = 4 [json_name="value"]; + string value = 4 [ json_name = "value" ]; } // List of filters to match and see if rule is applicable - repeated Filter filters = 3 [json_name="filters"]; + repeated Filter filters = 3 [ json_name = "filters" ]; // Target to apply ACL rule. Can be a subject's role class or a list of public // keys to match. message Target { // Target subject's role class - Role role = 1 [json_name="role"]; + Role role = 1 [ json_name = "role" ]; // List of public keys to identify target subject - repeated bytes keys = 2 [json_name="keys"]; + repeated bytes keys = 2 [ json_name = "keys" ]; } // List of target subjects to apply ACL rule to - repeated Target targets = 4 [json_name="targets"]; + repeated Target targets = 4 [ json_name = "targets" ]; } // Extended ACL rules table. A list of ACL rules defined additionally to Basic @@ -167,13 +168,13 @@ message EACLRecord { message EACLTable { // eACL format version. Effectively, the version of API library used to create // eACL Table. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Identifier of the container that should use given access control rules - neo.fs.v2.refs.ContainerID container_id = 2 [json_name="containerID"]; + neo.fs.v2.refs.ContainerID container_id = 2 [ json_name = "containerID" ]; // List of Extended ACL rules - repeated EACLRecord records = 3 [json_name="records"]; + repeated EACLRecord records = 3 [ json_name = "records" ]; } // BearerToken allows to attach signed Extended ACL rules to the request in @@ -183,44 +184,44 @@ message EACLTable { // used in the similar use cases, like providing authorisation to externally // authenticated party. // -// BearerToken can be issued only by the container's owner and must be signed using -// the key associated with the container's `OwnerID`. +// BearerToken can be issued only by the container's owner and must be signed +// using the key associated with the container's `OwnerID`. message BearerToken { - // Bearer Token body structure contains Extended ACL table issued by the container - // owner with additional information preventing token abuse. + // Bearer Token body structure contains Extended ACL table issued by the + // container owner with additional information preventing token abuse. message Body { // Table of Extended ACL rules to use instead of the ones attached to the // container. If it contains `container_id` field, bearer token is only - // valid for this specific container. Otherwise, any container of the same owner - // is allowed. - EACLTable eacl_table = 1 [json_name="eaclTable"]; + // valid for this specific container. Otherwise, any container of the same + // owner is allowed. + EACLTable eacl_table = 1 [ json_name = "eaclTable" ]; // `OwnerID` defines to whom the token was issued. It must match the request // originator's `OwnerID`. If empty, any token bearer will be accepted. - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name="ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Lifetime parameters of the token. Field names taken from // [rfc7519](https://tools.ietf.org/html/rfc7519). message TokenLifetime { // Expiration Epoch - uint64 exp = 1 [json_name="exp"]; + uint64 exp = 1 [ json_name = "exp" ]; // Not valid before Epoch - uint64 nbf = 2 [json_name="nbf"]; + uint64 nbf = 2 [ json_name = "nbf" ]; // Issued at Epoch - uint64 iat = 3 [json_name="iat"]; + uint64 iat = 3 [ json_name = "iat" ]; } // Token expiration and valid time period parameters - TokenLifetime lifetime = 3 [json_name="lifetime"]; + TokenLifetime lifetime = 3 [ json_name = "lifetime" ]; // AllowImpersonate flag to consider token signer as request owner. // If this field is true extended ACL table in token body isn't processed. - bool allow_impersonate = 4 [json_name="allowImpersonate"]; + bool allow_impersonate = 4 [ json_name = "allowImpersonate" ]; } // Bearer Token body - Body body = 1 [json_name="body"]; + Body body = 1 [ json_name = "body" ]; // Signature of BearerToken body - neo.fs.v2.refs.Signature signature = 2 [json_name="signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } diff --git a/audit/types.proto b/audit/types.proto index c83260c..c5c19ec 100644 --- a/audit/types.proto +++ b/audit/types.proto @@ -12,48 +12,48 @@ import "refs/types.proto"; message DataAuditResult { // Data Audit Result format version. Effectively, the version of API library // used to report DataAuditResult structure. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Epoch number when the Data Audit was conducted - fixed64 audit_epoch = 2 [json_name = "auditEpoch"]; + fixed64 audit_epoch = 2 [ json_name = "auditEpoch" ]; // Container under audit - neo.fs.v2.refs.ContainerID container_id = 3 [json_name = "containerID"]; + neo.fs.v2.refs.ContainerID container_id = 3 [ json_name = "containerID" ]; // Public key of the auditing InnerRing node in a binary format - bytes public_key = 4 [json_name = "publicKey"]; + bytes public_key = 4 [ json_name = "publicKey" ]; // Shows if Data Audit process was complete in time or if it was cancelled - bool complete = 5 [json_name = "complete"]; + bool complete = 5 [ json_name = "complete" ]; // Number of request done at PoR stage - uint32 requests = 6 [json_name = "requests"]; + uint32 requests = 6 [ json_name = "requests" ]; // Number of retries done at PoR stage - uint32 retries = 7 [json_name = "retries"]; + uint32 retries = 7 [ json_name = "retries" ]; // List of Storage Groups that passed audit PoR stage - repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [json_name = "passSG"]; + repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [ json_name = "passSG" ]; // List of Storage Groups that failed audit PoR stage - repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [json_name = "failSG"]; + repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [ json_name = "failSG" ]; - // Number of sampled objects under the audit placed in an optimal way according to - // the containers placement policy when checking PoP - uint32 hit = 10 [json_name = "hit"]; + // Number of sampled objects under the audit placed in an optimal way + // according to the containers placement policy when checking PoP + uint32 hit = 10 [ json_name = "hit" ]; - // Number of sampled objects under the audit placed in suboptimal way according to - // the containers placement policy, but still at a satisfactory level when - // checking PoP - uint32 miss = 11 [json_name = "miss"]; + // Number of sampled objects under the audit placed in suboptimal way + // according to the containers placement policy, but still at a satisfactory + // level when checking PoP + uint32 miss = 11 [ json_name = "miss" ]; // Number of sampled objects under the audit stored inconsistently with the // placement policy or not found at all when checking PoP - uint32 fail = 12 [json_name = "fail"]; + uint32 fail = 12 [ json_name = "fail" ]; // List of storage node public keys that passed at least one PDP - repeated bytes pass_nodes = 13 [json_name = "passNodes"]; + repeated bytes pass_nodes = 13 [ json_name = "passNodes" ]; // List of storage node public keys that failed at least one PDP - repeated bytes fail_nodes = 14 [json_name = "failNodes"]; + repeated bytes fail_nodes = 14 [ json_name = "failNodes" ]; } diff --git a/container/service.proto b/container/service.proto index 8c5f84e..fa45703 100644 --- a/container/service.proto +++ b/container/service.proto @@ -17,8 +17,8 @@ import "session/types.proto"; service ContainerService { // `Put` invokes `Container` smart contract's `Put` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -28,8 +28,8 @@ service ContainerService { // `Delete` invokes `Container` smart contract's `Delete` method and returns // response immediately. After a new block is issued in sidechain, request is - // verified by Inner Ring nodes. After one more block in sidechain, the container - // is added into smart contract storage. + // verified by Inner Ring nodes. After one more block in sidechain, the + // container is added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -56,8 +56,8 @@ service ContainerService { rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL are - // added into smart contract storage. + // immediately. After one more block in sidechain, changes in an Extended ACL + // are added into smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -84,7 +84,8 @@ service ContainerService { // - **OK** (0, SECTION_SUCCESS): \ // estimation of used space has been successfully announced; // - Common failures (SECTION_FAILURE_COMMON). - rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); + rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) + returns (AnnounceUsedSpaceResponse); } // New NeoFS Container creation request @@ -146,7 +147,8 @@ message DeleteRequest { // Identifier of the container to delete from NeoFS neo.fs.v2.refs.ContainerID container_id = 1; - // `ContainerID` signed with the container owner's key according to RFC-6979. + // `ContainerID` signed with the container owner's key according to + // RFC-6979. neo.fs.v2.refs.SignatureRFC6979 signature = 2; } // Body of container delete request message. @@ -296,9 +298,9 @@ message SetExtendedACLRequest { // Set Extended ACL message SetExtendedACLResponse { // `SetExtendedACLResponse` has an empty body because the operation is - // asynchronous and the update should be reflected in `Container` smart contract's - // storage after next block is issued in sidechain. - message Body { } + // asynchronous and the update should be reflected in `Container` smart + // contract's storage after next block is issued in sidechain. + message Body {} // Body of set extended acl response message. Body body = 1; @@ -337,8 +339,8 @@ message GetExtendedACLRequest { // Get Extended ACL message GetExtendedACLResponse { // Get Extended ACL Response body can be empty if the requested container does - // not have Extended ACL Table attached or Extended ACL has not been allowed at - // the time of container creation. + // not have Extended ACL Table attached or Extended ACL has not been allowed + // at the time of container creation. message Body { // Extended ACL requested, if available neo.fs.v2.acl.EACLTable eacl = 1; @@ -401,7 +403,7 @@ message AnnounceUsedSpaceRequest { message AnnounceUsedSpaceResponse { // `AnnounceUsedSpaceResponse` has an empty body because announcements are // one way communication. - message Body { } + message Body {} // Body of announce used space response message. Body body = 1; diff --git a/container/types.proto b/container/types.proto index 5f7f76b..8b4a8a9 100644 --- a/container/types.proto +++ b/container/types.proto @@ -10,26 +10,26 @@ import "refs/types.proto"; // Container is a structure that defines object placement behaviour. Objects can // be stored only within containers. They define placement rule, attributes and -// access control information. An ID of a container is a 32 byte long SHA256 hash -// of stable-marshalled container message. +// access control information. An ID of a container is a 32 byte long SHA256 +// hash of stable-marshalled container message. message Container { // Container format version. Effectively, the version of API library used to // create the container. - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Identifier of the container owner - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Nonce is a 16 byte UUIDv4, used to avoid collisions of `ContainerID`s - bytes nonce = 3 [json_name = "nonce"]; + bytes nonce = 3 [ json_name = "nonce" ]; - // `BasicACL` contains access control rules for the owner, system and others groups, - // as well as permission bits for `BearerToken` and `Extended ACL` - uint32 basic_acl = 4 [json_name = "basicACL"]; + // `BasicACL` contains access control rules for the owner, system and others + // groups, as well as permission bits for `BearerToken` and `Extended ACL` + uint32 basic_acl = 4 [ json_name = "basicACL" ]; // `Attribute` is a user-defined Key-Value metadata pair attached to the - // container. Container attributes are immutable. They are set at the moment of - // container creation and can never be added or updated. + // container. Container attributes are immutable. They are set at the moment + // of container creation and can never be added or updated. // // Key name must be a container-unique valid UTF-8 string. Value can't be // empty. Containers with duplicated attribute names or attributes with empty @@ -43,15 +43,16 @@ message Container { // NNS contract. // * [ __SYSTEM__ZONE ] \ // (`__NEOFS__ZONE` is deprecated) \ - // String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS - // contract. If no zone is specified, use default zone: `container`. + // String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). + // Used as a TLD of a domain name in NNS contract. If no zone is specified, + // use default zone: `container`. // * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ // (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ - // Disables homomorphic hashing for the container if the value equals "true" string. - // Any other values are interpreted as missing attribute. Container could be - // accepted in a NeoFS network only if the global network hashing configuration - // value corresponds with that attribute's value. After container inclusion, network - // setting is ignored. + // Disables homomorphic hashing for the container if the value equals "true" + // string. Any other values are interpreted as missing attribute. Container + // could be accepted in a NeoFS network only if the global network hashing + // configuration value corresponds with that attribute's value. After + // container inclusion, network setting is ignored. // // And some well-known attributes used by applications only: // @@ -61,14 +62,15 @@ message Container { // User-defined local time of container creation in Unix Timestamp format message Attribute { // Attribute name key - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Attribute value - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // Attributes represent immutable container's meta data - repeated Attribute attributes = 5 [json_name = "attributes"]; + repeated Attribute attributes = 5 [ json_name = "attributes" ]; // Placement policy for the object inside the container - neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 [json_name = "placementPolicy"]; + neo.fs.v2.netmap.PlacementPolicy placement_policy = 6 + [ json_name = "placementPolicy" ]; } diff --git a/lock/types.proto b/lock/types.proto index 52cbdea..2fdafa5 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -9,10 +9,11 @@ import "refs/types.proto"; // Lock objects protects a list of objects from being deleted. The lifetime of a // lock object is limited similar to regular objects in -// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch. -// It is impossible to delete a lock object via ObjectService.Delete RPC call. +// `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +// attribute. Lock object MUST have expiration epoch. It is impossible to delete +// a lock object via ObjectService.Delete RPC call. message Lock { // List of objects to lock. Must not be empty or carry empty IDs. // All members must be of the `REGULAR` type. - repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"]; + repeated neo.fs.v2.refs.ObjectID members = 1 [ json_name = "members" ]; } diff --git a/netmap/service.proto b/netmap/service.proto index 179a2c1..f5e7d9f 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -9,22 +9,23 @@ import "netmap/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// `NetmapService` provides methods to work with `Network Map` and the information -// required to build it. The resulting `Network Map` is stored in sidechain -// `Netmap` smart contract, while related information can be obtained from other -// NeoFS nodes. +// `NetmapService` provides methods to work with `Network Map` and the +// information required to build it. The resulting `Network Map` is stored in +// sidechain `Netmap` smart contract, while related information can be obtained +// from other NeoFS nodes. service NetmapService { - // Get NodeInfo structure from the particular node directly. - // Node information can be taken from `Netmap` smart contract. In some cases, though, - // one may want to get recent information directly or to talk to the node not yet - // present in the `Network Map` to find out what API version can be used for - // further communication. This can be also used to check if a node is up and running. + // Get NodeInfo structure from the particular node directly. + // Node information can be taken from `Netmap` smart contract. In some cases, + // though, one may want to get recent information directly or to talk to the + // node not yet present in the `Network Map` to find out what API version can + // be used for further communication. This can be also used to check if a node + // is up and running. // // Statuses: // - **OK** (0, SECTION_SUCCESS): // information about the server has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse); + rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); // Read recent information about the NeoFS network. // @@ -32,7 +33,7 @@ service NetmapService { // - **OK** (0, SECTION_SUCCESS): // information about the current network state has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse); + rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); // Returns network map snapshot of the current NeoFS epoch. // @@ -40,14 +41,13 @@ service NetmapService { // - **OK** (0, SECTION_SUCCESS): // information about the current network map has been successfully read; // - Common failures (SECTION_FAILURE_COMMON). - rpc NetmapSnapshot (NetmapSnapshotRequest) returns (NetmapSnapshotResponse); + rpc NetmapSnapshot(NetmapSnapshotRequest) returns (NetmapSnapshotResponse); } // Get NodeInfo structure directly from a particular node message LocalNodeInfoRequest { // LocalNodeInfo request body is empty. - message Body { - } + message Body {} // Body of the LocalNodeInfo request message Body body = 1; @@ -86,81 +86,77 @@ message LocalNodeInfoResponse { // Get NetworkInfo structure with the network view from a particular node. message NetworkInfoRequest { - // NetworkInfo request body is empty. - message Body { - } - // Body of the NetworkInfo request message - Body body = 1; + // NetworkInfo request body is empty. + message Body {} + // Body of the NetworkInfo request message + Body body = 1; - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Response with NetworkInfo structure including current epoch and // sidechain magic number. message NetworkInfoResponse { - // Information about the network. - message Body { - // NetworkInfo structure with recent information. - NetworkInfo network_info = 1; - } - // Body of the NetworkInfo response message. - Body body = 1; + // Information about the network. + message Body { + // NetworkInfo structure with recent information. + NetworkInfo network_info = 1; + } + // Body of the NetworkInfo response message. + Body body = 1; - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } // Get netmap snapshot request message NetmapSnapshotRequest { - // Get netmap snapshot request body. - message Body { - } + // Get netmap snapshot request body. + message Body {} - // Body of get netmap snapshot request message. - Body body = 1; + // Body of get netmap snapshot request message. + Body body = 1; - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } // Response with current netmap snapshot message NetmapSnapshotResponse { - // Get netmap snapshot response body - message Body { - // Structure of the requested network map. - Netmap netmap = 1 [json_name = "netmap"]; - } + // Get netmap snapshot response body + message Body { + // Structure of the requested network map. + Netmap netmap = 1 [ json_name = "netmap" ]; + } - // Body of get netmap snapshot response message. - Body body = 1; + // Body of get netmap snapshot response message. + Body body = 1; - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect response execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect response execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/netmap/types.proto b/netmap/types.proto index 2d72c7e..a3c9c00 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -52,46 +52,46 @@ enum Clause { DISTINCT = 2; } -// This filter will return the subset of nodes from `NetworkMap` or another filter's -// results that will satisfy filter's conditions. +// This filter will return the subset of nodes from `NetworkMap` or another +// filter's results that will satisfy filter's conditions. message Filter { // Name of the filter or a reference to a named filter. '*' means // application to the whole unfiltered NetworkMap. At top level it's used as a // filter name. At lower levels it's considered to be a reference to another // named filter - string name = 1 [json_name = "name"]; + string name = 1 [ json_name = "name" ]; // Key to filter - string key = 2 [json_name = "key"]; + string key = 2 [ json_name = "key" ]; // Filtering operation - Operation op = 3 [json_name = "op"]; + Operation op = 3 [ json_name = "op" ]; // Value to match - string value = 4 [json_name = "value"]; + string value = 4 [ json_name = "value" ]; // List of inner filters. Top level operation will be applied to the whole // list. - repeated Filter filters = 5 [json_name = "filters"]; + repeated Filter filters = 5 [ json_name = "filters" ]; } // Selector chooses a number of nodes from the bucket taking the nearest nodes // to the provided `ContainerID` by hash distance. message Selector { // Selector name to reference in object placement section - string name = 1 [json_name = "name"]; + string name = 1 [ json_name = "name" ]; // How many nodes to select from the bucket - uint32 count = 2 [json_name = "count"]; + uint32 count = 2 [ json_name = "count" ]; // Selector modifier showing how to form a bucket - Clause clause = 3 [json_name = "clause"]; + Clause clause = 3 [ json_name = "clause" ]; // Bucket attribute to select from - string attribute = 4 [json_name = "attribute"]; + string attribute = 4 [ json_name = "attribute" ]; // Filter reference to select from - string filter = 5 [json_name = "filter"]; + string filter = 5 [ json_name = "filter" ]; } // Number of object replicas in a set of nodes from the defined selector. If no @@ -99,10 +99,10 @@ message Selector { // default. message Replica { // How many object replicas to put - uint32 count = 1 [json_name = "count"]; + uint32 count = 1 [ json_name = "count" ]; // Named selector bucket to put replicas - string selector = 2 [json_name = "selector"]; + string selector = 2 [ json_name = "selector" ]; } // Set of rules to select a subset of nodes from `NetworkMap` able to store @@ -111,29 +111,29 @@ message Replica { message PlacementPolicy { // Rules to set number of object replicas and place each one into a named // bucket - repeated Replica replicas = 1 [json_name = "replicas"]; + repeated Replica replicas = 1 [ json_name = "replicas" ]; // Container backup factor controls how deep NeoFS will search for nodes // alternatives to include into container's nodes subset - uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"]; + uint32 container_backup_factor = 2 [ json_name = "containerBackupFactor" ]; // Set of Selectors to form the container's nodes subset - repeated Selector selectors = 3 [json_name = "selectors"]; + repeated Selector selectors = 3 [ json_name = "selectors" ]; // List of named filters to reference in selectors - repeated Filter filters = 4 [json_name = "filters"]; + repeated Filter filters = 4 [ json_name = "filters" ]; // Unique flag defines non-overlapping application for replicas - bool unique = 5 [json_name = "unique"]; + bool unique = 5 [ json_name = "unique" ]; } // NeoFS node description message NodeInfo { // Public key of the NeoFS node in a binary format - bytes public_key = 1 [json_name = "publicKey"]; + bytes public_key = 1 [ json_name = "publicKey" ]; // Ways to connect to a node - repeated string addresses = 2 [json_name = "addresses"]; + repeated string addresses = 2 [ json_name = "addresses" ]; // Administrator-defined Attributes of the NeoFS Storage Node. // @@ -141,15 +141,15 @@ message NodeInfo { // string. Value can't be empty. // // Attributes can be constructed into a chain of attributes: any attribute can - // have a parent attribute and a child attribute (except the first and the last - // one). A string representation of the chain of attributes in NeoFS Storage - // Node configuration uses ":" and "/" symbols, e.g.: + // have a parent attribute and a child attribute (except the first and the + // last one). A string representation of the chain of attributes in NeoFS + // Storage Node configuration uses ":" and "/" symbols, e.g.: // // `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` // - // Therefore the string attribute representation in the Node configuration must - // use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's - // key or value. + // Therefore the string attribute representation in the Node configuration + // must use "\:", "\/" and "\\" escaped symbols if any of them appears in an + // attribute's key or value. // // Node's attributes are mostly used during Storage Policy evaluation to // calculate object's placement and find a set of nodes satisfying policy @@ -204,20 +204,20 @@ message NodeInfo { // corresponding section in NeoFS Technical Specification. message Attribute { // Key of the node attribute - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Value of the node attribute - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; // Parent keys, if any. For example for `City` it could be `Region` and // `Country`. - repeated string parents = 3 [json_name = "parents"]; + repeated string parents = 3 [ json_name = "parents" ]; } // Carries list of the NeoFS node attributes in a key-value form. Key name // must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo // structures with duplicated attribute names or attributes with empty values // will be considered invalid. - repeated Attribute attributes = 3 [json_name = "attributes"]; + repeated Attribute attributes = 3 [ json_name = "attributes" ]; // Represents the enumeration of various states of the NeoFS node. enum State { @@ -235,16 +235,16 @@ message NodeInfo { } // Carries state of the NeoFS node - State state = 4 [json_name = "state"]; + State state = 4 [ json_name = "state" ]; } // Network map structure message Netmap { - // Network map revision number. - uint64 epoch = 1 [json_name = "epoch"]; + // Network map revision number. + uint64 epoch = 1 [ json_name = "epoch" ]; - // Nodes presented in network. - repeated NodeInfo nodes = 2 [json_name = "nodes"]; + // Nodes presented in network. + repeated NodeInfo nodes = 2 [ json_name = "nodes" ]; } // NeoFS network configuration @@ -285,26 +285,27 @@ message NetworkConfig { // Value: little-endian integer. Default: 0. message Parameter { // Parameter key. UTF-8 encoded string - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Parameter value - bytes value = 2 [json_name = "value"]; + bytes value = 2 [ json_name = "value" ]; } // List of parameter values - repeated Parameter parameters = 1 [json_name = "parameters"]; + repeated Parameter parameters = 1 [ json_name = "parameters" ]; } // Information about NeoFS network message NetworkInfo { - // Number of the current epoch in the NeoFS network - uint64 current_epoch = 1 [json_name = "currentEpoch"]; + // Number of the current epoch in the NeoFS network + uint64 current_epoch = 1 [ json_name = "currentEpoch" ]; - // Magic number of the sidechain of the NeoFS network - uint64 magic_number = 2 [json_name = "magicNumber"]; + // Magic number of the sidechain of the NeoFS network + uint64 magic_number = 2 [ json_name = "magicNumber" ]; - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS network - int64 ms_per_block = 3 [json_name = "msPerBlock"]; + // MillisecondsPerBlock network parameter of the sidechain of the NeoFS + // network + int64 ms_per_block = 3 [ json_name = "msPerBlock" ]; - // NeoFS network configuration - NetworkConfig network_config = 4 [json_name = "networkConfig"]; + // NeoFS network configuration + NetworkConfig network_config = 4 [ json_name = "networkConfig" ]; } diff --git a/refs/types.proto b/refs/types.proto index 2f94dd2..ebc076f 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -11,9 +11,9 @@ option csharp_namespace = "Neo.FileStorage.API.Refs"; // `ContainerID` and `ObjectID` delimited by '/' character. message Address { // Container identifier - ContainerID container_id = 1 [json_name = "containerID"]; + ContainerID container_id = 1 [ json_name = "containerID" ]; // Object identifier - ObjectID object_id = 2 [json_name = "objectID"]; + ObjectID object_id = 2 [ json_name = "objectID" ]; } // NeoFS Object unique identifier. Objects are immutable and content-addressed. @@ -21,8 +21,8 @@ message Address { // // `ObjectID` is a 32 byte long // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -// the object's `header` field, which, in it's turn, contains the hash of the object's -// payload. +// the object's `header` field, which, in it's turn, contains the hash of the +// object's payload. // // String presentation is a // [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. @@ -34,7 +34,7 @@ message Address { // with/without paddings are accepted. message ObjectID { // Object identifier in a binary format - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // NeoFS container identifier. Container structures are immutable and @@ -54,7 +54,7 @@ message ObjectID { // with/without paddings are accepted. message ContainerID { // Container identifier in a binary format. - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // `OwnerID` is a derivative of a user's main public key. The transformation @@ -74,32 +74,34 @@ message ContainerID { // with/without paddings are accepted. message OwnerID { // Identifier of the container owner in a binary format - bytes value = 1 [json_name = "value"]; + bytes value = 1 [ json_name = "value" ]; } // API version used by a node. // // String presentation is a Semantic Versioning 2.0.0 compatible version string -// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. +// with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor +// number. message Version { // Major API version - uint32 major = 1 [json_name = "major"]; + uint32 major = 1 [ json_name = "major" ]; // Minor API version - uint32 minor = 2 [json_name = "minor"]; + uint32 minor = 2 [ json_name = "minor" ]; } // Signature of something in NeoFS. message Signature { // Public key used for signing - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Signature - bytes sign = 2 [json_name = "signature"]; + bytes sign = 2 [ json_name = "signature" ]; // Scheme contains digital signature scheme identifier - SignatureScheme scheme = 3 [json_name = "scheme"]; + SignatureScheme scheme = 3 [ json_name = "scheme" ]; } -// Signature scheme describes digital signing scheme used for (key, signature) pair. +// Signature scheme describes digital signing scheme used for (key, signature) +// pair. enum SignatureScheme { // ECDSA with SHA-512 hashing (FIPS 186-3) ECDSA_SHA512 = 0; @@ -115,9 +117,9 @@ enum SignatureScheme { // RFC 6979 signature. message SignatureRFC6979 { // Public key used for signing - bytes key = 1 [json_name = "key"]; + bytes key = 1 [ json_name = "key" ]; // Deterministic ECDSA with SHA-256 hashing - bytes sign = 2 [json_name = "signature"]; + bytes sign = 2 [ json_name = "signature" ]; } // Checksum algorithm type. @@ -141,8 +143,8 @@ enum ChecksumType { // Hex encoded string without `0x` prefix message Checksum { // Checksum algorithm type - ChecksumType type = 1 [json_name = "type"]; + ChecksumType type = 1 [ json_name = "type" ]; // Checksum itself - bytes sum = 2 [json_name = "sum"]; + bytes sum = 2 [ json_name = "sum" ]; } diff --git a/session/service.proto b/session/service.proto index dcda6c8..6e12147 100644 --- a/session/service.proto +++ b/session/service.proto @@ -19,7 +19,7 @@ service SessionService { // - **OK** (0, SECTION_SUCCESS): // session has been successfully opened; // - Common failures (SECTION_FAILURE_COMMON). - rpc Create (CreateRequest) returns (CreateResponse); + rpc Create(CreateRequest) returns (CreateResponse); } // Information necessary for opening a session. diff --git a/session/types.proto b/session/types.proto index 63e5ded..a878665 100644 --- a/session/types.proto +++ b/session/types.proto @@ -38,51 +38,51 @@ message ObjectSessionContext { RANGEHASH = 7; } // Type of request for which the token is issued - Verb verb = 1 [json_name = "verb"]; + Verb verb = 1 [ json_name = "verb" ]; // Carries objects involved in the object session. message Target { // Indicates which container the session is spread to. Field MUST be set // and correct. - refs.ContainerID container = 1 [json_name = "container"]; + refs.ContainerID container = 1 [ json_name = "container" ]; // Indicates which objects the session is spread to. Objects are expected // to be stored in the NeoFS container referenced by `container` field. // Each element MUST have correct format. - repeated refs.ObjectID objects = 2 [json_name = "objects"]; + repeated refs.ObjectID objects = 2 [ json_name = "objects" ]; } // Object session target. MUST be correctly formed and set. If `objects` // field is not empty, then the session applies only to these elements, // otherwise, to all objects from the specified container. - Target target = 2 [json_name = "target"]; + Target target = 2 [ json_name = "target" ]; } // Context information for Session Tokens related to ContainerService requests. message ContainerSessionContext { - // Container request verbs - enum Verb { - // Unknown verb - VERB_UNSPECIFIED = 0; + // Container request verbs + enum Verb { + // Unknown verb + VERB_UNSPECIFIED = 0; - // Refers to container.Put RPC call - PUT = 1; + // Refers to container.Put RPC call + PUT = 1; - // Refers to container.Delete RPC call - DELETE = 2; + // Refers to container.Delete RPC call + DELETE = 2; - // Refers to container.SetExtendedACL RPC call - SETEACL = 3; - } - // Type of request for which the token is issued - Verb verb = 1 [json_name = "verb"]; + // Refers to container.SetExtendedACL RPC call + SETEACL = 3; + } + // Type of request for which the token is issued + Verb verb = 1 [ json_name = "verb" ]; - // Spreads the action to all owner containers. - // If set, container_id field is ignored. - bool wildcard = 2 [json_name = "wildcard"]; + // Spreads the action to all owner containers. + // If set, container_id field is ignored. + bool wildcard = 2 [ json_name = "wildcard" ]; - // Particular container to which the action applies. - // Ignored if wildcard flag is set. - refs.ContainerID container_id = 3 [json_name = "containerID"]; + // Particular container to which the action applies. + // Ignored if wildcard flag is set. + refs.ContainerID container_id = 3 [ json_name = "containerID" ]; } // NeoFS Session Token. @@ -90,55 +90,55 @@ message SessionToken { // Session Token body message Body { // Token identifier is a valid UUIDv4 in binary form - bytes id = 1 [json_name = "id"]; + bytes id = 1 [ json_name = "id" ]; // Identifier of the session initiator - neo.fs.v2.refs.OwnerID owner_id = 2 [json_name = "ownerID"]; + neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ]; // Lifetime parameters of the token. Field names taken from rfc7519. message TokenLifetime { // Expiration Epoch - uint64 exp = 1 [json_name = "exp"]; + uint64 exp = 1 [ json_name = "exp" ]; // Not valid before Epoch - uint64 nbf = 2 [json_name = "nbf"]; + uint64 nbf = 2 [ json_name = "nbf" ]; // Issued at Epoch - uint64 iat = 3 [json_name = "iat"]; + uint64 iat = 3 [ json_name = "iat" ]; } // Lifetime of the session - TokenLifetime lifetime = 3 [json_name = "lifetime"]; + TokenLifetime lifetime = 3 [ json_name = "lifetime" ]; // Public key used in session - bytes session_key = 4 [json_name = "sessionKey"]; + bytes session_key = 4 [ json_name = "sessionKey" ]; // Session Context information oneof context { // ObjectService session context - ObjectSessionContext object = 5 [json_name = "object"]; + ObjectSessionContext object = 5 [ json_name = "object" ]; // ContainerService session context - ContainerSessionContext container = 6 [json_name = "container"]; + ContainerSessionContext container = 6 [ json_name = "container" ]; } } // Session Token contains the proof of trust between peers to be attached in // requests for further verification. Please see corresponding section of // NeoFS Technical Specification for details. - Body body = 1 [json_name = "body"]; + Body body = 1 [ json_name = "body" ]; // Signature of `SessionToken` information - neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; + neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ]; } -// Extended headers for Request/Response. They may contain any user-defined headers -// to be interpreted on application level. +// Extended headers for Request/Response. They may contain any user-defined +// headers to be interpreted on application level. // -// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or -// Responses with duplicated header names or headers with empty values will be -// considered invalid. +// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests +// or Responses with duplicated header names or headers with empty values will +// be considered invalid. // -// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that -// affect system behaviour: +// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` +// is deprecated) prefix that affect system behaviour: // // * [ __SYSTEM__NETMAP_EPOCH ] \ // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -149,88 +149,90 @@ message SessionToken { // (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ // If object can't be found using current epoch's netmap, this header limits // how many past epochs the node can look up through. The `value` is string -// encoded `uint64` in decimal presentation. If set to '0' or not set, only the -// current epoch will be used. +// encoded `uint64` in decimal presentation. If set to '0' or not set, only +// the current epoch will be used. message XHeader { // Key of the X-Header - string key = 1 [json_name = "key"]; + string key = 1 [ json_name = "key" ]; // Value of the X-Header - string value = 2 [json_name = "value"]; + string value = 2 [ json_name = "value" ]; } // Meta information attached to the request. When forwarded between peers, // request meta headers are folded in matryoshka style. message RequestMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Peer's local epoch number. Set to 0 if unknown. - uint64 epoch = 2 [json_name = "epoch"]; + uint64 epoch = 2 [ json_name = "epoch" ]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3 [json_name = "ttl"]; + uint32 ttl = 3 [ json_name = "ttl" ]; // Request X-Headers - repeated XHeader x_headers = 4 [json_name = "xHeaders"]; + repeated XHeader x_headers = 4 [ json_name = "xHeaders" ]; // Session token within which the request is sent - SessionToken session_token = 5 [json_name = "sessionToken"]; + SessionToken session_token = 5 [ json_name = "sessionToken" ]; // `BearerToken` with eACL overrides for the request - neo.fs.v2.acl.BearerToken bearer_token = 6 [json_name = "bearerToken"]; + neo.fs.v2.acl.BearerToken bearer_token = 6 [ json_name = "bearerToken" ]; // `RequestMetaHeader` of the origin request - RequestMetaHeader origin = 7 [json_name = "origin"]; + RequestMetaHeader origin = 7 [ json_name = "origin" ]; // NeoFS network magic. Must match the value for the network // that the server belongs to. - uint64 magic_number = 8 [json_name = "magicNumber"]; + uint64 magic_number = 8 [ json_name = "magicNumber" ]; } // Information about the response message ResponseMetaHeader { // Peer's API version used - neo.fs.v2.refs.Version version = 1 [json_name = "version"]; + neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; // Peer's local epoch number - uint64 epoch = 2 [json_name = "epoch"]; + uint64 epoch = 2 [ json_name = "epoch" ]; // Maximum number of intermediate nodes in the request route - uint32 ttl = 3 [json_name = "ttl"]; + uint32 ttl = 3 [ json_name = "ttl" ]; // Response X-Headers - repeated XHeader x_headers = 4 [json_name = "xHeaders"]; + repeated XHeader x_headers = 4 [ json_name = "xHeaders" ]; // `ResponseMetaHeader` of the origin request - ResponseMetaHeader origin = 5 [json_name = "origin"]; + ResponseMetaHeader origin = 5 [ json_name = "origin" ]; // Status return - neo.fs.v2.status.Status status = 6 [json_name = "status"]; + neo.fs.v2.status.Status status = 6 [ json_name = "status" ]; } // Verification info for the request signed by all intermediate nodes. message RequestVerificationHeader { // Request Body signature. Should be generated once by the request initiator. - neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; + neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ]; // Request Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; + neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; + neo.fs.v2.refs.Signature origin_signature = 3 + [ json_name = "originSignature" ]; // Chain of previous hops signatures - RequestVerificationHeader origin = 4 [json_name = "origin"]; + RequestVerificationHeader origin = 4 [ json_name = "origin" ]; } // Verification info for the response signed by all intermediate nodes message ResponseVerificationHeader { // Response Body signature. Should be generated once by an answering node. - neo.fs.v2.refs.Signature body_signature = 1 [json_name = "bodySignature"]; + neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ]; // Response Meta signature is added and signed by each intermediate node - neo.fs.v2.refs.Signature meta_signature = 2 [json_name = "metaSignature"]; + neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ]; // Signature of previous hops - neo.fs.v2.refs.Signature origin_signature = 3 [json_name = "originSignature"]; + neo.fs.v2.refs.Signature origin_signature = 3 + [ json_name = "originSignature" ]; // Chain of previous hops signatures - ResponseVerificationHeader origin = 4 [json_name = "origin"]; + ResponseVerificationHeader origin = 4 [ json_name = "origin" ]; } diff --git a/status/types.proto b/status/types.proto index 34134a4..60dfd94 100644 --- a/status/types.proto +++ b/status/types.proto @@ -33,113 +33,113 @@ option csharp_namespace = "Neo.FileStorage.API.Status"; // should not expect) useful information in the message. Field `details` // should make the return more detailed. message Status { - // The status code - uint32 code = 1; + // The status code + uint32 code = 1; - // Developer-facing error message - string message = 2; + // Developer-facing error message + string message = 2; - // Return detail. It contains additional information that can be used to - // analyze the response. Each code defines a set of details that can be - // attached to a status. Client should not handle details that are not - // covered by the code. - message Detail { - // Detail ID. The identifier is required to determine the binary format - // of the detail and how to decode it. - uint32 id = 1; + // Return detail. It contains additional information that can be used to + // analyze the response. Each code defines a set of details that can be + // attached to a status. Client should not handle details that are not + // covered by the code. + message Detail { + // Detail ID. The identifier is required to determine the binary format + // of the detail and how to decode it. + uint32 id = 1; - // Binary status detail. Must follow the format associated with ID. - // The possibility of missing a value must be explicitly allowed. - bytes value = 2; - } + // Binary status detail. Must follow the format associated with ID. + // The possibility of missing a value must be explicitly allowed. + bytes value = 2; + } - // Data detailing the outcome of the operation. Must be unique by ID. - repeated Detail details = 3; + // Data detailing the outcome of the operation. Must be unique by ID. + repeated Detail details = 3; } // Section identifiers. enum Section { - // Successful return codes. - SECTION_SUCCESS = 0; + // Successful return codes. + SECTION_SUCCESS = 0; - // Failure codes regardless of the operation. - SECTION_FAILURE_COMMON = 1; + // Failure codes regardless of the operation. + SECTION_FAILURE_COMMON = 1; - // Object service-specific errors. - SECTION_OBJECT = 2; + // Object service-specific errors. + SECTION_OBJECT = 2; - // Container service-specific errors. - SECTION_CONTAINER = 3; + // Container service-specific errors. + SECTION_CONTAINER = 3; - // Session service-specific errors. - SECTION_SESSION = 4; + // Session service-specific errors. + SECTION_SESSION = 4; } // Section of NeoFS successful return codes. enum Success { - // [**0**] Default success. Not detailed. - // If the server cannot match successful outcome to the code, it should - // use this code. - OK = 0; + // [**0**] Default success. Not detailed. + // If the server cannot match successful outcome to the code, it should + // use this code. + OK = 0; } // Section of failed statuses independent of the operation. enum CommonFail { - // [**1024**] Internal server error, default failure. Not detailed. - // If the server cannot match failed outcome to the code, it should - // use this code. - INTERNAL = 0; + // [**1024**] Internal server error, default failure. Not detailed. + // If the server cannot match failed outcome to the code, it should + // use this code. + INTERNAL = 0; - // [**1025**] Wrong magic of the NeoFS network. - // Details: - // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit - // unsigned integer). - WRONG_MAGIC_NUMBER = 1; + // [**1025**] Wrong magic of the NeoFS network. + // Details: + // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit + // unsigned integer). + WRONG_MAGIC_NUMBER = 1; - // [**1026**] Signature verification failure. - SIGNATURE_VERIFICATION_FAIL = 2; + // [**1026**] Signature verification failure. + SIGNATURE_VERIFICATION_FAIL = 2; - // [**1027**] Node is under maintenance. - NODE_UNDER_MAINTENANCE = 3; + // [**1027**] Node is under maintenance. + NODE_UNDER_MAINTENANCE = 3; } // Section of statuses for object-related operations. enum Object { - // [**2048**] Access denied by ACL. - // Details: - // - [**0**] Human-readable description (UTF-8 encoded string). - ACCESS_DENIED = 0; + // [**2048**] Access denied by ACL. + // Details: + // - [**0**] Human-readable description (UTF-8 encoded string). + ACCESS_DENIED = 0; - // [**2049**] Object not found. - OBJECT_NOT_FOUND = 1; + // [**2049**] Object not found. + OBJECT_NOT_FOUND = 1; - // [**2050**] Operation rejected by the object lock. - LOCKED = 2; + // [**2050**] Operation rejected by the object lock. + LOCKED = 2; - // [**2051**] Locking an object with a non-REGULAR type rejected. - LOCK_NON_REGULAR_OBJECT = 3; + // [**2051**] Locking an object with a non-REGULAR type rejected. + LOCK_NON_REGULAR_OBJECT = 3; - // [**2052**] Object has been marked deleted. - OBJECT_ALREADY_REMOVED = 4; + // [**2052**] Object has been marked deleted. + OBJECT_ALREADY_REMOVED = 4; - // [**2053**] Invalid range has been requested for an object. - OUT_OF_RANGE = 5; + // [**2053**] Invalid range has been requested for an object. + OUT_OF_RANGE = 5; } // Section of statuses for container-related operations. enum Container { - // [**3072**] Container not found. - CONTAINER_NOT_FOUND = 0; + // [**3072**] Container not found. + CONTAINER_NOT_FOUND = 0; - // [**3073**] eACL table not found. - EACL_NOT_FOUND = 1; + // [**3073**] eACL table not found. + EACL_NOT_FOUND = 1; } // Section of statuses for session-related operations. enum Session { - // [**4096**] Token not found. - TOKEN_NOT_FOUND = 0; + // [**4096**] Token not found. + TOKEN_NOT_FOUND = 0; - // [**4097**] Token has expired. - TOKEN_EXPIRED = 1; + // [**4097**] Token has expired. + TOKEN_EXPIRED = 1; } diff --git a/tombstone/types.proto b/tombstone/types.proto index aa44a45..6547958 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -10,17 +10,18 @@ import "refs/types.proto"; // Tombstone keeps record of deleted objects for a few epochs until they are // purged from the NeoFS network. message Tombstone { - // Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone - // creator depending on the current NeoFS network settings. A tombstone object - // must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) + // Last NeoFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current NeoFS network settings. A + // tombstone object must have the same expiration epoch value in + // `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. - uint64 expiration_epoch = 1 [json_name = "expirationEpoch"]; + uint64 expiration_epoch = 1 [ json_name = "expirationEpoch" ]; // 16 byte UUID used to identify the split object hierarchy parts. Must be // unique inside a container. All objects participating in the split must // have the same `split_id` value. - bytes split_id = 2 [json_name = "splitID"]; + bytes split_id = 2 [ json_name = "splitID" ]; // List of objects to be deleted. - repeated neo.fs.v2.refs.ObjectID members = 3 [json_name = "members"]; + repeated neo.fs.v2.refs.ObjectID members = 3 [ json_name = "members" ]; } From f56ccf36b121f416137dade7e43573171cbd1186 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 28 Feb 2024 13:42:59 +0300 Subject: [PATCH 397/440] [#41] object: Support erasure codes Signed-off-by: Evgenii Stratonikov --- object/service.proto | 9 +++++++++ object/types.proto | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/object/service.proto b/object/service.proto index 2a3c6ff..3f727f4 100644 --- a/object/service.proto +++ b/object/service.proto @@ -319,6 +319,9 @@ message GetResponse { // Meta information of split hierarchy for object assembly. SplitInfo split_info = 3; + + // Meta information for EC object assembly. + ECInfo ec_info = 4; } } // Body of get object response message. @@ -503,6 +506,9 @@ message HeadResponse { // Meta information of split hierarchy. SplitInfo split_info = 3; + + // Meta information for EC object assembly. + ECInfo ec_info = 4; } } // Body of head object response message. @@ -678,6 +684,9 @@ message GetRangeResponse { // Meta information of split hierarchy. SplitInfo split_info = 2; + + // Meta information for EC object assembly. + ECInfo ec_info = 3; } } diff --git a/object/types.proto b/object/types.proto index dfc3afc..5b02365 100644 --- a/object/types.proto +++ b/object/types.proto @@ -193,6 +193,24 @@ message Header { } // Position of the object in the split hierarchy Split split = 11 [ json_name = "split" ]; + + // Erasure code can be applied to any object. + // Information about encoded object structure is stored in `EC` header. + // All objects belonging to a single EC group have the same `parent` field. + message EC { + // Identifier of the origin object. Known to all chunks. + neo.fs.v2.refs.ObjectID parent = 1 [ json_name = "parent" ]; + // Index of this chunk. + uint32 index = 2 [ json_name = "index" ]; + // Total number of chunks in this split. + uint32 total = 3 [ json_name = "total" ]; + // Total length of a parent header. Used to trim padding zeroes. + uint32 header_length = 4 [ json_name = "headerLength" ]; + // Chunk of a parent header. + bytes header = 5 [ json_name = "header" ]; + } + // Erasure code chunk information. + EC ec = 12 [ json_name = "ec" ]; } // Object structure. Object is immutable and content-addressed. It means @@ -232,3 +250,17 @@ message SplitInfo { // object parts. neo.fs.v2.refs.ObjectID link = 3; } + +// Meta information for the erasure-encoded object. +message ECInfo { + message Chunk { + // Object ID of the chunk. + neo.fs.v2.refs.ObjectID id = 1; + // Index of the chunk. + uint32 index = 2; + // Total number of chunks in this split. + uint32 total = 3; + } + // Chunk stored on the node. + repeated Chunk chunks = 1; +} \ No newline at end of file From 063d236c872bedf5c6c75b0835319ac35313d040 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:05:40 +0300 Subject: [PATCH 398/440] [#41] netmap: Support EC policy Signed-off-by: Evgenii Stratonikov --- netmap/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index a3c9c00..f599d56 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -103,6 +103,12 @@ message Replica { // Named selector bucket to put replicas string selector = 2 [ json_name = "selector" ]; + + // Data shards count + uint32 ec_data_count = 6 [ json_name = "ecDataCount" ]; + + // Parity shards count + uint32 ec_parity_count = 7 [ json_name = "ecParityCount" ]; } // Set of rules to select a subset of nodes from `NetworkMap` able to store From 46dd3885d2c655e98dd1c77b6f972c54afbc56ae Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 14 Mar 2024 10:11:06 +0300 Subject: [PATCH 399/440] [#41] netmap: Add well-known EC-related network settings Because big number of chunks can lead to excessive CPU/RAM usage, we restrict EC policies via network settings. Signed-off-by: Evgenii Stratonikov --- netmap/types.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index f599d56..926c4bc 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -289,6 +289,12 @@ message NetworkConfig { // - **WithdrawFee** \ // Fee paid for withdrawal of funds paid by the account owner. // Value: little-endian integer. Default: 0. + // - **MaxECDataCount** \ + // Maximum number of data shards for EC placement policy. + // Value: little-endian integer. Default: 0. + // - **MaxECParityCount** \ + // Maximum number of parity shards for EC placement policy. + // Value: little-endian integer. Default: 0. message Parameter { // Parameter key. UTF-8 encoded string bytes key = 1 [ json_name = "key" ]; From 07eb6a438cdb57fab8b1a219c112a572b9e8c6b8 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 5 Mar 2024 12:36:58 +0300 Subject: [PATCH 400/440] [#40] status: Introduce CONTAINER_ACCESS_DENIED status * Add a new status CONTAINER_ACCESS_DENIED. * Fix descriptions for methods of container and object services. * Also regenerate md docs. Signed-off-by: Airat Arifullin --- container/service.proto | 24 +++-- object/service.proto | 16 +++ proto-docs/accounting.md | 3 +- proto-docs/acl.md | 8 +- proto-docs/container.md | 155 ++++++++++++++------------- proto-docs/lock.md | 5 +- proto-docs/netmap.md | 114 +++++++++++--------- proto-docs/object.md | 220 +++++++++++++++++++++++++++++++++------ proto-docs/refs.md | 38 +++---- proto-docs/session.md | 18 ++-- proto-docs/status.md | 1 + status/types.proto | 3 + 12 files changed, 411 insertions(+), 194 deletions(-) diff --git a/container/service.proto b/container/service.proto index fa45703..5695b66 100644 --- a/container/service.proto +++ b/container/service.proto @@ -23,7 +23,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container create access denied. rpc Put(PutRequest) returns (PutResponse); // `Delete` invokes `Container` smart contract's `Delete` method and returns @@ -34,7 +36,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to remove the container has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container delete access denied. rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns container structure from `Container` smart contract storage. @@ -44,7 +48,9 @@ service ContainerService { // container has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // requested container not found. + // requested container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied. rpc Get(GetRequest) returns (GetResponse); // Returns all owner's containers from 'Container` smart contract' storage. @@ -52,7 +58,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // container list has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response @@ -62,7 +70,9 @@ service ContainerService { // Statuses: // - **OK** (0, SECTION_SUCCESS): \ // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON). + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // set container eACL access denied. rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); // Returns Extended ACL table and signature from `Container` smart contract @@ -75,7 +85,9 @@ service ContainerService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // container not found; // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found. + // eACL table not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container eACL is denied. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announces the space values used by the container for P2P synchronization. diff --git a/object/service.proto b/object/service.proto index 3f727f4..bbf0fc3 100644 --- a/object/service.proto +++ b/object/service.proto @@ -45,6 +45,8 @@ service ObjectService { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Get(GetRequest) returns (stream GetResponse); @@ -78,6 +80,8 @@ service ObjectService { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has @@ -110,6 +114,8 @@ service ObjectService { // deleting a locked object is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Delete(DeleteRequest) returns (DeleteResponse); @@ -138,6 +144,8 @@ service ObjectService { // the requested object has been marked as deleted; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Head(HeadRequest) returns (HeadResponse); @@ -162,6 +170,8 @@ service ObjectService { // access to operation SEARCH of the object is denied; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // search container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Search(SearchRequest) returns (stream SearchResponse); @@ -197,6 +207,8 @@ service ObjectService { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); @@ -230,6 +242,8 @@ service ObjectService { // the requested range is out of bounds; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); @@ -260,6 +274,8 @@ service ObjectService { // type other than REGULAR is prohibited; // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 94de765..9ed7186 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -105,7 +105,8 @@ BalanceResponse message ### Message BalanceResponse.Body The amount of funds in GAS token for the `OwnerID`'s account requested. -Balance is given in the `Decimal` format to avoid precision issues with rounding. +Balance is given in the `Decimal` format to avoid precision issues with +rounding. | Field | Type | Label | Description | diff --git a/proto-docs/acl.md b/proto-docs/acl.md index c32f958..69d1d3d 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -38,8 +38,8 @@ like [JWT](https://jwt.io), it has a limited lifetime and scope, hence can be used in the similar use cases, like providing authorisation to externally authenticated party. -BearerToken can be issued only by the container's owner and must be signed using -the key associated with the container's `OwnerID`. +BearerToken can be issued only by the container's owner and must be signed +using the key associated with the container's `OwnerID`. | Field | Type | Label | Description | @@ -51,8 +51,8 @@ the key associated with the container's `OwnerID`. ### Message BearerToken.Body -Bearer Token body structure contains Extended ACL table issued by the container -owner with additional information preventing token abuse. +Bearer Token body structure contains Extended ACL table issued by the +container owner with additional information preventing token abuse. | Field | Type | Label | Description | diff --git a/proto-docs/container.md b/proto-docs/container.md index 6368889..024057f 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -3,50 +3,50 @@ ## Table of Contents -- [Protocol Documentation](#protocol-documentation) - - [Table of Contents](#table-of-contents) - - [container/service.proto](#containerserviceproto) - - [Service "neo.fs.v2.container.ContainerService"](#service-neofsv2containercontainerservice) - - [Method Put](#method-put) - - [Method Delete](#method-delete) - - [Method Get](#method-get) - - [Method List](#method-list) - - [Method SetExtendedACL](#method-setextendedacl) - - [Method GetExtendedACL](#method-getextendedacl) - - [Method AnnounceUsedSpace](#method-announceusedspace) - - [Message AnnounceUsedSpaceRequest](#message-announceusedspacerequest) - - [Message AnnounceUsedSpaceRequest.Body](#message-announceusedspacerequestbody) - - [Message AnnounceUsedSpaceRequest.Body.Announcement](#message-announceusedspacerequestbodyannouncement) - - [Message AnnounceUsedSpaceResponse](#message-announceusedspaceresponse) - - [Message AnnounceUsedSpaceResponse.Body](#message-announceusedspaceresponsebody) - - [Message DeleteRequest](#message-deleterequest) - - [Message DeleteRequest.Body](#message-deleterequestbody) - - [Message DeleteResponse](#message-deleteresponse) - - [Message DeleteResponse.Body](#message-deleteresponsebody) - - [Message GetExtendedACLRequest](#message-getextendedaclrequest) - - [Message GetExtendedACLRequest.Body](#message-getextendedaclrequestbody) - - [Message GetExtendedACLResponse](#message-getextendedaclresponse) - - [Message GetExtendedACLResponse.Body](#message-getextendedaclresponsebody) - - [Message GetRequest](#message-getrequest) - - [Message GetRequest.Body](#message-getrequestbody) - - [Message GetResponse](#message-getresponse) - - [Message GetResponse.Body](#message-getresponsebody) - - [Message ListRequest](#message-listrequest) - - [Message ListRequest.Body](#message-listrequestbody) - - [Message ListResponse](#message-listresponse) - - [Message ListResponse.Body](#message-listresponsebody) - - [Message PutRequest](#message-putrequest) - - [Message PutRequest.Body](#message-putrequestbody) - - [Message PutResponse](#message-putresponse) - - [Message PutResponse.Body](#message-putresponsebody) - - [Message SetExtendedACLRequest](#message-setextendedaclrequest) - - [Message SetExtendedACLRequest.Body](#message-setextendedaclrequestbody) - - [Message SetExtendedACLResponse](#message-setextendedaclresponse) - - [Message SetExtendedACLResponse.Body](#message-setextendedaclresponsebody) - - [container/types.proto](#containertypesproto) - - [Message Container](#message-container) - - [Message Container.Attribute](#message-containerattribute) - - [Scalar Value Types](#scalar-value-types) +- [container/service.proto](#container/service.proto) + - Services + - [ContainerService](#neo.fs.v2.container.ContainerService) + + - Messages + - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) + - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) + - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) + - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) + - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) + - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) + - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) + - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) + - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) + - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) + - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) + - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) + - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) + - [GetRequest](#neo.fs.v2.container.GetRequest) + - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) + - [GetResponse](#neo.fs.v2.container.GetResponse) + - [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) + - [ListRequest](#neo.fs.v2.container.ListRequest) + - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) + - [ListResponse](#neo.fs.v2.container.ListResponse) + - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) + - [PutRequest](#neo.fs.v2.container.PutRequest) + - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) + - [PutResponse](#neo.fs.v2.container.PutResponse) + - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) + - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) + - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) + - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) + - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) + + +- [container/types.proto](#container/types.proto) + + - Messages + - [Container](#neo.fs.v2.container.Container) + - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) + + +- [Scalar Value Types](#scalar-value-types) @@ -81,13 +81,15 @@ rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceRespon `Put` invokes `Container` smart contract's `Put` method and returns response immediately. After a new block is issued in sidechain, request is -verified by Inner Ring nodes. After one more block in sidechain, the container -is added into smart contract storage. +verified by Inner Ring nodes. After one more block in sidechain, the +container is added into smart contract storage. Statuses: - **OK** (0, SECTION_SUCCESS): \ request to save the container has been sent to the sidechain; -- Common failures (SECTION_FAILURE_COMMON). +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + container create access denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -96,13 +98,15 @@ Statuses: `Delete` invokes `Container` smart contract's `Delete` method and returns response immediately. After a new block is issued in sidechain, request is -verified by Inner Ring nodes. After one more block in sidechain, the container -is added into smart contract storage. +verified by Inner Ring nodes. After one more block in sidechain, the +container is added into smart contract storage. Statuses: - **OK** (0, SECTION_SUCCESS): \ request to remove the container has been sent to the sidechain; -- Common failures (SECTION_FAILURE_COMMON). +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + container delete access denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -116,7 +120,9 @@ Statuses: container has been successfully read; - Common failures (SECTION_FAILURE_COMMON); - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - requested container not found. + requested container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -128,7 +134,9 @@ Returns all owner's containers from 'Container` smart contract' storage. Statuses: - **OK** (0, SECTION_SUCCESS): \ container list has been successfully read; -- Common failures (SECTION_FAILURE_COMMON). +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + container list access denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -136,13 +144,15 @@ Statuses: #### Method SetExtendedACL Invokes 'SetEACL' method of 'Container` smart contract and returns response -immediately. After one more block in sidechain, changes in an Extended ACL are -added into smart contract storage. +immediately. After one more block in sidechain, changes in an Extended ACL +are added into smart contract storage. Statuses: - **OK** (0, SECTION_SUCCESS): \ request to save container eACL has been sent to the sidechain; -- Common failures (SECTION_FAILURE_COMMON). +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + set container eACL access denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -159,7 +169,9 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ container not found; - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - eACL table not found. + eACL table not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container eACL is denied. | Name | Input | Output | | ---- | ----- | ------ | @@ -327,8 +339,8 @@ Get Extended ACL ### Message GetExtendedACLResponse.Body Get Extended ACL Response body can be empty if the requested container does -not have Extended ACL Table attached or Extended ACL has not been allowed at -the time of container creation. +not have Extended ACL Table attached or Extended ACL has not been allowed +at the time of container creation. | Field | Type | Label | Description | @@ -536,8 +548,8 @@ Set Extended ACL ### Message SetExtendedACLResponse.Body `SetExtendedACLResponse` has an empty body because the operation is -asynchronous and the update should be reflected in `Container` smart contract's -storage after next block is issued in sidechain. +asynchronous and the update should be reflected in `Container` smart +contract's storage after next block is issued in sidechain. @@ -560,8 +572,8 @@ storage after next block is issued in sidechain. ### Message Container Container is a structure that defines object placement behaviour. Objects can be stored only within containers. They define placement rule, attributes and -access control information. An ID of a container is a 32 byte long SHA256 hash -of stable-marshalled container message. +access control information. An ID of a container is a 32 byte long SHA256 +hash of stable-marshalled container message. | Field | Type | Label | Description | @@ -578,8 +590,8 @@ of stable-marshalled container message. ### Message Container.Attribute `Attribute` is a user-defined Key-Value metadata pair attached to the -container. Container attributes are immutable. They are set at the moment of -container creation and can never be added or updated. +container. Container attributes are immutable. They are set at the moment +of container creation and can never be added or updated. Key name must be a container-unique valid UTF-8 string. Value can't be empty. Containers with duplicated attribute names or attributes with empty @@ -593,15 +605,16 @@ There are some "well-known" attributes affecting system behaviour: NNS contract. * [ __SYSTEM__ZONE ] \ (`__NEOFS__ZONE` is deprecated) \ - String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). Used as a TLD of a domain name in NNS - contract. If no zone is specified, use default zone: `container`. + String of a zone for `__SYSTEM__NAME` (`__NEOFS__NAME` is deprecated). + Used as a TLD of a domain name in NNS contract. If no zone is specified, + use default zone: `container`. * [ __SYSTEM__DISABLE_HOMOMORPHIC_HASHING ] \ (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ - Disables homomorphic hashing for the container if the value equals "true" string. - Any other values are interpreted as missing attribute. Container could be - accepted in a NeoFS network only if the global network hashing configuration - value corresponds with that attribute's value. After container inclusion, network - setting is ignored. + Disables homomorphic hashing for the container if the value equals "true" + string. Any other values are interpreted as missing attribute. Container + could be accepted in a NeoFS network only if the global network hashing + configuration value corresponds with that attribute's value. After + container inclusion, network setting is ignored. And some well-known attributes used by applications only: diff --git a/proto-docs/lock.md b/proto-docs/lock.md index 5ed9780..2e730f8 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -27,8 +27,9 @@ ### Message Lock Lock objects protects a list of objects from being deleted. The lifetime of a lock object is limited similar to regular objects in -`__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Lock object MUST have expiration epoch. -It is impossible to delete a lock object via ObjectService.Delete RPC call. +`__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) +attribute. Lock object MUST have expiration epoch. It is impossible to delete +a lock object via ObjectService.Delete RPC call. | Field | Type | Label | Description | diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 19b8bd2..45fd764 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -3,40 +3,41 @@ ## Table of Contents -- [Protocol Documentation](#protocol-documentation) - - [Table of Contents](#table-of-contents) - - [netmap/service.proto](#netmapserviceproto) - - [Service "neo.fs.v2.netmap.NetmapService"](#service-neofsv2netmapnetmapservice) - - [Method LocalNodeInfo](#method-localnodeinfo) - - [Method NetworkInfo](#method-networkinfo) - - [Method NetmapSnapshot](#method-netmapsnapshot) - - [Message LocalNodeInfoRequest](#message-localnodeinforequest) - - [Message LocalNodeInfoRequest.Body](#message-localnodeinforequestbody) - - [Message LocalNodeInfoResponse](#message-localnodeinforesponse) - - [Message LocalNodeInfoResponse.Body](#message-localnodeinforesponsebody) - - [Message NetmapSnapshotRequest](#message-netmapsnapshotrequest) - - [Message NetmapSnapshotRequest.Body](#message-netmapsnapshotrequestbody) - - [Message NetmapSnapshotResponse](#message-netmapsnapshotresponse) - - [Message NetmapSnapshotResponse.Body](#message-netmapsnapshotresponsebody) - - [Message NetworkInfoRequest](#message-networkinforequest) - - [Message NetworkInfoRequest.Body](#message-networkinforequestbody) - - [Message NetworkInfoResponse](#message-networkinforesponse) - - [Message NetworkInfoResponse.Body](#message-networkinforesponsebody) - - [netmap/types.proto](#netmaptypesproto) - - [Message Filter](#message-filter) - - [Message Netmap](#message-netmap) - - [Message NetworkConfig](#message-networkconfig) - - [Message NetworkConfig.Parameter](#message-networkconfigparameter) - - [Message NetworkInfo](#message-networkinfo) - - [Message NodeInfo](#message-nodeinfo) - - [Message NodeInfo.Attribute](#message-nodeinfoattribute) - - [Message PlacementPolicy](#message-placementpolicy) - - [Message Replica](#message-replica) - - [Message Selector](#message-selector) - - [Clause](#clause) - - [NodeInfo.State](#nodeinfostate) - - [Operation](#operation) - - [Scalar Value Types](#scalar-value-types) +- [netmap/service.proto](#netmap/service.proto) + - Services + - [NetmapService](#neo.fs.v2.netmap.NetmapService) + + - Messages + - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) + - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) + - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) + - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) + - [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) + - [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) + - [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) + - [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) + - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) + - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) + - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) + - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) + + +- [netmap/types.proto](#netmap/types.proto) + + - Messages + - [Filter](#neo.fs.v2.netmap.Filter) + - [Netmap](#neo.fs.v2.netmap.Netmap) + - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) + - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) + - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) + - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) + - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) + - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) + - [Replica](#neo.fs.v2.netmap.Replica) + - [Selector](#neo.fs.v2.netmap.Selector) + + +- [Scalar Value Types](#scalar-value-types) @@ -51,10 +52,10 @@ ### Service "neo.fs.v2.netmap.NetmapService" -`NetmapService` provides methods to work with `Network Map` and the information -required to build it. The resulting `Network Map` is stored in sidechain -`Netmap` smart contract, while related information can be obtained from other -NeoFS nodes. +`NetmapService` provides methods to work with `Network Map` and the +information required to build it. The resulting `Network Map` is stored in +sidechain `Netmap` smart contract, while related information can be obtained +from other NeoFS nodes. ``` rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); @@ -65,11 +66,12 @@ rpc NetmapSnapshot(NetmapSnapshotRequest) returns (NetmapSnapshotResponse); #### Method LocalNodeInfo -Get NodeInfo structure from the particular node directly. -Node information can be taken from `Netmap` smart contract. In some cases, though, -one may want to get recent information directly or to talk to the node not yet -present in the `Network Map` to find out what API version can be used for -further communication. This can be also used to check if a node is up and running. +Get NodeInfo structure from the particular node directly. +Node information can be taken from `Netmap` smart contract. In some cases, +though, one may want to get recent information directly or to talk to the +node not yet present in the `Network Map` to find out what API version can +be used for further communication. This can be also used to check if a node +is up and running. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -257,8 +259,8 @@ Information about the network. ### Message Filter -This filter will return the subset of nodes from `NetworkMap` or another filter's -results that will satisfy filter's conditions. +This filter will return the subset of nodes from `NetworkMap` or another +filter's results that will satisfy filter's conditions. | Field | Type | Label | Description | @@ -330,6 +332,12 @@ System parameters: - **WithdrawFee** \ Fee paid for withdrawal of funds paid by the account owner. Value: little-endian integer. Default: 0. +- **MaxECDataCount** \ + Maximum number of data shards for EC placement policy. + Value: little-endian integer. Default: 0. +- **MaxECParityCount** \ + Maximum number of parity shards for EC placement policy. + Value: little-endian integer. Default: 0. | Field | Type | Label | Description | @@ -375,15 +383,15 @@ Administrator-defined Attributes of the NeoFS Storage Node. string. Value can't be empty. Attributes can be constructed into a chain of attributes: any attribute can -have a parent attribute and a child attribute (except the first and the last -one). A string representation of the chain of attributes in NeoFS Storage -Node configuration uses ":" and "/" symbols, e.g.: +have a parent attribute and a child attribute (except the first and the +last one). A string representation of the chain of attributes in NeoFS +Storage Node configuration uses ":" and "/" symbols, e.g.: `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` -Therefore the string attribute representation in the Node configuration must -use "\:", "\/" and "\\" escaped symbols if any of them appears in an attribute's -key or value. +Therefore the string attribute representation in the Node configuration +must use "\:", "\/" and "\\" escaped symbols if any of them appears in an +attribute's key or value. Node's attributes are mostly used during Storage Policy evaluation to calculate object's placement and find a set of nodes satisfying policy @@ -459,6 +467,7 @@ storage policy definition languages. | container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset | | selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | +| unique | [bool](#bool) | | Unique flag defines non-overlapping application for replicas | @@ -473,6 +482,8 @@ default. | ----- | ---- | ----- | ----------- | | count | [uint32](#uint32) | | How many object replicas to put | | selector | [string](#string) | | Named selector bucket to put replicas | +| ec_data_count | [uint32](#uint32) | | Data shards count | +| ec_parity_count | [uint32](#uint32) | | Parity shards count | @@ -538,6 +549,7 @@ Operations on filters | LE | 6 | Less or equal | | OR | 7 | Logical OR | | AND | 8 | Logical AND | +| NOT | 9 | Logical negation | diff --git a/proto-docs/object.md b/proto-docs/object.md index 8b5f460..f080e4a 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -35,6 +35,10 @@ - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) - [PutResponse](#neo.fs.v2.object.PutResponse) - [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) + - [PutSingleRequest](#neo.fs.v2.object.PutSingleRequest) + - [PutSingleRequest.Body](#neo.fs.v2.object.PutSingleRequest.Body) + - [PutSingleResponse](#neo.fs.v2.object.PutSingleResponse) + - [PutSingleResponse.Body](#neo.fs.v2.object.PutSingleResponse.Body) - [Range](#neo.fs.v2.object.Range) - [SearchRequest](#neo.fs.v2.object.SearchRequest) - [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) @@ -46,8 +50,11 @@ - [object/types.proto](#object/types.proto) - Messages + - [ECInfo](#neo.fs.v2.object.ECInfo) + - [ECInfo.Chunk](#neo.fs.v2.object.ECInfo.Chunk) - [Header](#neo.fs.v2.object.Header) - [Header.Attribute](#neo.fs.v2.object.Header.Attribute) + - [Header.EC](#neo.fs.v2.object.Header.EC) - [Header.Split](#neo.fs.v2.object.Header.Split) - [Object](#neo.fs.v2.object.Object) - [ShortHeader](#neo.fs.v2.object.ShortHeader) @@ -80,17 +87,18 @@ rpc Head(HeadRequest) returns (HeadResponse); rpc Search(SearchRequest) returns (stream SearchResponse); rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); +rpc PutSingle(PutSingleRequest) returns (PutSingleResponse); ``` #### Method Get Receive full object structure, including Headers and payload. Response uses -gRPC stream. First response message carries the object with the requested address. -Chunk messages are parts of the object's payload if it is needed. All -messages, except the first one, carry payload chunks. The requested object can -be restored by concatenation of object message payload and all chunks -keeping the receiving order. +gRPC stream. First response message carries the object with the requested +address. Chunk messages are parts of the object's payload if it is needed. +All messages, except the first one, carry payload chunks. The requested +object can be restored by concatenation of object message payload and all +chunks keeping the receiving order. Extended headers can change `Get` behaviour: * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -99,9 +107,10 @@ Extended headers can change `Get` behaviour: calculation. * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \ (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ - Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or - the latest one otherwise) of Network Map to find an object until the depth - limit is reached. + Will try older versions (starting from `__SYSTEM__NETMAP_EPOCH` + (`__NEOFS__NETMAP_EPOCH` is deprecated) if specified or the latest one + otherwise) of Network Map to find an object until the depth limit is + reached. Please refer to detailed `XHeader` description. @@ -117,6 +126,8 @@ Statuses: the requested object has been marked as deleted; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -147,15 +158,18 @@ Statuses: - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ write access to the container is denied; - **LOCKED** (2050, SECTION_OBJECT): \ - placement of an object of type TOMBSTONE that includes at least one locked - object is prohibited; + placement of an object of type TOMBSTONE that includes at least one + locked object is prohibited; - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ placement of an object of type LOCK that includes at least one object of type other than REGULAR is prohibited; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object storage container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ - (for trusted object preparation) session private key does not exist or has + (for trusted object preparation) session private key does not exist or + has been deleted; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -182,10 +196,15 @@ Statuses: - Common failures (SECTION_FAILURE_COMMON); - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ delete access to the object is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + the object could not be deleted because it has not been \ + found within the container; - **LOCKED** (2050, SECTION_OBJECT): \ deleting a locked object is prohibited; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -218,6 +237,8 @@ Statuses: the requested object has been marked as deleted; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -246,6 +267,8 @@ Statuses: access to operation SEARCH of the object is denied; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ search container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -256,8 +279,8 @@ Statuses: Get byte range of data payload. Range is set as an (offset, length) tuple. Like in `Get` method, the response uses gRPC stream. Requested range can be -restored by concatenation of all received payload chunks keeping the receiving -order. +restored by concatenation of all received payload chunks keeping the +receiving order. Extended headers can change `GetRange` behaviour: * [ __SYSTEM__NETMAP_EPOCH ] \ @@ -285,6 +308,8 @@ Statuses: the requested range is out of bounds; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -322,12 +347,54 @@ Statuses: the requested range is out of bounds; - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. | Name | Input | Output | | ---- | ----- | ------ | | GetRangeHash | [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) | [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) | +#### Method PutSingle + +Put the prepared object into container. +`ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of +an object MUST be set. + +Extended headers can change `Put` behaviour: +* [ __SYSTEM__NETMAP_EPOCH \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requested version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + object has been successfully saved in the container; +- Common failures (SECTION_FAILURE_COMMON); +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + write access to the container is denied; +- **LOCKED** (2050, SECTION_OBJECT): \ + placement of an object of type TOMBSTONE that includes at least one + locked object is prohibited; +- **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \ + placement of an object of type LOCK that includes at least one object of + type other than REGULAR is prohibited; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object storage container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; +- **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + (for trusted object preparation) session private key does not exist or + has +been deleted; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. + +| Name | Input | Output | +| ---- | ----- | ------ | +| PutSingle | [PutSingleRequest](#neo.fs.v2.object.PutSingleRequest) | [PutSingleResponse](#neo.fs.v2.object.PutSingleResponse) | @@ -484,6 +551,7 @@ chunks. | ----- | ---- | ----- | ----------- | | chunk | [bytes](#bytes) | | Chunked object payload's range. | | split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. | +| ec_info | [ECInfo](#neo.fs.v2.object.ECInfo) | | Meta information for EC object assembly. | @@ -535,6 +603,7 @@ GET Object Response body | init | [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) | | Initial part of the object stream | | chunk | [bytes](#bytes) | | Chunked object payload | | split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy for object assembly. | +| ec_info | [ECInfo](#neo.fs.v2.object.ECInfo) | | Meta information for EC object assembly. | @@ -601,6 +670,7 @@ Object HEAD response body | header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object's `Header` with `ObjectID` signature | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | | split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. | +| ec_info | [ECInfo](#neo.fs.v2.object.ECInfo) | | Meta information for EC object assembly. | @@ -685,6 +755,51 @@ PUT Object response body | object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the saved object | + + +### Message PutSingleRequest +Object PUT Single request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PutSingleRequest.Body](#neo.fs.v2.object.PutSingleRequest.Body) | | Body of put single object request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PutSingleRequest.Body +PUT Single request body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| object | [Object](#neo.fs.v2.object.Object) | | Prepared object with payload. | +| copies_number | [uint32](#uint32) | repeated | Number of copies of the object to store within the RPC call. By default, object is processed according to the container's placement policy. Every number is treated as a minimal number of nodes in a corresponding placement vector that must store an object to complete the request successfully. The length MUST equal the placement vectors number, otherwise request is considered malformed. | + + + + +### Message PutSingleResponse +Object PUT Single response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PutSingleResponse.Body](#neo.fs.v2.object.PutSingleResponse.Body) | | Body of put single object response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PutSingleResponse.Body +PUT Single Object response body + + + ### Message Range @@ -726,11 +841,11 @@ Object Search request body ### Message SearchRequest.Body.Filter -Filter structure checks if the object header field or the attribute content -matches a value. +Filter structure checks if the object header field or the attribute +content matches a value. If no filters are set, search request will return all objects of the -container, including Regular object, Tombstones and Storage Group +container, including Regular object and Tombstone objects. Most human users expect to get only object they can directly work with. In that case, `$Object:ROOT` filter should be used. @@ -765,11 +880,11 @@ There are some well-known filter aliases to match objects by certain properties: * $Object:ROOT \ - Returns only `REGULAR` type objects that are not split or that are the top - level root objects in a split hierarchy. This includes objects not + Returns only `REGULAR` type objects that are not split or that are the + top level root objects in a split hierarchy. This includes objects not present physically, like large objects split into smaller objects without a separate top-level root object. Objects of other types like - StorageGroups and Tombstones will not be shown. This filter may be + Locks and Tombstones will not be shown. This filter may be useful for listing objects like `ls` command of some virtual file system. This filter is activated if the `key` exists, disregarding the value and matcher type. @@ -778,8 +893,8 @@ properties: activated if the `key` exists, disregarding the value and matcher type. Note: using filters with a key with prefix `$Object:` and match type -`NOT_PRESENT `is not recommended since this is not a cross-version approach. -Behavior when processing this kind of filters is undefined. +`NOT_PRESENT `is not recommended since this is not a cross-version +approach. Behavior when processing this kind of filters is undefined. | Field | Type | Label | Description | @@ -827,6 +942,30 @@ Object Search response body + + +### Message ECInfo +Meta information for the erasure-encoded object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| chunks | [ECInfo.Chunk](#neo.fs.v2.object.ECInfo.Chunk) | repeated | Chunk stored on the node. | + + + + +### Message ECInfo.Chunk + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Object ID of the chunk. | +| index | [uint32](#uint32) | | Index of the chunk. | +| total | [uint32](#uint32) | | Total number of chunks in this split. | + + ### Message Header @@ -846,6 +985,7 @@ Object Header | session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. | | attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes | | split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy | +| ec | [Header.EC](#neo.fs.v2.object.Header.EC) | | Erasure code chunk information. | @@ -858,15 +998,16 @@ Key name must be an object-unique valid UTF-8 string. Value can't be empty. Objects with duplicated attribute names or attributes with empty values will be considered invalid. -There are some "well-known" attributes starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix -that affect system behaviour: +There are some "well-known" attributes starting with `__SYSTEM__` +(`__NEOFS__` is deprecated) prefix that affect system behaviour: * [ __SYSTEM__UPLOAD_ID ] \ (`__NEOFS__UPLOAD_ID` is deprecated) \ Marks smaller parts of a split bigger object * [ __SYSTEM__EXPIRATION_EPOCH ] \ (`__NEOFS__EXPIRATION_EPOCH` is deprecated) \ - Tells GC to delete object after that epoch + The epoch after which object with no LOCKs on it becomes unavailable. + Locked object continues to be available until each of the LOCKs expire. * [ __SYSTEM__TICK_EPOCH ] \ (`__NEOFS__TICK_EPOCH` is deprecated) \ Decimal number that defines what epoch must produce @@ -905,6 +1046,23 @@ corresponding section in NeoFS Technical Specification. | value | [string](#string) | | string value of the object attribute | + + +### Message Header.EC +Erasure code can be applied to any object. +Information about encoded object structure is stored in `EC` header. +All objects belonging to a single EC group have the same `parent` field. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| parent | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | Identifier of the origin object. Known to all chunks. | +| index | [uint32](#uint32) | | Index of this chunk. | +| total | [uint32](#uint32) | | Total number of chunks in this split. | +| header_length | [uint32](#uint32) | | Total length of a parent header. Used to trim padding zeroes. | +| header | [bytes](#bytes) | | Chunk of a parent header. | + + ### Message Header.Split @@ -928,8 +1086,8 @@ must be within the same container. ### Message Object Object structure. Object is immutable and content-addressed. It means -`ObjectID` will change if the header or the payload changes. It's calculated as a -hash of header field which contains hash of the object's payload. +`ObjectID` will change if the header or the payload changes. It's calculated +as a hash of header field which contains hash of the object's payload. For non-regular object types payload format depends on object type specified in the header. @@ -965,8 +1123,8 @@ Short header fields ### Message SplitInfo Meta information of split hierarchy for object assembly. With the last part one can traverse linked list of split hierarchy back to the first part and -assemble the original object. With a linking object one can assemble an object -right from the object parts. +assemble the original object. With a linking object one can assemble an +object right from the object parts. | Field | Type | Label | Description | @@ -997,20 +1155,18 @@ Type of match expression ### ObjectType Type of the object payload content. Only `REGULAR` type objects can be split, -hence `TOMBSTONE`, `STORAGE_GROUP` and `LOCK` payload is limited by the maximum -object size. +hence `TOMBSTONE` and `LOCK` payload is limited by the +maximum object size. String presentation of object type is the same as definition: * REGULAR * TOMBSTONE -* STORAGE_GROUP * LOCK | Name | Number | Description | | ---- | ------ | ----------- | | REGULAR | 0 | Just a normal object | | TOMBSTONE | 1 | Used internally to identify deleted objects | -| STORAGE_GROUP | 2 | StorageGroup information | | LOCK | 3 | Object lock | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 7d66e5a..d688387 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -3,20 +3,20 @@ ## Table of Contents -- [Protocol Documentation](#protocol-documentation) - - [Table of Contents](#table-of-contents) - - [refs/types.proto](#refstypesproto) - - [Message Address](#message-address) - - [Message Checksum](#message-checksum) - - [Message ContainerID](#message-containerid) - - [Message ObjectID](#message-objectid) - - [Message OwnerID](#message-ownerid) - - [Message Signature](#message-signature) - - [Message SignatureRFC6979](#message-signaturerfc6979) - - [Message Version](#message-version) - - [ChecksumType](#checksumtype) - - [SignatureScheme](#signaturescheme) - - [Scalar Value Types](#scalar-value-types) +- [refs/types.proto](#refs/types.proto) + + - Messages + - [Address](#neo.fs.v2.refs.Address) + - [Checksum](#neo.fs.v2.refs.Checksum) + - [ContainerID](#neo.fs.v2.refs.ContainerID) + - [ObjectID](#neo.fs.v2.refs.ObjectID) + - [OwnerID](#neo.fs.v2.refs.OwnerID) + - [Signature](#neo.fs.v2.refs.Signature) + - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) + - [Version](#neo.fs.v2.refs.Version) + + +- [Scalar Value Types](#scalar-value-types) @@ -95,8 +95,8 @@ It means `ObjectID` will change if the `header` or the `payload` changes. `ObjectID` is a 32 byte long [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of -the object's `header` field, which, in it's turn, contains the hash of the object's -payload. +the object's `header` field, which, in it's turn, contains the hash of the +object's payload. String presentation is a [base58](https://tools.ietf.org/html/draft-msporny-base58-02) encoded string. @@ -169,7 +169,8 @@ RFC 6979 signature. API version used by a node. String presentation is a Semantic Versioning 2.0.0 compatible version string -with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor number. +with 'v' prefix. i.e. `vX.Y`, where `X` is the major number, `Y` is the minor +number. | Field | Type | Label | Description | @@ -196,7 +197,8 @@ Checksum algorithm type. ### SignatureScheme -Signature scheme describes digital signing scheme used for (key, signature) pair. +Signature scheme describes digital signing scheme used for (key, signature) +pair. | Name | Number | Description | | ---- | ------ | ----------- | diff --git a/proto-docs/session.md b/proto-docs/session.md index facb292..0c4cb8e 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -278,15 +278,15 @@ Lifetime parameters of the token. Field names taken from rfc7519. ### Message XHeader -Extended headers for Request/Response. They may contain any user-defined headers -to be interpreted on application level. +Extended headers for Request/Response. They may contain any user-defined +headers to be interpreted on application level. -Key name must be a unique valid UTF-8 string. Value can't be empty. Requests or -Responses with duplicated header names or headers with empty values will be -considered invalid. +Key name must be a unique valid UTF-8 string. Value can't be empty. Requests +or Responses with duplicated header names or headers with empty values will +be considered invalid. -There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` is deprecated) prefix that -affect system behaviour: +There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__` +is deprecated) prefix that affect system behaviour: * [ __SYSTEM__NETMAP_EPOCH ] \ (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -297,8 +297,8 @@ affect system behaviour: (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \ If object can't be found using current epoch's netmap, this header limits how many past epochs the node can look up through. The `value` is string - encoded `uint64` in decimal presentation. If set to '0' or not set, only the - current epoch will be used. + encoded `uint64` in decimal presentation. If set to '0' or not set, only + the current epoch will be used. | Field | Type | Label | Description | diff --git a/proto-docs/status.md b/proto-docs/status.md index b426326..d809daf 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -102,6 +102,7 @@ Section of statuses for container-related operations. | ---- | ------ | ----------- | | CONTAINER_NOT_FOUND | 0 | [**3072**] Container not found. | | EACL_NOT_FOUND | 1 | [**3073**] eACL table not found. | +| CONTAINER_ACCESS_DENIED | 2 | [**3074**] Container access denied. | diff --git a/status/types.proto b/status/types.proto index 60dfd94..52a7214 100644 --- a/status/types.proto +++ b/status/types.proto @@ -133,6 +133,9 @@ enum Container { // [**3073**] eACL table not found. EACL_NOT_FOUND = 1; + + // [**3074**] Container access denied. + CONTAINER_ACCESS_DENIED = 2; } // Section of statuses for session-related operations. From 433b2e6a47163bebec6c84cda86a0271e20b06fa Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 26 Mar 2024 18:59:45 +0300 Subject: [PATCH 401/440] [#42] netmap: Renumerate Replica message fields * Reassign ec_data_count and ec_parity_count to 3 and 4. Signed-off-by: Airat Arifullin --- netmap/types.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index 926c4bc..2180869 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -105,10 +105,10 @@ message Replica { string selector = 2 [ json_name = "selector" ]; // Data shards count - uint32 ec_data_count = 6 [ json_name = "ecDataCount" ]; + uint32 ec_data_count = 3 [ json_name = "ecDataCount" ]; // Parity shards count - uint32 ec_parity_count = 7 [ json_name = "ecParityCount" ]; + uint32 ec_parity_count = 4 [ json_name = "ecParityCount" ]; } // Set of rules to select a subset of nodes from `NetworkMap` able to store From 4bae9dd78abcf1a358a65a45fe7303e37fd98099 Mon Sep 17 00:00:00 2001 From: Artem Tataurov Date: Wed, 3 Apr 2024 11:21:40 +0300 Subject: [PATCH 402/440] [#43] Improve table of contents in proto documentation template Signed-off-by: Artem Tataurov --- .github/markdown.tmpl | 6 +-- proto-docs/accounting.md | 14 +++--- proto-docs/acl.md | 14 +++--- proto-docs/audit.md | 2 +- proto-docs/container.md | 66 +++++++++++++-------------- proto-docs/lock.md | 2 +- proto-docs/netmap.md | 48 ++++++++++---------- proto-docs/object.md | 96 ++++++++++++++++++++-------------------- proto-docs/refs.md | 16 +++---- proto-docs/session.md | 34 +++++++------- proto-docs/status.md | 4 +- proto-docs/tombstone.md | 2 +- 12 files changed, 152 insertions(+), 152 deletions(-) diff --git a/.github/markdown.tmpl b/.github/markdown.tmpl index f945c13..2d6c57b 100644 --- a/.github/markdown.tmpl +++ b/.github/markdown.tmpl @@ -4,11 +4,11 @@ ## Table of Contents {{range .Files}} {{$file_name := .Name}}- [{{.Name}}](#{{.Name}}) -{{if .Services}} - Services - {{range .Services}}- [{{.Name}}](#{{.FullName}}) +{{if .Services}} - Services + {{range .Services}} - [{{.Name}}](#{{.FullName}}) {{end}}{{end}} {{if .Messages}} - Messages - {{range .Messages}}- [{{.LongName}}](#{{.FullName}}) + {{range .Messages}} - [{{.LongName}}](#{{.FullName}}) {{end}}{{end}} {{end}} - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index 9ed7186..a23a63c 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -4,20 +4,20 @@ ## Table of Contents - [accounting/service.proto](#accounting/service.proto) - - Services - - [AccountingService](#neo.fs.v2.accounting.AccountingService) + - Services + - [AccountingService](#neo.fs.v2.accounting.AccountingService) - Messages - - [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) - - [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) - - [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) - - [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) + - [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) + - [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) + - [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) + - [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) - [accounting/types.proto](#accounting/types.proto) - Messages - - [Decimal](#neo.fs.v2.accounting.Decimal) + - [Decimal](#neo.fs.v2.accounting.Decimal) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 69d1d3d..91fd36b 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -6,13 +6,13 @@ - [acl/types.proto](#acl/types.proto) - Messages - - [BearerToken](#neo.fs.v2.acl.BearerToken) - - [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) - - [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) - - [EACLRecord](#neo.fs.v2.acl.EACLRecord) - - [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) - - [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) - - [EACLTable](#neo.fs.v2.acl.EACLTable) + - [BearerToken](#neo.fs.v2.acl.BearerToken) + - [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) + - [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) + - [EACLRecord](#neo.fs.v2.acl.EACLRecord) + - [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) + - [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) + - [EACLTable](#neo.fs.v2.acl.EACLTable) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/audit.md b/proto-docs/audit.md index b8d2010..99bcfc8 100644 --- a/proto-docs/audit.md +++ b/proto-docs/audit.md @@ -6,7 +6,7 @@ - [audit/types.proto](#audit/types.proto) - Messages - - [DataAuditResult](#neo.fs.v2.audit.DataAuditResult) + - [DataAuditResult](#neo.fs.v2.audit.DataAuditResult) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/container.md b/proto-docs/container.md index 024057f..b568eed 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -4,46 +4,46 @@ ## Table of Contents - [container/service.proto](#container/service.proto) - - Services - - [ContainerService](#neo.fs.v2.container.ContainerService) + - Services + - [ContainerService](#neo.fs.v2.container.ContainerService) - Messages - - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) - - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) - - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) - - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) - - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) - - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) - - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) - - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) - - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) - - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) - - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) - - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) - - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) - - [GetRequest](#neo.fs.v2.container.GetRequest) - - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) - - [GetResponse](#neo.fs.v2.container.GetResponse) - - [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) - - [ListRequest](#neo.fs.v2.container.ListRequest) - - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) - - [ListResponse](#neo.fs.v2.container.ListResponse) - - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) - - [PutRequest](#neo.fs.v2.container.PutRequest) - - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) - - [PutResponse](#neo.fs.v2.container.PutResponse) - - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) - - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) - - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) - - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) - - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) + - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) + - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) + - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) + - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) + - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) + - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) + - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) + - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) + - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) + - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) + - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) + - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) + - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) + - [GetRequest](#neo.fs.v2.container.GetRequest) + - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) + - [GetResponse](#neo.fs.v2.container.GetResponse) + - [GetResponse.Body](#neo.fs.v2.container.GetResponse.Body) + - [ListRequest](#neo.fs.v2.container.ListRequest) + - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) + - [ListResponse](#neo.fs.v2.container.ListResponse) + - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) + - [PutRequest](#neo.fs.v2.container.PutRequest) + - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) + - [PutResponse](#neo.fs.v2.container.PutResponse) + - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) + - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) + - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) + - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) + - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) - [container/types.proto](#container/types.proto) - Messages - - [Container](#neo.fs.v2.container.Container) - - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) + - [Container](#neo.fs.v2.container.Container) + - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/lock.md b/proto-docs/lock.md index 2e730f8..ae74c5b 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -6,7 +6,7 @@ - [lock/types.proto](#lock/types.proto) - Messages - - [Lock](#neo.fs.v2.lock.Lock) + - [Lock](#neo.fs.v2.lock.Lock) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index 45fd764..fb4eccb 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -4,37 +4,37 @@ ## Table of Contents - [netmap/service.proto](#netmap/service.proto) - - Services - - [NetmapService](#neo.fs.v2.netmap.NetmapService) + - Services + - [NetmapService](#neo.fs.v2.netmap.NetmapService) - Messages - - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) - - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) - - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) - - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) - - [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) - - [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) - - [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) - - [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) - - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) - - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) - - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) - - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) + - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) + - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) + - [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) + - [LocalNodeInfoResponse.Body](#neo.fs.v2.netmap.LocalNodeInfoResponse.Body) + - [NetmapSnapshotRequest](#neo.fs.v2.netmap.NetmapSnapshotRequest) + - [NetmapSnapshotRequest.Body](#neo.fs.v2.netmap.NetmapSnapshotRequest.Body) + - [NetmapSnapshotResponse](#neo.fs.v2.netmap.NetmapSnapshotResponse) + - [NetmapSnapshotResponse.Body](#neo.fs.v2.netmap.NetmapSnapshotResponse.Body) + - [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) + - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) + - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) + - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) - [netmap/types.proto](#netmap/types.proto) - Messages - - [Filter](#neo.fs.v2.netmap.Filter) - - [Netmap](#neo.fs.v2.netmap.Netmap) - - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) - - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) - - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) - - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) - - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) - - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) - - [Replica](#neo.fs.v2.netmap.Replica) - - [Selector](#neo.fs.v2.netmap.Selector) + - [Filter](#neo.fs.v2.netmap.Filter) + - [Netmap](#neo.fs.v2.netmap.Netmap) + - [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) + - [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) + - [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo) + - [NodeInfo](#neo.fs.v2.netmap.NodeInfo) + - [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) + - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) + - [Replica](#neo.fs.v2.netmap.Replica) + - [Selector](#neo.fs.v2.netmap.Selector) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/object.md b/proto-docs/object.md index f080e4a..9fe88a5 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -4,61 +4,61 @@ ## Table of Contents - [object/service.proto](#object/service.proto) - - Services - - [ObjectService](#neo.fs.v2.object.ObjectService) + - Services + - [ObjectService](#neo.fs.v2.object.ObjectService) - Messages - - [DeleteRequest](#neo.fs.v2.object.DeleteRequest) - - [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) - - [DeleteResponse](#neo.fs.v2.object.DeleteResponse) - - [DeleteResponse.Body](#neo.fs.v2.object.DeleteResponse.Body) - - [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) - - [GetRangeHashRequest.Body](#neo.fs.v2.object.GetRangeHashRequest.Body) - - [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) - - [GetRangeHashResponse.Body](#neo.fs.v2.object.GetRangeHashResponse.Body) - - [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) - - [GetRangeRequest.Body](#neo.fs.v2.object.GetRangeRequest.Body) - - [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) - - [GetRangeResponse.Body](#neo.fs.v2.object.GetRangeResponse.Body) - - [GetRequest](#neo.fs.v2.object.GetRequest) - - [GetRequest.Body](#neo.fs.v2.object.GetRequest.Body) - - [GetResponse](#neo.fs.v2.object.GetResponse) - - [GetResponse.Body](#neo.fs.v2.object.GetResponse.Body) - - [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) - - [HeadRequest](#neo.fs.v2.object.HeadRequest) - - [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) - - [HeadResponse](#neo.fs.v2.object.HeadResponse) - - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) - - [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) - - [PutRequest](#neo.fs.v2.object.PutRequest) - - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) - - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) - - [PutResponse](#neo.fs.v2.object.PutResponse) - - [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) - - [PutSingleRequest](#neo.fs.v2.object.PutSingleRequest) - - [PutSingleRequest.Body](#neo.fs.v2.object.PutSingleRequest.Body) - - [PutSingleResponse](#neo.fs.v2.object.PutSingleResponse) - - [PutSingleResponse.Body](#neo.fs.v2.object.PutSingleResponse.Body) - - [Range](#neo.fs.v2.object.Range) - - [SearchRequest](#neo.fs.v2.object.SearchRequest) - - [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) - - [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) - - [SearchResponse](#neo.fs.v2.object.SearchResponse) - - [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) + - [DeleteRequest](#neo.fs.v2.object.DeleteRequest) + - [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) + - [DeleteResponse](#neo.fs.v2.object.DeleteResponse) + - [DeleteResponse.Body](#neo.fs.v2.object.DeleteResponse.Body) + - [GetRangeHashRequest](#neo.fs.v2.object.GetRangeHashRequest) + - [GetRangeHashRequest.Body](#neo.fs.v2.object.GetRangeHashRequest.Body) + - [GetRangeHashResponse](#neo.fs.v2.object.GetRangeHashResponse) + - [GetRangeHashResponse.Body](#neo.fs.v2.object.GetRangeHashResponse.Body) + - [GetRangeRequest](#neo.fs.v2.object.GetRangeRequest) + - [GetRangeRequest.Body](#neo.fs.v2.object.GetRangeRequest.Body) + - [GetRangeResponse](#neo.fs.v2.object.GetRangeResponse) + - [GetRangeResponse.Body](#neo.fs.v2.object.GetRangeResponse.Body) + - [GetRequest](#neo.fs.v2.object.GetRequest) + - [GetRequest.Body](#neo.fs.v2.object.GetRequest.Body) + - [GetResponse](#neo.fs.v2.object.GetResponse) + - [GetResponse.Body](#neo.fs.v2.object.GetResponse.Body) + - [GetResponse.Body.Init](#neo.fs.v2.object.GetResponse.Body.Init) + - [HeadRequest](#neo.fs.v2.object.HeadRequest) + - [HeadRequest.Body](#neo.fs.v2.object.HeadRequest.Body) + - [HeadResponse](#neo.fs.v2.object.HeadResponse) + - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) + - [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) + - [PutRequest](#neo.fs.v2.object.PutRequest) + - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) + - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) + - [PutResponse](#neo.fs.v2.object.PutResponse) + - [PutResponse.Body](#neo.fs.v2.object.PutResponse.Body) + - [PutSingleRequest](#neo.fs.v2.object.PutSingleRequest) + - [PutSingleRequest.Body](#neo.fs.v2.object.PutSingleRequest.Body) + - [PutSingleResponse](#neo.fs.v2.object.PutSingleResponse) + - [PutSingleResponse.Body](#neo.fs.v2.object.PutSingleResponse.Body) + - [Range](#neo.fs.v2.object.Range) + - [SearchRequest](#neo.fs.v2.object.SearchRequest) + - [SearchRequest.Body](#neo.fs.v2.object.SearchRequest.Body) + - [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) + - [SearchResponse](#neo.fs.v2.object.SearchResponse) + - [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) - [object/types.proto](#object/types.proto) - Messages - - [ECInfo](#neo.fs.v2.object.ECInfo) - - [ECInfo.Chunk](#neo.fs.v2.object.ECInfo.Chunk) - - [Header](#neo.fs.v2.object.Header) - - [Header.Attribute](#neo.fs.v2.object.Header.Attribute) - - [Header.EC](#neo.fs.v2.object.Header.EC) - - [Header.Split](#neo.fs.v2.object.Header.Split) - - [Object](#neo.fs.v2.object.Object) - - [ShortHeader](#neo.fs.v2.object.ShortHeader) - - [SplitInfo](#neo.fs.v2.object.SplitInfo) + - [ECInfo](#neo.fs.v2.object.ECInfo) + - [ECInfo.Chunk](#neo.fs.v2.object.ECInfo.Chunk) + - [Header](#neo.fs.v2.object.Header) + - [Header.Attribute](#neo.fs.v2.object.Header.Attribute) + - [Header.EC](#neo.fs.v2.object.Header.EC) + - [Header.Split](#neo.fs.v2.object.Header.Split) + - [Object](#neo.fs.v2.object.Object) + - [ShortHeader](#neo.fs.v2.object.ShortHeader) + - [SplitInfo](#neo.fs.v2.object.SplitInfo) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/refs.md b/proto-docs/refs.md index d688387..e27d4ba 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -6,14 +6,14 @@ - [refs/types.proto](#refs/types.proto) - Messages - - [Address](#neo.fs.v2.refs.Address) - - [Checksum](#neo.fs.v2.refs.Checksum) - - [ContainerID](#neo.fs.v2.refs.ContainerID) - - [ObjectID](#neo.fs.v2.refs.ObjectID) - - [OwnerID](#neo.fs.v2.refs.OwnerID) - - [Signature](#neo.fs.v2.refs.Signature) - - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) - - [Version](#neo.fs.v2.refs.Version) + - [Address](#neo.fs.v2.refs.Address) + - [Checksum](#neo.fs.v2.refs.Checksum) + - [ContainerID](#neo.fs.v2.refs.ContainerID) + - [ObjectID](#neo.fs.v2.refs.ObjectID) + - [OwnerID](#neo.fs.v2.refs.OwnerID) + - [Signature](#neo.fs.v2.refs.Signature) + - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) + - [Version](#neo.fs.v2.refs.Version) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/session.md b/proto-docs/session.md index 0c4cb8e..40088d1 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -4,30 +4,30 @@ ## Table of Contents - [session/service.proto](#session/service.proto) - - Services - - [SessionService](#neo.fs.v2.session.SessionService) + - Services + - [SessionService](#neo.fs.v2.session.SessionService) - Messages - - [CreateRequest](#neo.fs.v2.session.CreateRequest) - - [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) - - [CreateResponse](#neo.fs.v2.session.CreateResponse) - - [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) + - [CreateRequest](#neo.fs.v2.session.CreateRequest) + - [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) + - [CreateResponse](#neo.fs.v2.session.CreateResponse) + - [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) - [session/types.proto](#session/types.proto) - Messages - - [ContainerSessionContext](#neo.fs.v2.session.ContainerSessionContext) - - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) - - [ObjectSessionContext.Target](#neo.fs.v2.session.ObjectSessionContext.Target) - - [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) - - [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) - - [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) - - [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) - - [SessionToken](#neo.fs.v2.session.SessionToken) - - [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) - - [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) - - [XHeader](#neo.fs.v2.session.XHeader) + - [ContainerSessionContext](#neo.fs.v2.session.ContainerSessionContext) + - [ObjectSessionContext](#neo.fs.v2.session.ObjectSessionContext) + - [ObjectSessionContext.Target](#neo.fs.v2.session.ObjectSessionContext.Target) + - [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) + - [RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) + - [ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) + - [ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) + - [SessionToken](#neo.fs.v2.session.SessionToken) + - [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) + - [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) + - [XHeader](#neo.fs.v2.session.XHeader) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/status.md b/proto-docs/status.md index d809daf..87d3b41 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -6,8 +6,8 @@ - [status/types.proto](#status/types.proto) - Messages - - [Status](#neo.fs.v2.status.Status) - - [Status.Detail](#neo.fs.v2.status.Status.Detail) + - [Status](#neo.fs.v2.status.Status) + - [Status.Detail](#neo.fs.v2.status.Status.Detail) - [Scalar Value Types](#scalar-value-types) diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 9056ad2..7a7761b 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -6,7 +6,7 @@ - [tombstone/types.proto](#tombstone/types.proto) - Messages - - [Tombstone](#neo.fs.v2.tombstone.Tombstone) + - [Tombstone](#neo.fs.v2.tombstone.Tombstone) - [Scalar Value Types](#scalar-value-types) From 9802fd23ae559d67c72943152565a69e268f6b48 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Sat, 20 Apr 2024 13:42:24 +0300 Subject: [PATCH 403/440] audit: Remove deprecated service Signed-off-by: Evgenii Stratonikov --- audit/types.proto | 59 ----------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 audit/types.proto diff --git a/audit/types.proto b/audit/types.proto deleted file mode 100644 index c5c19ec..0000000 --- a/audit/types.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; - -package neo.fs.v2.audit; - -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/audit/grpc;audit"; -option csharp_namespace = "Neo.FileStorage.API.Audit"; - -import "refs/types.proto"; - -// DataAuditResult keeps record of conducted Data Audits. The detailed report is -// generated separately. -message DataAuditResult { - // Data Audit Result format version. Effectively, the version of API library - // used to report DataAuditResult structure. - neo.fs.v2.refs.Version version = 1 [ json_name = "version" ]; - - // Epoch number when the Data Audit was conducted - fixed64 audit_epoch = 2 [ json_name = "auditEpoch" ]; - - // Container under audit - neo.fs.v2.refs.ContainerID container_id = 3 [ json_name = "containerID" ]; - - // Public key of the auditing InnerRing node in a binary format - bytes public_key = 4 [ json_name = "publicKey" ]; - - // Shows if Data Audit process was complete in time or if it was cancelled - bool complete = 5 [ json_name = "complete" ]; - - // Number of request done at PoR stage - uint32 requests = 6 [ json_name = "requests" ]; - - // Number of retries done at PoR stage - uint32 retries = 7 [ json_name = "retries" ]; - - // List of Storage Groups that passed audit PoR stage - repeated neo.fs.v2.refs.ObjectID pass_sg = 8 [ json_name = "passSG" ]; - - // List of Storage Groups that failed audit PoR stage - repeated neo.fs.v2.refs.ObjectID fail_sg = 9 [ json_name = "failSG" ]; - - // Number of sampled objects under the audit placed in an optimal way - // according to the containers placement policy when checking PoP - uint32 hit = 10 [ json_name = "hit" ]; - - // Number of sampled objects under the audit placed in suboptimal way - // according to the containers placement policy, but still at a satisfactory - // level when checking PoP - uint32 miss = 11 [ json_name = "miss" ]; - - // Number of sampled objects under the audit stored inconsistently with the - // placement policy or not found at all when checking PoP - uint32 fail = 12 [ json_name = "fail" ]; - - // List of storage node public keys that passed at least one PDP - repeated bytes pass_nodes = 13 [ json_name = "passNodes" ]; - - // List of storage node public keys that failed at least one PDP - repeated bytes fail_nodes = 14 [ json_name = "failNodes" ]; -} From c94b8ab6aed6698a62f5efd4875ec3bef061440a Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 23 Apr 2024 22:18:22 +0300 Subject: [PATCH 404/440] [#46] apemanager: Introduce proto-s for apemanager service * Introduce proto-s for `APEManagerService` and related types. * Introduce a new status section related to `APEManagerService`. * Generate proto-docs. Signed-off-by: Airat Arifullin --- apemanager/service.proto | 171 ++++++++++++++++++++ apemanager/types.proto | 33 ++++ proto-docs/apemanager.md | 329 +++++++++++++++++++++++++++++++++++++++ proto-docs/status.md | 12 ++ status/types.proto | 9 ++ 5 files changed, 554 insertions(+) create mode 100644 apemanager/service.proto create mode 100644 apemanager/types.proto create mode 100644 proto-docs/apemanager.md diff --git a/apemanager/service.proto b/apemanager/service.proto new file mode 100644 index 0000000..6b9da60 --- /dev/null +++ b/apemanager/service.proto @@ -0,0 +1,171 @@ +syntax = "proto3"; + +package frostfs.v2.apemanager; + +import "apemanager/types.proto"; +import "session/types.proto"; + +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; + +// `APEManagerService` provides API to manage rule chains within sidechain's +// `Policy` smart contract. +service APEManagerService { + // Add a rule chain for a specific target to `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully added; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + rpc AddChain(AddChainRequest) returns (AddChainResponse); + + // Remove a rule chain for a specific target from `Policy` smart contract. + // RemoveChain is an idempotent operation: removal of non-existing rule chain + // also means success. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // the chain has been successfully removed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + rpc RemoveChain(RemoveChainRequest) returns (RemoveChainResponse); + + // List chains defined for a specific target from `Policy` smart contract. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // chains have been successfully listed; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // container (as target) not found; + // - **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + // the operation is denied by the service. + rpc ListChains(ListChainsRequest) returns (ListChainsResponse); +} + +message AddChainRequest { + message Body { + // A target for which a rule chain is added. + ChainTarget target = 1; + + // The chain to set for the target. + Chain chain = 2; + } + + // The request's body. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +message AddChainResponse { + message Body { + // Chain ID assigned for the added rule chain. + // If chain ID is left empty in the request, then + // it will be generated. + bytes chain_id = 1; + } + + // The response's body. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} + +message RemoveChainRequest { + message Body { + // Target for which a rule chain is removed. + ChainTarget target = 1; + + // Chain ID assigned for the rule chain. + bytes chain_id = 2; + } + + // The request's body. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +message RemoveChainResponse { + // Since RemoveChain is an idempotent operation, then the only indicator that + // operation could not be performed is an error returning to a client. + message Body {} + + // The response's body. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} + +message ListChainsRequest { + message Body { + // Target for which rule chains are listed. + ChainTarget target = 1; + } + + // The request's body. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +message ListChainsResponse { + message Body { + // The list of chains defined for the reqeusted target. + repeated Chain chains = 1; + } + + // The response's body. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} \ No newline at end of file diff --git a/apemanager/types.proto b/apemanager/types.proto new file mode 100644 index 0000000..c064627 --- /dev/null +++ b/apemanager/types.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package frostfs.v2.apemanager; + +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; + +// TargetType is a type target to which a rule chain is defined. +enum TargetType { + UNDEFINED = 0; + + NAMESPACE = 1; + + CONTAINER = 2; + + USER = 3; + + GROUP = 4; +} + +// ChainTarget is an object to which a rule chain is defined. +message ChainTarget { + TargetType type = 1; + + string name = 2; +} + +// Chain is a chain of rules defined for a specific target. +message Chain { + oneof kind { + // Raw representation of a serizalized rule chain. + bytes raw = 1; + } +} diff --git a/proto-docs/apemanager.md b/proto-docs/apemanager.md new file mode 100644 index 0000000..303f7f1 --- /dev/null +++ b/proto-docs/apemanager.md @@ -0,0 +1,329 @@ +# Protocol Documentation + + +## Table of Contents + +- [apemanager/service.proto](#apemanager/service.proto) + - Services + - [APEManagerService](#frostfs.v2.apemanager.APEManagerService) + + - Messages + - [AddChainRequest](#frostfs.v2.apemanager.AddChainRequest) + - [AddChainRequest.Body](#frostfs.v2.apemanager.AddChainRequest.Body) + - [AddChainResponse](#frostfs.v2.apemanager.AddChainResponse) + - [AddChainResponse.Body](#frostfs.v2.apemanager.AddChainResponse.Body) + - [ListChainsRequest](#frostfs.v2.apemanager.ListChainsRequest) + - [ListChainsRequest.Body](#frostfs.v2.apemanager.ListChainsRequest.Body) + - [ListChainsResponse](#frostfs.v2.apemanager.ListChainsResponse) + - [ListChainsResponse.Body](#frostfs.v2.apemanager.ListChainsResponse.Body) + - [RemoveChainRequest](#frostfs.v2.apemanager.RemoveChainRequest) + - [RemoveChainRequest.Body](#frostfs.v2.apemanager.RemoveChainRequest.Body) + - [RemoveChainResponse](#frostfs.v2.apemanager.RemoveChainResponse) + - [RemoveChainResponse.Body](#frostfs.v2.apemanager.RemoveChainResponse.Body) + + +- [apemanager/types.proto](#apemanager/types.proto) + + - Messages + - [Chain](#frostfs.v2.apemanager.Chain) + - [ChainTarget](#frostfs.v2.apemanager.ChainTarget) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## apemanager/service.proto + + + + + + +### Service "frostfs.v2.apemanager.APEManagerService" +`APEManagerService` provides API to manage rule chains within sidechain's +`Policy` smart contract. + +``` +rpc AddChain(AddChainRequest) returns (AddChainResponse); +rpc RemoveChain(RemoveChainRequest) returns (RemoveChainResponse); +rpc ListChains(ListChainsRequest) returns (ListChainsResponse); + +``` + +#### Method AddChain + +Add a rule chain for a specific target to `Policy` smart contract. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + the chain has been successfully added; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + container (as target) not found; +- **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + the operation is denied by the service. + +| Name | Input | Output | +| ---- | ----- | ------ | +| AddChain | [AddChainRequest](#frostfs.v2.apemanager.AddChainRequest) | [AddChainResponse](#frostfs.v2.apemanager.AddChainResponse) | +#### Method RemoveChain + +Remove a rule chain for a specific target from `Policy` smart contract. +RemoveChain is an idempotent operation: removal of non-existing rule chain +also means success. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + the chain has been successfully removed; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + container (as target) not found; +- **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + the operation is denied by the service. + +| Name | Input | Output | +| ---- | ----- | ------ | +| RemoveChain | [RemoveChainRequest](#frostfs.v2.apemanager.RemoveChainRequest) | [RemoveChainResponse](#frostfs.v2.apemanager.RemoveChainResponse) | +#### Method ListChains + +List chains defined for a specific target from `Policy` smart contract. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + chains have been successfully listed; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + container (as target) not found; +- **APE_MANAGER_ACCESS_DENIED** (5120, SECTION_APE_MANAGER): \ + the operation is denied by the service. + +| Name | Input | Output | +| ---- | ----- | ------ | +| ListChains | [ListChainsRequest](#frostfs.v2.apemanager.ListChainsRequest) | [ListChainsResponse](#frostfs.v2.apemanager.ListChainsResponse) | + + + + + +### Message AddChainRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AddChainRequest.Body](#frostfs.v2.apemanager.AddChainRequest.Body) | | The request's body. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AddChainRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | A target for which a rule chain is added. | +| chain | [Chain](#frostfs.v2.apemanager.Chain) | | The chain to set for the target. | + + + + +### Message AddChainResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [AddChainResponse.Body](#frostfs.v2.apemanager.AddChainResponse.Body) | | The response's body. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message AddChainResponse.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| chain_id | [bytes](#bytes) | | Chain ID assigned for the added rule chain. If chain ID is left empty in the request, then it will be generated. | + + + + +### Message ListChainsRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListChainsRequest.Body](#frostfs.v2.apemanager.ListChainsRequest.Body) | | The request's body. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListChainsRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | Target for which rule chains are listed. | + + + + +### Message ListChainsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListChainsResponse.Body](#frostfs.v2.apemanager.ListChainsResponse.Body) | | The response's body. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListChainsResponse.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| chains | [Chain](#frostfs.v2.apemanager.Chain) | repeated | The list of chains defined for the reqeusted target. | + + + + +### Message RemoveChainRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [RemoveChainRequest.Body](#frostfs.v2.apemanager.RemoveChainRequest.Body) | | The request's body. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message RemoveChainRequest.Body + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | Target for which a rule chain is removed. | +| chain_id | [bytes](#bytes) | | Chain ID assigned for the rule chain. | + + + + +### Message RemoveChainResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [RemoveChainResponse.Body](#frostfs.v2.apemanager.RemoveChainResponse.Body) | | The response's body. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message RemoveChainResponse.Body +Since RemoveChain is an idempotent operation, then the only indicator that +operation could not be performed is an error returning to a client. + + + + + + + + + +

Top

+ +## apemanager/types.proto + + + + + + + +### Message Chain +Chain is a chain of rules defined for a specific target. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| raw | [bytes](#bytes) | | Raw representation of a serizalized rule chain. | + + + + +### Message ChainTarget +ChainTarget is an object to which a rule chain is defined. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [TargetType](#frostfs.v2.apemanager.TargetType) | | | +| name | [string](#string) | | | + + + + + + +### TargetType +TargetType is a type target to which a rule chain is defined. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| UNDEFINED | 0 | | +| NAMESPACE | 1 | | +| CONTAINER | 2 | | +| USER | 3 | | +| GROUP | 4 | | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/status.md b/proto-docs/status.md index 87d3b41..c1401bd 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -79,6 +79,17 @@ covered by the code. + + +### APEManager +Section of status for APE manager related operations. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| APE_MANAGER_ACCESS_DENIED | 0 | [**5120**] The operation is denied by APE manager. | + + + ### CommonFail @@ -134,6 +145,7 @@ Section identifiers. | SECTION_OBJECT | 2 | Object service-specific errors. | | SECTION_CONTAINER | 3 | Container service-specific errors. | | SECTION_SESSION | 4 | Session service-specific errors. | +| SECTION_APE_MANAGER | 5 | Session service-specific errors. | diff --git a/status/types.proto b/status/types.proto index 52a7214..2205abc 100644 --- a/status/types.proto +++ b/status/types.proto @@ -73,6 +73,9 @@ enum Section { // Session service-specific errors. SECTION_SESSION = 4; + + // Session service-specific errors. + SECTION_APE_MANAGER = 5; } // Section of NeoFS successful return codes. @@ -146,3 +149,9 @@ enum Session { // [**4097**] Token has expired. TOKEN_EXPIRED = 1; } + +// Section of status for APE manager related operations. +enum APEManager { + // [**5120**] The operation is denied by APE manager. + APE_MANAGER_ACCESS_DENIED = 0; +} \ No newline at end of file From b182533828a3f7ccd1d54b72e0e6f2cee5126002 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Fri, 3 May 2024 12:08:33 +0300 Subject: [PATCH 405/440] [#47] object: Specify ec_parent attribute for Object.Search * Add $Object:ec.parent attribute to Object.Search specification. * Update docs for Object. Signed-off-by: Airat Arifullin --- object/service.proto | 3 +++ proto-docs/object.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/object/service.proto b/object/service.proto index bbf0fc3..1168e4e 100644 --- a/object/service.proto +++ b/object/service.proto @@ -583,6 +583,9 @@ message SearchRequest { // object_id of parent // * $Object:split.splitID \ // 16 byte UUIDv4 used to identify the split object hierarchy parts + // * $Object:ec.parent \ + // If the object is stored according to EC policy, then ec_parent attribute + // is set to return an id list of all related EC chunks. // // There are some well-known filter aliases to match objects by certain // properties: diff --git a/proto-docs/object.md b/proto-docs/object.md index 9fe88a5..9c51c98 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -875,6 +875,9 @@ prefix to the name. Here is the list of fields available via this prefix: object_id of parent * $Object:split.splitID \ 16 byte UUIDv4 used to identify the split object hierarchy parts +* $Object:ec.parent \ + If the object is stored according to EC policy, then ec_parent attribute + is set to return an id list of all related EC chunks. There are some well-known filter aliases to match objects by certain properties: From cfb148ea0c55f7d497292730f6a0ffc904d11a86 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Wed, 8 May 2024 13:07:33 +0300 Subject: [PATCH 406/440] [#48] object: Introduce `parent_split_id` and `parent_index` for `EC` * Introduce new fields for `EC`-header for `Object` service; * Regenerate docs. Signed-off-by: Airat Arifullin --- object/types.proto | 6 ++++++ proto-docs/object.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/object/types.proto b/object/types.proto index 5b02365..70cd948 100644 --- a/object/types.proto +++ b/object/types.proto @@ -208,6 +208,12 @@ message Header { uint32 header_length = 4 [ json_name = "headerLength" ]; // Chunk of a parent header. bytes header = 5 [ json_name = "header" ]; + // As the origin object is EC-splitted its identifier is known to all + // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). + // In this case parent_split_id should be set. + bytes parent_split_id = 6 [ json_name = "parentSplitID" ]; + // Parent's index in Split. + uint32 parent_split_index = 7 [ json_name = "parentSplitIndex" ]; } // Erasure code chunk information. EC ec = 12 [ json_name = "ec" ]; diff --git a/proto-docs/object.md b/proto-docs/object.md index 9c51c98..9e0e271 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -1064,6 +1064,8 @@ All objects belonging to a single EC group have the same `parent` field. | total | [uint32](#uint32) | | Total number of chunks in this split. | | header_length | [uint32](#uint32) | | Total length of a parent header. Used to trim padding zeroes. | | header | [bytes](#bytes) | | Chunk of a parent header. | +| parent_split_id | [bytes](#bytes) | | As the origin object is EC-splitted its identifier is known to all chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). In this case parent_split_id should be set. | +| parent_split_index | [uint32](#uint32) | | Parent's index in Split. | From fd316479e2bc16c1582b8059c8eb778738d4d8a0 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 16 May 2024 11:38:58 +0300 Subject: [PATCH 407/440] [#51] object: Introduce `parentSplitParentID` field in `EC` * Replace `parentSplitIndex` by `parentSplitParentID` as the first one is inappropriate; * Regenerate docs. Signed-off-by: Airat Arifullin --- object/types.proto | 6 ++++-- proto-docs/object.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/object/types.proto b/object/types.proto index 70cd948..7591be7 100644 --- a/object/types.proto +++ b/object/types.proto @@ -212,8 +212,10 @@ message Header { // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). // In this case parent_split_id should be set. bytes parent_split_id = 6 [ json_name = "parentSplitID" ]; - // Parent's index in Split. - uint32 parent_split_index = 7 [ json_name = "parentSplitIndex" ]; + // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and + // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed + // in Split hierarchy. + neo.fs.v2.refs.ObjectID parent_split_parent_id = 7 [ json_name = "parentSplitParentID" ]; } // Erasure code chunk information. EC ec = 12 [ json_name = "ec" ]; diff --git a/proto-docs/object.md b/proto-docs/object.md index 9e0e271..07e3fd0 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -1065,7 +1065,7 @@ All objects belonging to a single EC group have the same `parent` field. | header_length | [uint32](#uint32) | | Total length of a parent header. Used to trim padding zeroes. | | header | [bytes](#bytes) | | Chunk of a parent header. | | parent_split_id | [bytes](#bytes) | | As the origin object is EC-splitted its identifier is known to all chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). In this case parent_split_id should be set. | -| parent_split_index | [uint32](#uint32) | | Parent's index in Split. | +| parent_split_parent_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and if an object ID of its parent is presented.The field allows to determine how EC-chunk is placed in Split hierarchy. | From e199ad2914da26d76ad8966b439b2ff984bcbf99 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 28 May 2024 15:51:02 +0300 Subject: [PATCH 408/440] [#53] proto-docs: Regenerate docs Also, remove obsolete ones. Signed-off-by: Evgenii Stratonikov --- proto-docs/audit.md | 74 ---------------------- proto-docs/bootstrap.md | 89 -------------------------- proto-docs/object.md | 2 +- proto-docs/service.md | 125 ------------------------------------- proto-docs/storagegroup.md | 71 --------------------- 5 files changed, 1 insertion(+), 360 deletions(-) delete mode 100644 proto-docs/audit.md delete mode 100644 proto-docs/bootstrap.md delete mode 100644 proto-docs/service.md delete mode 100644 proto-docs/storagegroup.md diff --git a/proto-docs/audit.md b/proto-docs/audit.md deleted file mode 100644 index 99bcfc8..0000000 --- a/proto-docs/audit.md +++ /dev/null @@ -1,74 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [audit/types.proto](#audit/types.proto) - - - Messages - - [DataAuditResult](#neo.fs.v2.audit.DataAuditResult) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## audit/types.proto - - - - - - - -### Message DataAuditResult -DataAuditResult keeps record of conducted Data Audits. The detailed report is -generated separately. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Data Audit Result format version. Effectively, the version of API library used to report DataAuditResult structure. | -| audit_epoch | [fixed64](#fixed64) | | Epoch number when the Data Audit was conducted | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Container under audit | -| public_key | [bytes](#bytes) | | Public key of the auditing InnerRing node in a binary format | -| complete | [bool](#bool) | | Shows if Data Audit process was complete in time or if it was cancelled | -| requests | [uint32](#uint32) | | Number of request done at PoR stage | -| retries | [uint32](#uint32) | | Number of retries done at PoR stage | -| pass_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that passed audit PoR stage | -| fail_sg | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of Storage Groups that failed audit PoR stage | -| hit | [uint32](#uint32) | | Number of sampled objects under the audit placed in an optimal way according to the containers placement policy when checking PoP | -| miss | [uint32](#uint32) | | Number of sampled objects under the audit placed in suboptimal way according to the containers placement policy, but still at a satisfactory level when checking PoP | -| fail | [uint32](#uint32) | | Number of sampled objects under the audit stored inconsistently with the placement policy or not found at all when checking PoP | -| pass_nodes | [bytes](#bytes) | repeated | List of storage node public keys that passed at least one PDP | -| fail_nodes | [bytes](#bytes) | repeated | List of storage node public keys that failed at least one PDP | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/bootstrap.md b/proto-docs/bootstrap.md deleted file mode 100644 index ad08a7d..0000000 --- a/proto-docs/bootstrap.md +++ /dev/null @@ -1,89 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [bootstrap/types.proto](#bootstrap/types.proto) - - - Messages - - [NodeInfo](#bootstrap.NodeInfo) - - [NodeInfo.Attribute](#bootstrap.NodeInfo.Attribute) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## bootstrap/types.proto - - - - - - - -### Message NodeInfo -Groups the information about the NeoFS node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Address | [string](#string) | | Carries network address of the NeoFS node. | -| PublicKey | [bytes](#bytes) | | Carries public key of the NeoFS node in a binary format. | -| Attributes | [NodeInfo.Attribute](#bootstrap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a string key-value format. | -| state | [NodeInfo.State](#bootstrap.NodeInfo.State) | | Carries state of the NeoFS node. | - - - - -### Message NodeInfo.Attribute -Groups attributes of the NeoFS node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| Key | [string](#string) | | Carries string key to the node attribute. | -| Value | [string](#string) | | Carries string value of the node attribute. | - - - - - - -### NodeInfo.State -Represents the enumeration of various states of the NeoFS node. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| Unknown | 0 | Undefined state. | -| Online | 1 | Active state on the network. | -| Offline | 2 | Network unavailable state. | - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/object.md b/proto-docs/object.md index 07e3fd0..7f53a68 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -1065,7 +1065,7 @@ All objects belonging to a single EC group have the same `parent` field. | header_length | [uint32](#uint32) | | Total length of a parent header. Used to trim padding zeroes. | | header | [bytes](#bytes) | | Chunk of a parent header. | | parent_split_id | [bytes](#bytes) | | As the origin object is EC-splitted its identifier is known to all chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). In this case parent_split_id should be set. | -| parent_split_parent_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and if an object ID of its parent is presented.The field allows to determine how EC-chunk is placed in Split hierarchy. | +| parent_split_parent_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed in Split hierarchy. | diff --git a/proto-docs/service.md b/proto-docs/service.md deleted file mode 100644 index e37ad9f..0000000 --- a/proto-docs/service.md +++ /dev/null @@ -1,125 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [service/types.proto](#service/types.proto) - - - Messages - - [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) - - [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) - - [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) - - [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) - - [XHeader](#neo.fs.v2.service.XHeader) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## service/types.proto - - - - - - - -### Message RequestMetaHeader -Information about the request - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Client API version. | -| epoch | [uint64](#uint64) | | Client local epoch number. Set to 0 if unknown. | -| ttl | [uint32](#uint32) | | Maximum number of nodes in the request route. | -| x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Request X-Headers. | -| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Token is a token of the session within which the request is sent | -| bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | Bearer is a Bearer token of the request | -| origin | [RequestMetaHeader](#neo.fs.v2.service.RequestMetaHeader) | | RequestMetaHeader of the origin request. | - - - - -### Message RequestVerificationHeader -Verification info for request signed by all intermediate nodes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Body signature. Should be generated once by request initiator. | -| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Request Meta signature is added and signed by any intermediate node | -| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | -| origin | [RequestVerificationHeader](#neo.fs.v2.service.RequestVerificationHeader) | | Chain of previous hops signatures | - - - - -### Message ResponseMetaHeader -Information about the response - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Server API version. | -| epoch | [uint64](#uint64) | | Server local epoch number. | -| ttl | [uint32](#uint32) | | Maximum number of nodes in the response route. | -| x_headers | [XHeader](#neo.fs.v2.service.XHeader) | repeated | Response X-Headers. | -| origin | [ResponseMetaHeader](#neo.fs.v2.service.ResponseMetaHeader) | | Carries response meta header of the origin response. | - - - - -### Message ResponseVerificationHeader -Verification info for response signed by all intermediate nodes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Body signature. Should be generated once by answering node. | -| meta_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Response Meta signature is added and signed by any intermediate node | -| origin_signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Sign previous hops | -| origin | [ResponseVerificationHeader](#neo.fs.v2.service.ResponseVerificationHeader) | | Chain of previous hops signatures | - - - - -### Message XHeader -Extended headers for Request/Response - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| key | [string](#string) | | Key of the X-Header. | -| value | [string](#string) | | Value of the X-Header. | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/storagegroup.md b/proto-docs/storagegroup.md deleted file mode 100644 index da765f1..0000000 --- a/proto-docs/storagegroup.md +++ /dev/null @@ -1,71 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [storagegroup/types.proto](#storagegroup/types.proto) - - - Messages - - [StorageGroup](#neo.fs.v2.storagegroup.StorageGroup) - - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## storagegroup/types.proto - - - - - - - -### Message StorageGroup -StorageGroup keeps verification information for Data Audit sessions. Objects -that require paid storage guarantees are gathered in `StorageGroups` with -additional information used for the proof of storage. `StorageGroup` only -contains objects from the same container. - -Being an object payload, StorageGroup may have expiration Epoch set with -`__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) well-known attribute. When expired, StorageGroup -will be ignored by InnerRing nodes during Data Audit cycles and will be -deleted by Storage Nodes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| validation_data_size | [uint64](#uint64) | | Total size of the payloads of objects in the storage group | -| validation_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash from the concatenation of the payloads of the storage group members. The order of concatenation is the same as the order of the members in the `members` field. | -| expiration_epoch | [uint64](#uint64) | | DEPRECATED. Last NeoFS epoch number of the storage group lifetime | -| members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Strictly ordered list of storage group member objects. Members MUST be unique | - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ Type | Java Type | Python Type | -| ----------- | ----- | -------- | --------- | ----------- | -| double | | double | double | float | -| float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | -| sfixed32 | Always four bytes. | int32 | int | int | -| sfixed64 | Always eight bytes. | int64 | long | int/long | -| bool | | bool | boolean | boolean | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - From 393c95899fd91179b2e2d2f93fbc7f8d918847b6 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 27 May 2024 17:44:56 +0300 Subject: [PATCH 409/440] [#54] apemanager: Move APE specific types to separate package * Introduce `ape` package and move `apemanager/types.proto` to `ape/`; * Fix `apemanager/service.proto`. Signed-off-by: Airat Arifullin --- {apemanager => ape}/types.proto | 4 +- apemanager/service.proto | 12 ++--- proto-docs/ape.md | 88 +++++++++++++++++++++++++++++++++ proto-docs/apemanager.md | 69 ++------------------------ 4 files changed, 101 insertions(+), 72 deletions(-) rename {apemanager => ape}/types.proto (89%) create mode 100644 proto-docs/ape.md diff --git a/apemanager/types.proto b/ape/types.proto similarity index 89% rename from apemanager/types.proto rename to ape/types.proto index c064627..3a97e60 100644 --- a/apemanager/types.proto +++ b/ape/types.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package frostfs.v2.apemanager; +package frostfs.v2.ape; -option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; +option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape/grpc;ape"; // TargetType is a type target to which a rule chain is defined. enum TargetType { diff --git a/apemanager/service.proto b/apemanager/service.proto index 6b9da60..7ff23a7 100644 --- a/apemanager/service.proto +++ b/apemanager/service.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package frostfs.v2.apemanager; -import "apemanager/types.proto"; +import "ape/types.proto"; import "session/types.proto"; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager/grpc;apemanager"; @@ -52,10 +52,10 @@ service APEManagerService { message AddChainRequest { message Body { // A target for which a rule chain is added. - ChainTarget target = 1; + frostfs.v2.ape.ChainTarget target = 1; // The chain to set for the target. - Chain chain = 2; + frostfs.v2.ape.Chain chain = 2; } // The request's body. @@ -95,7 +95,7 @@ message AddChainResponse { message RemoveChainRequest { message Body { // Target for which a rule chain is removed. - ChainTarget target = 1; + frostfs.v2.ape.ChainTarget target = 1; // Chain ID assigned for the rule chain. bytes chain_id = 2; @@ -135,7 +135,7 @@ message RemoveChainResponse { message ListChainsRequest { message Body { // Target for which rule chains are listed. - ChainTarget target = 1; + frostfs.v2.ape.ChainTarget target = 1; } // The request's body. @@ -154,7 +154,7 @@ message ListChainsRequest { message ListChainsResponse { message Body { // The list of chains defined for the reqeusted target. - repeated Chain chains = 1; + repeated frostfs.v2.ape.Chain chains = 1; } // The response's body. diff --git a/proto-docs/ape.md b/proto-docs/ape.md new file mode 100644 index 0000000..c4d7157 --- /dev/null +++ b/proto-docs/ape.md @@ -0,0 +1,88 @@ +# Protocol Documentation + + +## Table of Contents + +- [ape/types.proto](#ape/types.proto) + + - Messages + - [Chain](#frostfs.v2.ape.Chain) + - [ChainTarget](#frostfs.v2.ape.ChainTarget) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## ape/types.proto + + + + + + + +### Message Chain +Chain is a chain of rules defined for a specific target. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| raw | [bytes](#bytes) | | Raw representation of a serizalized rule chain. | + + + + +### Message ChainTarget +ChainTarget is an object to which a rule chain is defined. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [TargetType](#frostfs.v2.ape.TargetType) | | | +| name | [string](#string) | | | + + + + + + +### TargetType +TargetType is a type target to which a rule chain is defined. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| UNDEFINED | 0 | | +| NAMESPACE | 1 | | +| CONTAINER | 2 | | +| USER | 3 | | +| GROUP | 4 | | + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/proto-docs/apemanager.md b/proto-docs/apemanager.md index 303f7f1..5d0e2e6 100644 --- a/proto-docs/apemanager.md +++ b/proto-docs/apemanager.md @@ -22,13 +22,6 @@ - [RemoveChainResponse.Body](#frostfs.v2.apemanager.RemoveChainResponse.Body) -- [apemanager/types.proto](#apemanager/types.proto) - - - Messages - - [Chain](#frostfs.v2.apemanager.Chain) - - [ChainTarget](#frostfs.v2.apemanager.ChainTarget) - - - [Scalar Value Types](#scalar-value-types) @@ -128,8 +121,8 @@ Statuses: | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | A target for which a rule chain is added. | -| chain | [Chain](#frostfs.v2.apemanager.Chain) | | The chain to set for the target. | +| target | [frostfs.v2.ape.ChainTarget](#frostfs.v2.ape.ChainTarget) | | A target for which a rule chain is added. | +| chain | [frostfs.v2.ape.Chain](#frostfs.v2.ape.Chain) | | The chain to set for the target. | @@ -177,7 +170,7 @@ Statuses: | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | Target for which rule chains are listed. | +| target | [frostfs.v2.ape.ChainTarget](#frostfs.v2.ape.ChainTarget) | | Target for which rule chains are listed. | @@ -201,7 +194,7 @@ Statuses: | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| chains | [Chain](#frostfs.v2.apemanager.Chain) | repeated | The list of chains defined for the reqeusted target. | +| chains | [frostfs.v2.ape.Chain](#frostfs.v2.ape.Chain) | repeated | The list of chains defined for the reqeusted target. | @@ -225,7 +218,7 @@ Statuses: | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| target | [ChainTarget](#frostfs.v2.apemanager.ChainTarget) | | Target for which a rule chain is removed. | +| target | [frostfs.v2.ape.ChainTarget](#frostfs.v2.ape.ChainTarget) | | Target for which a rule chain is removed. | | chain_id | [bytes](#bytes) | | Chain ID assigned for the rule chain. | @@ -255,58 +248,6 @@ operation could not be performed is an error returning to a client. - -

Top

- -## apemanager/types.proto - - - - - - - -### Message Chain -Chain is a chain of rules defined for a specific target. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| raw | [bytes](#bytes) | | Raw representation of a serizalized rule chain. | - - - - -### Message ChainTarget -ChainTarget is an object to which a rule chain is defined. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| type | [TargetType](#frostfs.v2.apemanager.TargetType) | | | -| name | [string](#string) | | | - - - - - - -### TargetType -TargetType is a type target to which a rule chain is defined. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| UNDEFINED | 0 | | -| NAMESPACE | 1 | | -| CONTAINER | 2 | | -| USER | 3 | | -| GROUP | 4 | | - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ Type | Java Type | Python Type | From 4c2193443eaa10c7c442feb365a924aaf5f7b564 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 28 May 2024 11:52:42 +0300 Subject: [PATCH 410/440] [#54] acl: Add APE chains to Bearer token Signed-off-by: Airat Arifullin --- acl/types.proto | 20 ++++++++++++++++++++ proto-docs/acl.md | 23 ++++++++++++++++++++++- proto-docs/ape.md | 4 ++-- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index e9ea987..ec15021 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -6,6 +6,7 @@ option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl/grpc;ac option csharp_namespace = "Neo.FileStorage.API.Acl"; import "refs/types.proto"; +import "ape/types.proto"; // Target role of the access control rule in access control list. enum Role { @@ -194,6 +195,8 @@ message BearerToken { // container. If it contains `container_id` field, bearer token is only // valid for this specific container. Otherwise, any container of the same // owner is allowed. + // + // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead. EACLTable eacl_table = 1 [ json_name = "eaclTable" ]; // `OwnerID` defines to whom the token was issued. It must match the request @@ -218,6 +221,23 @@ message BearerToken { // AllowImpersonate flag to consider token signer as request owner. // If this field is true extended ACL table in token body isn't processed. bool allow_impersonate = 4 [ json_name = "allowImpersonate" ]; + + // APEOverride is the list of APE chains defined for a target. + // These chains are meant to serve as overrides to the already defined (or even undefined) + // APE chains for the target (see contract `Policy`). + // + // The server-side processing of the bearer token with set APE overrides must verify if a client is permitted + // to override chains for the target, preventing unauthorized access through the APE mechanism. + message APEOverride { + // Target for which chains are applied. + frostfs.v2.ape.ChainTarget target = 1 [ json_name = "target" ]; + + // The list of APE chains. + repeated frostfs.v2.ape.Chain chains = 2 [ json_name = "chains" ]; + } + + // APE override for the target. + APEOverride ape_override = 5 [ json_name = "apeOverride" ]; } // Bearer Token body Body body = 1 [ json_name = "body" ]; diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 91fd36b..19c1a8d 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -8,6 +8,7 @@ - Messages - [BearerToken](#neo.fs.v2.acl.BearerToken) - [BearerToken.Body](#neo.fs.v2.acl.BearerToken.Body) + - [BearerToken.Body.APEOverride](#neo.fs.v2.acl.BearerToken.Body.APEOverride) - [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) - [EACLRecord](#neo.fs.v2.acl.EACLRecord) - [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) @@ -57,10 +58,30 @@ container owner with additional information preventing token abuse. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container. If it contains `container_id` field, bearer token is only valid for this specific container. Otherwise, any container of the same owner is allowed. | +| eacl_table | [EACLTable](#neo.fs.v2.acl.EACLTable) | | Table of Extended ACL rules to use instead of the ones attached to the container. If it contains `container_id` field, bearer token is only valid for this specific container. Otherwise, any container of the same owner is allowed. + +Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead. | | owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | `OwnerID` defines to whom the token was issued. It must match the request originator's `OwnerID`. If empty, any token bearer will be accepted. | | lifetime | [BearerToken.Body.TokenLifetime](#neo.fs.v2.acl.BearerToken.Body.TokenLifetime) | | Token expiration and valid time period parameters | | allow_impersonate | [bool](#bool) | | AllowImpersonate flag to consider token signer as request owner. If this field is true extended ACL table in token body isn't processed. | +| ape_override | [BearerToken.Body.APEOverride](#neo.fs.v2.acl.BearerToken.Body.APEOverride) | | APE override for the target. | + + + + +### Message BearerToken.Body.APEOverride +APEOverride is the list of APE chains defined for a target. +These chains are meant to serve as overrides to the already defined (or even undefined) +APE chains for the target (see contract `Policy`). + +The server-side processing of the bearer token with set APE overrides must verify if a client is permitted +to override chains for the target, preventing unauthorized access through the APE mechanism. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| target | [frostfs.v2.ape.ChainTarget](#frostfs.v2.ape.ChainTarget) | | Target for which chains are applied. | +| chains | [frostfs.v2.ape.Chain](#frostfs.v2.ape.Chain) | repeated | The list of APE chains. | diff --git a/proto-docs/ape.md b/proto-docs/ape.md index c4d7157..b101c83 100644 --- a/proto-docs/ape.md +++ b/proto-docs/ape.md @@ -72,8 +72,8 @@ TargetType is a type target to which a rule chain is defined. | ----------- | ----- | -------- | --------- | ----------- | | double | | double | double | float | | float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers - if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers - if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | | uint32 | Uses variable-length encoding. | uint32 | int | int/long | | uint64 | Uses variable-length encoding. | uint64 | long | int/long | | sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | From c7473ed98cf9034d9e719f412bac4e136326ff03 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 23 May 2024 22:40:45 +0300 Subject: [PATCH 411/440] [#52] object: Add `parent_attributes` field to EC-header Signed-off-by: Airat Arifullin --- object/types.proto | 2 ++ proto-docs/object.md | 1 + 2 files changed, 3 insertions(+) diff --git a/object/types.proto b/object/types.proto index 7591be7..2e2a343 100644 --- a/object/types.proto +++ b/object/types.proto @@ -216,6 +216,8 @@ message Header { // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed // in Split hierarchy. neo.fs.v2.refs.ObjectID parent_split_parent_id = 7 [ json_name = "parentSplitParentID" ]; + // EC parent's attributes. + repeated Attribute parent_attributes = 8 [ json_name = "parentAttributes" ]; } // Erasure code chunk information. EC ec = 12 [ json_name = "ec" ]; diff --git a/proto-docs/object.md b/proto-docs/object.md index 7f53a68..c141a60 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -1066,6 +1066,7 @@ All objects belonging to a single EC group have the same `parent` field. | header | [bytes](#bytes) | | Chunk of a parent header. | | parent_split_id | [bytes](#bytes) | | As the origin object is EC-splitted its identifier is known to all chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). In this case parent_split_id should be set. | | parent_split_parent_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed in Split hierarchy. | +| parent_attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | EC parent's attributes. | From 0916cb5398dc06b0f229bf36170582e7d7038438 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 13 May 2024 16:48:05 +0300 Subject: [PATCH 412/440] [#49] status: Introduce new common status code * Introduce `INVALID_ARGUMENT` for common status section; * Regenerate docs. Signed-off-by: Airat Arifullin --- proto-docs/status.md | 1 + status/types.proto | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/proto-docs/status.md b/proto-docs/status.md index c1401bd..6444072 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -101,6 +101,7 @@ Section of failed statuses independent of the operation. | WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). | | SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. | | NODE_UNDER_MAINTENANCE | 3 | [**1027**] Node is under maintenance. | +| INVALID_ARGUMENT | 4 | [**1028**] Invalid argument error. If the server fails on validation of a request parameter as the client sent it incorrectly, then this code should be used. | diff --git a/status/types.proto b/status/types.proto index 2205abc..8d2d5c0 100644 --- a/status/types.proto +++ b/status/types.proto @@ -104,6 +104,10 @@ enum CommonFail { // [**1027**] Node is under maintenance. NODE_UNDER_MAINTENANCE = 3; + + // [**1028**] Invalid argument error. If the server fails on validation of a + // request parameter as the client sent it incorrectly, then this code should be used. + INVALID_ARGUMENT = 4; } // Section of statuses for object-related operations. From 4a4a7612f665ee9b9cc2eaf312e17b8d64474ed8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 25 Jul 2024 18:19:02 +0300 Subject: [PATCH 413/440] [#57] *: Format with clang-format Signed-off-by: Evgenii Stratonikov --- acl/types.proto | 12 +++++++----- container/service.proto | 12 ++++++------ object/service.proto | 18 +++++++++--------- object/types.proto | 14 ++++++++------ status/types.proto | 3 ++- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/acl/types.proto b/acl/types.proto index ec15021..b36df14 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -196,7 +196,8 @@ message BearerToken { // valid for this specific container. Otherwise, any container of the same // owner is allowed. // - // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used instead. + // Deprecated: eACL tables are no longer relevant - `APEOverrides` should be + // used instead. EACLTable eacl_table = 1 [ json_name = "eaclTable" ]; // `OwnerID` defines to whom the token was issued. It must match the request @@ -223,11 +224,12 @@ message BearerToken { bool allow_impersonate = 4 [ json_name = "allowImpersonate" ]; // APEOverride is the list of APE chains defined for a target. - // These chains are meant to serve as overrides to the already defined (or even undefined) - // APE chains for the target (see contract `Policy`). + // These chains are meant to serve as overrides to the already defined (or + // even undefined) APE chains for the target (see contract `Policy`). // - // The server-side processing of the bearer token with set APE overrides must verify if a client is permitted - // to override chains for the target, preventing unauthorized access through the APE mechanism. + // The server-side processing of the bearer token with set APE overrides + // must verify if a client is permitted to override chains for the target, + // preventing unauthorized access through the APE mechanism. message APEOverride { // Target for which chains are applied. frostfs.v2.ape.ChainTarget target = 1 [ json_name = "target" ]; diff --git a/container/service.proto b/container/service.proto index 5695b66..f572ba5 100644 --- a/container/service.proto +++ b/container/service.proto @@ -25,7 +25,7 @@ service ContainerService { // request to save the container has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container create access denied. + // container create access denied. rpc Put(PutRequest) returns (PutResponse); // `Delete` invokes `Container` smart contract's `Delete` method and returns @@ -38,7 +38,7 @@ service ContainerService { // request to remove the container has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container delete access denied. + // container delete access denied. rpc Delete(DeleteRequest) returns (DeleteResponse); // Returns container structure from `Container` smart contract storage. @@ -50,7 +50,7 @@ service ContainerService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // requested container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied. + // access to container is denied. rpc Get(GetRequest) returns (GetResponse); // Returns all owner's containers from 'Container` smart contract' storage. @@ -60,7 +60,7 @@ service ContainerService { // container list has been successfully read; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // container list access denied. + // container list access denied. rpc List(ListRequest) returns (ListResponse); // Invokes 'SetEACL' method of 'Container` smart contract and returns response @@ -72,7 +72,7 @@ service ContainerService { // request to save container eACL has been sent to the sidechain; // - Common failures (SECTION_FAILURE_COMMON); // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // set container eACL access denied. + // set container eACL access denied. rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); // Returns Extended ACL table and signature from `Container` smart contract @@ -87,7 +87,7 @@ service ContainerService { // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ // eACL table not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container eACL is denied. + // access to container eACL is denied. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); // Announces the space values used by the container for P2P synchronization. diff --git a/object/service.proto b/object/service.proto index 1168e4e..a92c42a 100644 --- a/object/service.proto +++ b/object/service.proto @@ -46,7 +46,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Get(GetRequest) returns (stream GetResponse); @@ -115,7 +115,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Delete(DeleteRequest) returns (DeleteResponse); @@ -145,7 +145,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Head(HeadRequest) returns (HeadResponse); @@ -171,7 +171,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // search container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc Search(SearchRequest) returns (stream SearchResponse); @@ -208,7 +208,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); @@ -243,7 +243,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); @@ -275,7 +275,7 @@ service ObjectService { // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ // object storage container not found; // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container is denied; + // access to container is denied; // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ // (for trusted object preparation) session private key does not exist or // has @@ -584,8 +584,8 @@ message SearchRequest { // * $Object:split.splitID \ // 16 byte UUIDv4 used to identify the split object hierarchy parts // * $Object:ec.parent \ - // If the object is stored according to EC policy, then ec_parent attribute - // is set to return an id list of all related EC chunks. + // If the object is stored according to EC policy, then ec_parent + // attribute is set to return an id list of all related EC chunks. // // There are some well-known filter aliases to match objects by certain // properties: diff --git a/object/types.proto b/object/types.proto index 2e2a343..b25e792 100644 --- a/object/types.proto +++ b/object/types.proto @@ -209,13 +209,15 @@ message Header { // Chunk of a parent header. bytes header = 5 [ json_name = "header" ]; // As the origin object is EC-splitted its identifier is known to all - // chunks as parent. But parent itself can be a part of Split (does not relate to EC-split). - // In this case parent_split_id should be set. + // chunks as parent. But parent itself can be a part of Split (does not + // relate to EC-split). In this case parent_split_id should be set. bytes parent_split_id = 6 [ json_name = "parentSplitID" ]; - // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, itself, is a part of Split and - // if an object ID of its parent is presented. The field allows to determine how EC-chunk is placed - // in Split hierarchy. - neo.fs.v2.refs.ObjectID parent_split_parent_id = 7 [ json_name = "parentSplitParentID" ]; + // EC-parent's parent ID. parent_split_parent_id is set if EC-parent, + // itself, is a part of Split and if an object ID of its parent is + // presented. The field allows to determine how EC-chunk is placed in Split + // hierarchy. + neo.fs.v2.refs.ObjectID parent_split_parent_id = 7 + [ json_name = "parentSplitParentID" ]; // EC parent's attributes. repeated Attribute parent_attributes = 8 [ json_name = "parentAttributes" ]; } diff --git a/status/types.proto b/status/types.proto index 8d2d5c0..49c784f 100644 --- a/status/types.proto +++ b/status/types.proto @@ -106,7 +106,8 @@ enum CommonFail { NODE_UNDER_MAINTENANCE = 3; // [**1028**] Invalid argument error. If the server fails on validation of a - // request parameter as the client sent it incorrectly, then this code should be used. + // request parameter as the client sent it incorrectly, then this code should + // be used. INVALID_ARGUMENT = 4; } From 8dd63c451c6543d1a4d049c13a0db30e40c9cd60 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 25 Jul 2024 18:19:34 +0300 Subject: [PATCH 414/440] [#57] container: Remove deprecated methods Signed-off-by: Evgenii Stratonikov --- container/service.proto | 119 ---------------------------------------- 1 file changed, 119 deletions(-) diff --git a/container/service.proto b/container/service.proto index f572ba5..66542aa 100644 --- a/container/service.proto +++ b/container/service.proto @@ -63,18 +63,6 @@ service ContainerService { // container list access denied. rpc List(ListRequest) returns (ListResponse); - // Invokes 'SetEACL' method of 'Container` smart contract and returns response - // immediately. After one more block in sidechain, changes in an Extended ACL - // are added into smart contract storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // request to save container eACL has been sent to the sidechain; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // set container eACL access denied. - rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); - // Returns Extended ACL table and signature from `Container` smart contract // storage. // @@ -89,15 +77,6 @@ service ContainerService { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // access to container eACL is denied. rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); - - // Announces the space values used by the container for P2P synchronization. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // estimation of used space has been successfully announced; - // - Common failures (SECTION_FAILURE_COMMON). - rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) - returns (AnnounceUsedSpaceResponse); } // New NeoFS Container creation request @@ -283,50 +262,6 @@ message ListResponse { neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } -// Set Extended ACL -message SetExtendedACLRequest { - // Set Extended ACL request body does not have separate `ContainerID` - // reference. It will be taken from `EACLTable.container_id` field. - message Body { - // Extended ACL table to set for the container - neo.fs.v2.acl.EACLTable eacl = 1; - - // Signature of stable-marshalled Extended ACL table according to RFC-6979. - neo.fs.v2.refs.SignatureRFC6979 signature = 2; - } - // Body of set extended acl request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; -} - -// Set Extended ACL -message SetExtendedACLResponse { - // `SetExtendedACLResponse` has an empty body because the operation is - // asynchronous and the update should be reflected in `Container` smart - // contract's storage after next block is issued in sidechain. - message Body {} - - // Body of set extended acl response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} - // Get Extended ACL message GetExtendedACLRequest { // Get Extended ACL request body @@ -375,57 +310,3 @@ message GetExtendedACLResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } - -// Announce container used space -message AnnounceUsedSpaceRequest { - // Container used space announcement body. - message Body { - // Announcement contains used space information for a single container. - message Announcement { - // Epoch number for which the container size estimation was produced. - uint64 epoch = 1; - - // Identifier of the container. - neo.fs.v2.refs.ContainerID container_id = 2; - - // Used space is a sum of object payload sizes of a specified - // container, stored in the node. It must not include inhumed objects. - uint64 used_space = 3; - } - - // List of announcements. If nodes share several containers, - // announcements are transferred in a batch. - repeated Announcement announcements = 1; - } - - // Body of announce used space request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; -} - -// Announce container used space -message AnnounceUsedSpaceResponse { - // `AnnounceUsedSpaceResponse` has an empty body because announcements are - // one way communication. - message Body {} - - // Body of announce used space response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} From 2efdc8fedbdda636bdfc63ae4f7a54182ee7b5c6 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 23 Jul 2024 14:12:49 +0300 Subject: [PATCH 415/440] [#56] object: Introduce `Patch` method * Introduce rpc `Patch` and corresponding types; * Generate docs. Signed-off-by: Airat Arifullin --- object/service.proto | 113 +++++++++++++++++++++++++++++++++++++++- proto-docs/object.md | 120 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 232 insertions(+), 1 deletion(-) diff --git a/object/service.proto b/object/service.proto index a92c42a..dc39c1c 100644 --- a/object/service.proto +++ b/object/service.proto @@ -283,6 +283,51 @@ service ObjectService { // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ // provided session token has expired. rpc PutSingle(PutSingleRequest) returns (PutSingleResponse); + + // Patch the object. Request uses gRPC stream. First message must set + // the address of the object that is going to get patched. If the object's attributes + // are patched, then these attrubutes must be set only within the first stream message. + // + // If the patch request is performed by NOT the object's owner but if the actor has the permission + // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner + // loses the object's ownership after the patch request is successfully done. + // + // As objects are content-addressable the patching causes new object ID generation for the patched object. + // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // 2. The patch that reverts the changes applied by preceding patch; + // 3. The application of the same patches for the object a few times. + // + // Extended headers can change `Patch` behaviour: + // * [ __SYSTEM__NETMAP_EPOCH \ + // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + // Will use the requsted version of Network Map for object placement + // calculation. + // + // Please refer to detailed `XHeader` description. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // object has been successfully patched and saved in the container; + // - Common failures (SECTION_FAILURE_COMMON); + // - **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + // write access to the container is denied; + // - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + // object not found in container; + // - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + // the requested object has been marked as deleted. + // - **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + // the requested range is out of bounds; + // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + // object storage container not found; + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // access to container is denied; + // - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + // (for trusted object preparation) session private key does not exist or + // has been deleted; + // - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + // provided session token has expired. + rpc Patch(stream PatchRequest) returns (PatchResponse); } // GET object request @@ -816,4 +861,70 @@ message PutSingleResponse { // authenticate the nodes of the message route and check the correctness of // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} \ No newline at end of file +} + +// Object PATCH request +message PatchRequest { + // PATCH request body + message Body { + // The address of the object that is requested to get patched. + neo.fs.v2.refs.Address address = 1; + + // New attributes for the object. See `replace_attributes` flag usage to define how + // new attributes should be set. + repeated neo.fs.v2.object.Header.Attribute new_attributes = 2; + + // If this flag is set, then the object's attributes will be entirely replaced by `new_attributes` list. + // The empty `new_attributes` list with `replace_attributes = true` just resets attributes list for the object. + // + // Default `false` value for this flag means the attributes will be just merged. If the incoming `new_attributes` + // list contains already existing key, then it just replaces it while merging the lists. + bool replace_attributes = 3; + + // The patch for the object's payload. + message Patch { + // The range of the source object for which the payload is replaced by the patch's chunk. + // If the range's `length = 0`, then the patch's chunk is just appended to the original payload + // starting from the `offest` without any replace. + Range source_range = 1; + + // The chunk that is being appended to or that replaces the original payload on the given range. + bytes chunk = 2; + } + + // The patch that is applied for the object. + Patch patch = 4; + } + + // Body for patch request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// Object PATCH response +message PatchResponse { + // PATCH response body + message Body { + // The object ID of the saved patched object. + neo.fs.v2.refs.ObjectID object_id = 1; + } + + // Body for patch response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to authenticate + // the nodes of the message route and check the correctness of transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} diff --git a/proto-docs/object.md b/proto-docs/object.md index c141a60..f353b3f 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -30,6 +30,11 @@ - [HeadResponse](#neo.fs.v2.object.HeadResponse) - [HeadResponse.Body](#neo.fs.v2.object.HeadResponse.Body) - [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) + - [PatchRequest](#neo.fs.v2.object.PatchRequest) + - [PatchRequest.Body](#neo.fs.v2.object.PatchRequest.Body) + - [PatchRequest.Body.Patch](#neo.fs.v2.object.PatchRequest.Body.Patch) + - [PatchResponse](#neo.fs.v2.object.PatchResponse) + - [PatchResponse.Body](#neo.fs.v2.object.PatchResponse.Body) - [PutRequest](#neo.fs.v2.object.PutRequest) - [PutRequest.Body](#neo.fs.v2.object.PutRequest.Body) - [PutRequest.Body.Init](#neo.fs.v2.object.PutRequest.Body.Init) @@ -88,6 +93,7 @@ rpc Search(SearchRequest) returns (stream SearchResponse); rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); rpc PutSingle(PutSingleRequest) returns (PutSingleResponse); +rpc Patch(stream PatchRequest) returns (PatchResponse); ``` @@ -395,6 +401,55 @@ been deleted; | Name | Input | Output | | ---- | ----- | ------ | | PutSingle | [PutSingleRequest](#neo.fs.v2.object.PutSingleRequest) | [PutSingleResponse](#neo.fs.v2.object.PutSingleResponse) | +#### Method Patch + +Patch the object. Request uses gRPC stream. First message must set +the address of the object that is going to get patched. If the object's attributes +are patched, then these attrubutes must be set only within the first stream message. + +If the patch request is performed by NOT the object's owner but if the actor has the permission +to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner +loses the object's ownership after the patch request is successfully done. + +As objects are content-addressable the patching causes new object ID generation for the patched object. +This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: +1. The chunk of the applying patch contains the same value as the object's payload within the same range; +2. The patch that reverts the changes applied by preceding patch; +3. The application of the same patches for the object a few times. + +Extended headers can change `Patch` behaviour: +* [ __SYSTEM__NETMAP_EPOCH \ + (`__NEOFS__NETMAP_EPOCH` is deprecated) \ + Will use the requsted version of Network Map for object placement + calculation. + +Please refer to detailed `XHeader` description. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + object has been successfully patched and saved in the container; +- Common failures (SECTION_FAILURE_COMMON); +- **ACCESS_DENIED** (2048, SECTION_OBJECT): \ + write access to the container is denied; +- **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT): \ + object not found in container; +- **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT): \ + the requested object has been marked as deleted. +- **OUT_OF_RANGE** (2053, SECTION_OBJECT): \ + the requested range is out of bounds; +- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ + object storage container not found; +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + access to container is denied; +- **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ + (for trusted object preparation) session private key does not exist or + has been deleted; +- **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ + provided session token has expired. + +| Name | Input | Output | +| ---- | ----- | ------ | +| Patch | [PatchRequest](#neo.fs.v2.object.PatchRequest) | [PatchResponse](#neo.fs.v2.object.PatchResponse) | @@ -691,6 +746,71 @@ following steps: | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signed `ObjectID` to verify full header's authenticity | + + +### Message PatchRequest +Object PATCH request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PatchRequest.Body](#neo.fs.v2.object.PatchRequest.Body) | | Body for patch request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PatchRequest.Body +PATCH request body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| address | [neo.fs.v2.refs.Address](#neo.fs.v2.refs.Address) | | The address of the object that is requested to get patched. | +| new_attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | New attributes for the object. See `replace_attributes` flag usage to define how new attributes should be set. | +| replace_attributes | [bool](#bool) | | If this flag is set, then the object's attributes will be entirely replaced by `new_attributes` list. The empty `new_attributes` list with `replace_attributes = true` just resets attributes list for the object. + +Default `false` value for this flag means the attributes will be just merged. If the incoming `new_attributes` list contains already existing key, then it just replaces it while merging the lists. | +| patch | [PatchRequest.Body.Patch](#neo.fs.v2.object.PatchRequest.Body.Patch) | | The patch that is applied for the object. | + + + + +### Message PatchRequest.Body.Patch +The patch for the object's payload. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| source_range | [Range](#neo.fs.v2.object.Range) | | The range of the source object for which the payload is replaced by the patch's chunk. If the range's `length = 0`, then the patch's chunk is just appended to the original payload starting from the `offest` without any replace. | +| chunk | [bytes](#bytes) | | The chunk that is being appended to or that replaces the original payload on the given range. | + + + + +### Message PatchResponse +Object PATCH response + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [PatchResponse.Body](#neo.fs.v2.object.PatchResponse.Body) | | Body for patch response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message PatchResponse.Body +PATCH response body + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | The object ID of the saved patched object. | + + ### Message PutRequest From e5c976b557b2dc5f600ae17997923f0e4b8489d9 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Mon, 5 Aug 2024 20:43:00 +0300 Subject: [PATCH 416/440] [#59] session: Add `Patch` verb * Regenerate docs. Signed-off-by: Airat Arifullin --- proto-docs/session.md | 1 + session/types.proto | 3 +++ 2 files changed, 4 insertions(+) diff --git a/proto-docs/session.md b/proto-docs/session.md index 40088d1..699a907 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -338,6 +338,7 @@ Object request verbs | DELETE | 5 | Refers to object.Delete RPC call | | RANGE | 6 | Refers to object.GetRange RPC call | | RANGEHASH | 7 | Refers to object.GetRangeHash RPC call | +| PATCH | 8 | Refers to object.Patch RPC call | diff --git a/session/types.proto b/session/types.proto index a878665..e039081 100644 --- a/session/types.proto +++ b/session/types.proto @@ -36,6 +36,9 @@ message ObjectSessionContext { // Refers to object.GetRangeHash RPC call RANGEHASH = 7; + + // Refers to object.Patch RPC call + PATCH = 8; } // Type of request for which the token is issued Verb verb = 1 [ json_name = "verb" ]; From 542d0d9ec2b09c08df915acef226463a7fcfacce Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Mon, 24 Jun 2024 09:35:29 +0300 Subject: [PATCH 417/440] [#55] netmap: Add `LIKE` operation for `filter` in `policy` Signed-off-by: Anton Nikiforov --- netmap/types.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 2180869..055e838 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -36,6 +36,9 @@ enum Operation { // Logical negation NOT = 9; + + // Matches pattern + LIKE = 10; } // Selector modifier shows how the node set will be formed. By default selector From 8760caa093c9c0628faee1d9b6eb40d7de937bd8 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 00:13:20 +0300 Subject: [PATCH 418/440] [#60] container: Remove GetExtendedACL Signed-off-by: Aleksey Savchuk --- container/service.proto | 64 ----------------------------------------- 1 file changed, 64 deletions(-) diff --git a/container/service.proto b/container/service.proto index 66542aa..f5bebf0 100644 --- a/container/service.proto +++ b/container/service.proto @@ -62,21 +62,6 @@ service ContainerService { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. rpc List(ListRequest) returns (ListResponse); - - // Returns Extended ACL table and signature from `Container` smart contract - // storage. - // - // Statuses: - // - **OK** (0, SECTION_SUCCESS): \ - // container eACL has been successfully read; - // - Common failures (SECTION_FAILURE_COMMON); - // - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - // container not found; - // - **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - // eACL table not found; - // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - // access to container eACL is denied. - rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); } // New NeoFS Container creation request @@ -261,52 +246,3 @@ message ListResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } - -// Get Extended ACL -message GetExtendedACLRequest { - // Get Extended ACL request body - message Body { - // Identifier of the container having Extended ACL - neo.fs.v2.refs.ContainerID container_id = 1; - } - - // Body of get extended acl request message. - Body body = 1; - - // Carries request meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.RequestMetaHeader meta_header = 2; - - // Carries request verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.RequestVerificationHeader verify_header = 3; -} - -// Get Extended ACL -message GetExtendedACLResponse { - // Get Extended ACL Response body can be empty if the requested container does - // not have Extended ACL Table attached or Extended ACL has not been allowed - // at the time of container creation. - message Body { - // Extended ACL requested, if available - neo.fs.v2.acl.EACLTable eacl = 1; - - // Signature of stable-marshalled Extended ACL according to RFC-6979. - neo.fs.v2.refs.SignatureRFC6979 signature = 2; - - // Session token if Extended ACL was set within a session - neo.fs.v2.session.SessionToken session_token = 3; - } - // Body of get extended acl response message. - Body body = 1; - - // Carries response meta information. Header data is used only to regulate - // message transport and does not affect request execution. - neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - - // Carries response verification information. This header is used to - // authenticate the nodes of the message route and check the correctness of - // transmission. - neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} From 54812ba857025ea8e31a4e2559bb2d99bdff42d8 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 14:43:07 +0300 Subject: [PATCH 419/440] [#58] Makefile: Remove lint target due to buf CLI being unavailable The `buf` CLI is no longer available, so the related lint target has been removed from Makefile. Signed-off-by: Aleksey Savchuk --- Makefile | 8 -------- buf.yaml | 10 ---------- 2 files changed, 18 deletions(-) mode change 100644 => 100755 Makefile delete mode 100644 buf.yaml diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 532d8b0..21c354f --- a/Makefile +++ b/Makefile @@ -1,14 +1,6 @@ #!/usr/bin/make -f SHELL=bash -# BRanch to match for BReaking changes -BRBR?=master - -.PHONY: lint -lint: - buf check lint - buf check breaking --against-input '.git#branch=$(BRBR)' - .PHONY: doc # Regenerate documentation for proto files: doc: diff --git a/buf.yaml b/buf.yaml deleted file mode 100644 index 2006bea..0000000 --- a/buf.yaml +++ /dev/null @@ -1,10 +0,0 @@ -lint: - use: - - DEFAULT - - COMMENTS - - ENUM_FIRST_VALUE_ZERO - except: - - PACKAGE_DIRECTORY_MATCH - - PACKAGE_VERSION_SUFFIX - - ENUM_VALUE_PREFIX - - ENUM_ZERO_VALUE_SUFFIX From 6b0f3b01e0677e708487b2901d343ece55ae17db Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 14:59:24 +0300 Subject: [PATCH 420/440] [#58] pre-commit: Add pre-commit and related Makefile targets Signed-off-by: Aleksey Savchuk --- .pre-commit-config.yaml | 24 ++++++++++++++++++++++++ Makefile | 18 +++++++++++++++++- help.mk | 11 +++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml create mode 100644 help.mk diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..96f3e27 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: check-json + - id: check-xml + - id: check-yaml + - id: trailing-whitespace + args: [--markdown-linebreak-ext=md] + - id: end-of-file-fixer + exclude: ".svg$" + + - repo: local + hooks: + - id: make-fmt + name: Run make fmt + entry: make fmt + language: system + pass_filenames: false diff --git a/Makefile b/Makefile index 21c354f..c08d609 100755 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ #!/usr/bin/make -f SHELL=bash -.PHONY: doc +include help.mk + +.PHONY: doc fmt pre-commit unpre-commit pre-commit-run + # Regenerate documentation for proto files: doc: @for f in `find . -type f -name '*.proto' -exec dirname {} \; | sort -u `; do \ @@ -12,8 +15,21 @@ doc: --doc_out=proto-docs/ $${f}/*.proto; \ done +# Run clang-format fmt: @for f in `ls **/*.proto`; do \ echo "⇒ Formatting $$f"; \ clang-format -i $$f; \ done + +# Activate pre-commit hooks +pre-commit: + pre-commit install --hook-type pre-commit + +# Deactivate pre-commit hooks +unpre-commit: + pre-commit uninstall --hook-type pre-commit + +# Run pre-commit hooks +pre-commit-run: + @pre-commit run --all-files --hook-stage manual diff --git a/help.mk b/help.mk new file mode 100644 index 0000000..a2ac989 --- /dev/null +++ b/help.mk @@ -0,0 +1,11 @@ +.PHONY: help + +# Show this help prompt +help: + @echo ' Usage:' + @echo '' + @echo ' make ' + @echo '' + @echo ' Targets:' + @echo '' + @awk '/^#/{ comment = substr($$0,3) } /^[a-zA-Z][a-zA-Z0-9_-]+:/{ print " ", $$1, comment; comment = "" }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq From aaa922f600a1391b6dedf8c8da7ea6e38f05fcfd Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 15:03:58 +0300 Subject: [PATCH 421/440] [#58] *: Run pre-commit Signed-off-by: Aleksey Savchuk --- .gitignore | 1 - CHANGELOG.md | 6 ++--- apemanager/service.proto | 2 +- object/service.proto | 55 +++++++++++++++++++++++----------------- object/types.proto | 2 +- proto-docs/accounting.md | 7 +++-- proto-docs/acl.md | 3 +-- proto-docs/ape.md | 3 +-- proto-docs/apemanager.md | 5 ++-- proto-docs/container.md | 7 +++-- proto-docs/lock.md | 3 +-- proto-docs/netmap.md | 7 +++-- proto-docs/object.md | 23 ++++++++--------- proto-docs/refs.md | 3 +-- proto-docs/session.md | 7 +++-- proto-docs/status.md | 3 +-- proto-docs/tombstone.md | 3 +-- status/types.proto | 2 +- 18 files changed, 69 insertions(+), 73 deletions(-) diff --git a/.gitignore b/.gitignore index c6ef218..485dee6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ .idea - diff --git a/CHANGELOG.md b/CHANGELOG.md index ee28fa6..70ceb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,7 @@ Network magic, main status codes, object locks and notifications. - `LOCK` value of `object.Type` enum (#194) - `Lock` message with payload content of `LOCK` objects (#194) - `LOCKED` and `LOCK_NON_REGULAR_OBJECT` status codes to `Object` section (#194) -- `scheme` field of type `SignatureScheme` to `Signature` message which determines +- `scheme` field of type `SignatureScheme` to `Signature` message which determines signature scheme (#55) - `SignatureRFC6979` message (#203) @@ -166,8 +166,8 @@ values in the objects. ### Changed -- Clarified processing of empty search query in `object.Search` RPC. -- Specified connection of tombstone expiration value with well-known +- Clarified processing of empty search query in `object.Search` RPC. +- Specified connection of tombstone expiration value with well-known `__NEOFS__EXPIRATION_EPOCH` object attribute. ## [2.3.0] - 2021-02-11 - Seonyudo (선유도, 仙遊島) diff --git a/apemanager/service.proto b/apemanager/service.proto index 7ff23a7..166ba4d 100644 --- a/apemanager/service.proto +++ b/apemanager/service.proto @@ -168,4 +168,4 @@ message ListChainsResponse { // authenticate the nodes of the message route and check the correctness of // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; -} \ No newline at end of file +} diff --git a/object/service.proto b/object/service.proto index dc39c1c..2c53297 100644 --- a/object/service.proto +++ b/object/service.proto @@ -285,16 +285,20 @@ service ObjectService { rpc PutSingle(PutSingleRequest) returns (PutSingleResponse); // Patch the object. Request uses gRPC stream. First message must set - // the address of the object that is going to get patched. If the object's attributes - // are patched, then these attrubutes must be set only within the first stream message. + // the address of the object that is going to get patched. If the object's + // attributes are patched, then these attrubutes must be set only within the + // first stream message. // - // If the patch request is performed by NOT the object's owner but if the actor has the permission - // to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner - // loses the object's ownership after the patch request is successfully done. + // If the patch request is performed by NOT the object's owner but if the + // actor has the permission to perform the patch, then `OwnerID` of the object + // is changed. In this case the object's owner loses the object's ownership + // after the patch request is successfully done. // - // As objects are content-addressable the patching causes new object ID generation for the patched object. - // This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: - // 1. The chunk of the applying patch contains the same value as the object's payload within the same range; + // As objects are content-addressable the patching causes new object ID + // generation for the patched object. This object id is set witihn + // `PatchResponse`. But the object id may remain unchanged in such cases: + // 1. The chunk of the applying patch contains the same value as the object's + // payload within the same range; // 2. The patch that reverts the changes applied by preceding patch; // 3. The application of the same patches for the object a few times. // @@ -870,25 +874,29 @@ message PatchRequest { // The address of the object that is requested to get patched. neo.fs.v2.refs.Address address = 1; - // New attributes for the object. See `replace_attributes` flag usage to define how - // new attributes should be set. + // New attributes for the object. See `replace_attributes` flag usage to + // define how new attributes should be set. repeated neo.fs.v2.object.Header.Attribute new_attributes = 2; - // If this flag is set, then the object's attributes will be entirely replaced by `new_attributes` list. - // The empty `new_attributes` list with `replace_attributes = true` just resets attributes list for the object. + // If this flag is set, then the object's attributes will be entirely + // replaced by `new_attributes` list. The empty `new_attributes` list with + // `replace_attributes = true` just resets attributes list for the object. // - // Default `false` value for this flag means the attributes will be just merged. If the incoming `new_attributes` - // list contains already existing key, then it just replaces it while merging the lists. + // Default `false` value for this flag means the attributes will be just + // merged. If the incoming `new_attributes` list contains already existing + // key, then it just replaces it while merging the lists. bool replace_attributes = 3; - // The patch for the object's payload. + // The patch for the object's payload. message Patch { - // The range of the source object for which the payload is replaced by the patch's chunk. - // If the range's `length = 0`, then the patch's chunk is just appended to the original payload - // starting from the `offest` without any replace. + // The range of the source object for which the payload is replaced by the + // patch's chunk. If the range's `length = 0`, then the patch's chunk is + // just appended to the original payload starting from the `offest` + // without any replace. Range source_range = 1; - // The chunk that is being appended to or that replaces the original payload on the given range. + // The chunk that is being appended to or that replaces the original + // payload on the given range. bytes chunk = 2; } @@ -913,8 +921,8 @@ message PatchRequest { message PatchResponse { // PATCH response body message Body { - // The object ID of the saved patched object. - neo.fs.v2.refs.ObjectID object_id = 1; + // The object ID of the saved patched object. + neo.fs.v2.refs.ObjectID object_id = 1; } // Body for patch response message. @@ -924,7 +932,8 @@ message PatchResponse { // message transport and does not affect request execution. neo.fs.v2.session.ResponseMetaHeader meta_header = 2; - // Carries response verification information. This header is used to authenticate - // the nodes of the message route and check the correctness of transmission. + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } diff --git a/object/types.proto b/object/types.proto index b25e792..be8f348 100644 --- a/object/types.proto +++ b/object/types.proto @@ -275,4 +275,4 @@ message ECInfo { } // Chunk stored on the node. repeated Chunk chunks = 1; -} \ No newline at end of file +} diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index a23a63c..cdc82a1 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -6,19 +6,19 @@ - [accounting/service.proto](#accounting/service.proto) - Services - [AccountingService](#neo.fs.v2.accounting.AccountingService) - + - Messages - [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) - [BalanceRequest.Body](#neo.fs.v2.accounting.BalanceRequest.Body) - [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) - [BalanceResponse.Body](#neo.fs.v2.accounting.BalanceResponse.Body) - + - [accounting/types.proto](#accounting/types.proto) - Messages - [Decimal](#neo.fs.v2.accounting.Decimal) - + - [Scalar Value Types](#scalar-value-types) @@ -170,4 +170,3 @@ description. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/acl.md b/proto-docs/acl.md index 19c1a8d..bac7747 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -14,7 +14,7 @@ - [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) - [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) - [EACLTable](#neo.fs.v2.acl.EACLTable) - + - [Scalar Value Types](#scalar-value-types) @@ -282,4 +282,3 @@ Target role of the access control rule in access control list. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/ape.md b/proto-docs/ape.md index b101c83..39bc946 100644 --- a/proto-docs/ape.md +++ b/proto-docs/ape.md @@ -8,7 +8,7 @@ - Messages - [Chain](#frostfs.v2.ape.Chain) - [ChainTarget](#frostfs.v2.ape.ChainTarget) - + - [Scalar Value Types](#scalar-value-types) @@ -85,4 +85,3 @@ TargetType is a type target to which a rule chain is defined. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/apemanager.md b/proto-docs/apemanager.md index 5d0e2e6..c1cb682 100644 --- a/proto-docs/apemanager.md +++ b/proto-docs/apemanager.md @@ -6,7 +6,7 @@ - [apemanager/service.proto](#apemanager/service.proto) - Services - [APEManagerService](#frostfs.v2.apemanager.APEManagerService) - + - Messages - [AddChainRequest](#frostfs.v2.apemanager.AddChainRequest) - [AddChainRequest.Body](#frostfs.v2.apemanager.AddChainRequest.Body) @@ -20,7 +20,7 @@ - [RemoveChainRequest.Body](#frostfs.v2.apemanager.RemoveChainRequest.Body) - [RemoveChainResponse](#frostfs.v2.apemanager.RemoveChainResponse) - [RemoveChainResponse.Body](#frostfs.v2.apemanager.RemoveChainResponse.Body) - + - [Scalar Value Types](#scalar-value-types) @@ -267,4 +267,3 @@ operation could not be performed is an error returning to a client. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/container.md b/proto-docs/container.md index b568eed..3df304f 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -6,7 +6,7 @@ - [container/service.proto](#container/service.proto) - Services - [ContainerService](#neo.fs.v2.container.ContainerService) - + - Messages - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) @@ -37,14 +37,14 @@ - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) - + - [container/types.proto](#container/types.proto) - Messages - [Container](#neo.fs.v2.container.Container) - [Container.Attribute](#neo.fs.v2.container.Container.Attribute) - + - [Scalar Value Types](#scalar-value-types) @@ -654,4 +654,3 @@ And some well-known attributes used by applications only: | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/lock.md b/proto-docs/lock.md index ae74c5b..ba23306 100644 --- a/proto-docs/lock.md +++ b/proto-docs/lock.md @@ -7,7 +7,7 @@ - Messages - [Lock](#neo.fs.v2.lock.Lock) - + - [Scalar Value Types](#scalar-value-types) @@ -61,4 +61,3 @@ a lock object via ObjectService.Delete RPC call. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index fb4eccb..cbf5593 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -6,7 +6,7 @@ - [netmap/service.proto](#netmap/service.proto) - Services - [NetmapService](#neo.fs.v2.netmap.NetmapService) - + - Messages - [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) - [LocalNodeInfoRequest.Body](#neo.fs.v2.netmap.LocalNodeInfoRequest.Body) @@ -20,7 +20,7 @@ - [NetworkInfoRequest.Body](#neo.fs.v2.netmap.NetworkInfoRequest.Body) - [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) - [NetworkInfoResponse.Body](#neo.fs.v2.netmap.NetworkInfoResponse.Body) - + - [netmap/types.proto](#netmap/types.proto) @@ -35,7 +35,7 @@ - [PlacementPolicy](#neo.fs.v2.netmap.PlacementPolicy) - [Replica](#neo.fs.v2.netmap.Replica) - [Selector](#neo.fs.v2.netmap.Selector) - + - [Scalar Value Types](#scalar-value-types) @@ -575,4 +575,3 @@ Operations on filters | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/object.md b/proto-docs/object.md index f353b3f..27981e5 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -6,7 +6,7 @@ - [object/service.proto](#object/service.proto) - Services - [ObjectService](#neo.fs.v2.object.ObjectService) - + - Messages - [DeleteRequest](#neo.fs.v2.object.DeleteRequest) - [DeleteRequest.Body](#neo.fs.v2.object.DeleteRequest.Body) @@ -50,7 +50,7 @@ - [SearchRequest.Body.Filter](#neo.fs.v2.object.SearchRequest.Body.Filter) - [SearchResponse](#neo.fs.v2.object.SearchResponse) - [SearchResponse.Body](#neo.fs.v2.object.SearchResponse.Body) - + - [object/types.proto](#object/types.proto) @@ -64,7 +64,7 @@ - [Object](#neo.fs.v2.object.Object) - [ShortHeader](#neo.fs.v2.object.ShortHeader) - [SplitInfo](#neo.fs.v2.object.SplitInfo) - + - [Scalar Value Types](#scalar-value-types) @@ -133,7 +133,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -210,7 +210,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -244,7 +244,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -274,7 +274,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ search container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -315,7 +315,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -354,7 +354,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \ provided session token has expired. @@ -390,7 +390,7 @@ Statuses: - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ object storage container not found; - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container is denied; + access to container is denied; - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \ (for trusted object preparation) session private key does not exist or has @@ -412,7 +412,7 @@ to perform the patch, then `OwnerID` of the object is changed. In this case the loses the object's ownership after the patch request is successfully done. As objects are content-addressable the patching causes new object ID generation for the patched object. -This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: +This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: 1. The chunk of the applying patch contains the same value as the object's payload within the same range; 2. The patch that reverts the changes applied by preceding patch; 3. The application of the same patches for the object a few times. @@ -1319,4 +1319,3 @@ String presentation of object type is the same as definition: | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/refs.md b/proto-docs/refs.md index e27d4ba..5b559d3 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -14,7 +14,7 @@ - [Signature](#neo.fs.v2.refs.Signature) - [SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) - [Version](#neo.fs.v2.refs.Version) - + - [Scalar Value Types](#scalar-value-types) @@ -230,4 +230,3 @@ pair. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/session.md b/proto-docs/session.md index 699a907..36a73ea 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -6,13 +6,13 @@ - [session/service.proto](#session/service.proto) - Services - [SessionService](#neo.fs.v2.session.SessionService) - + - Messages - [CreateRequest](#neo.fs.v2.session.CreateRequest) - [CreateRequest.Body](#neo.fs.v2.session.CreateRequest.Body) - [CreateResponse](#neo.fs.v2.session.CreateResponse) - [CreateResponse.Body](#neo.fs.v2.session.CreateResponse.Body) - + - [session/types.proto](#session/types.proto) @@ -28,7 +28,7 @@ - [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) - [SessionToken.Body.TokenLifetime](#neo.fs.v2.session.SessionToken.Body.TokenLifetime) - [XHeader](#neo.fs.v2.session.XHeader) - + - [Scalar Value Types](#scalar-value-types) @@ -364,4 +364,3 @@ Object request verbs | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/status.md b/proto-docs/status.md index 6444072..373a7a7 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -8,7 +8,7 @@ - Messages - [Status](#neo.fs.v2.status.Status) - [Status.Detail](#neo.fs.v2.status.Status.Detail) - + - [Scalar Value Types](#scalar-value-types) @@ -195,4 +195,3 @@ Section of NeoFS successful return codes. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 7a7761b..268e9a2 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -7,7 +7,7 @@ - Messages - [Tombstone](#neo.fs.v2.tombstone.Tombstone) - + - [Scalar Value Types](#scalar-value-types) @@ -60,4 +60,3 @@ purged from the NeoFS network. | bool | | bool | boolean | boolean | | string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | | bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | - diff --git a/status/types.proto b/status/types.proto index 49c784f..302a11b 100644 --- a/status/types.proto +++ b/status/types.proto @@ -159,4 +159,4 @@ enum Session { enum APEManager { // [**5120**] The operation is denied by APE manager. APE_MANAGER_ACCESS_DENIED = 0; -} \ No newline at end of file +} From 6bc2038f035c7ccbe59feaccee3c75bce9c3b358 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 2 Sep 2024 16:12:29 +0300 Subject: [PATCH 422/440] [#58] .forgejo: Add forgejo actions Signed-off-by: Aleksey Savchuk --- .forgejo/workflows/dco.yaml | 19 +++++++++++++++++++ .forgejo/workflows/fmt.yaml | 15 +++++++++++++++ .forgejo/workflows/pre-commit.yaml | 18 ++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 .forgejo/workflows/dco.yaml create mode 100644 .forgejo/workflows/fmt.yaml create mode 100644 .forgejo/workflows/pre-commit.yaml diff --git a/.forgejo/workflows/dco.yaml b/.forgejo/workflows/dco.yaml new file mode 100644 index 0000000..74fba6a --- /dev/null +++ b/.forgejo/workflows/dco.yaml @@ -0,0 +1,19 @@ +name: DCO action +on: [pull_request] + +jobs: + dco: + name: DCO + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: '1.22' + - name: Run commit format checker + uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 + with: + from: 'origin/${{ github.event.pull_request.base.ref }}' diff --git a/.forgejo/workflows/fmt.yaml b/.forgejo/workflows/fmt.yaml new file mode 100644 index 0000000..d56bcf1 --- /dev/null +++ b/.forgejo/workflows/fmt.yaml @@ -0,0 +1,15 @@ +name: Formatters +on: [pull_request] + +jobs: + fmt: + name: Run fmt + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + apt update + apt install -y clang-format + - name: Run fmt + run: make fmt diff --git a/.forgejo/workflows/pre-commit.yaml b/.forgejo/workflows/pre-commit.yaml new file mode 100644 index 0000000..5bf97eb --- /dev/null +++ b/.forgejo/workflows/pre-commit.yaml @@ -0,0 +1,18 @@ +name: Pre-commit hooks +on: [pull_request] + +jobs: + pre-commit: + name: Pre-commit + env: + # Skip pre-commit hooks which are executed by other actions. + SKIP: make-fmt + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + apt update + apt install -y pre-commit + - name: Run pre-commit + run: pre-commit run --all-files --hook-stage manual --color=always From 6b390035e7283f1797531bdabc5f0e6c815a4f02 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 5 Sep 2024 12:11:00 +0300 Subject: [PATCH 423/440] [#50] netmap: Fix misformatted link in doc comment Signed-off-by: Aleksey Savchuk --- netmap/types.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netmap/types.proto b/netmap/types.proto index 055e838..99724c2 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -201,8 +201,8 @@ message NodeInfo { // [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated // automatically from `UN-LOCODE` attribute. // * Continent \ - // Node's continent name according to the [Seven-Continent model] - // (https://en.wikipedia.org/wiki/Continent#Number). Calculated + // Node's continent name according to the [Seven-Continent + // model](https://en.wikipedia.org/wiki/Continent#Number). Calculated // automatically from `UN-LOCODE` attribute. // * ExternalAddr // Node's preferred way for communications with external clients. From e8afd6e5f5c621b2ddf73a50da7223c57dd1a7a6 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 5 Sep 2024 14:21:02 +0300 Subject: [PATCH 424/440] [#50] netmap: Clarify MaxObjectSize parameter implication on object size Signed-off-by: Aleksey Savchuk --- netmap/types.proto | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/netmap/types.proto b/netmap/types.proto index 99724c2..dfaac13 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -289,6 +289,37 @@ message NetworkConfig { // - **MaxObjectSize** \ // Maximum size of physically stored NeoFS object measured in bytes. // Value: little-endian integer. Default: 0. + // + // This value refers to the maximum size of a **physically** stored object + // in NeoFS. However, from a user's perspective, the **logical** size of a + // stored object can be significantly larger. The relationship between the + // physical and logical object sizes is governed by the following formula + // + // ```math + // \mathrm{Stored\ Object\ Size} \le + // \frac{ + // \left(\mathrm{Max\ Object\ Size}\right)^2 + // }{ + // \mathrm{Object\ ID\ Size} + // } + // ``` + // + // This arises from the fact that a tombstone, also being an object, stores + // the IDs of inhumed objects and cannot be divided into smaller objects, + // thus having an upper limit for its size. + // + // For example, if: + // * Max Object Size Size = 64 MiB; + // * Object ID Size = 32 B; + // + // then: + // ```math + // \mathrm{Stored\ Object\ Size} \le + // \frac{\left(64\ \mathrm{MiB}\right)^2}{32\ \mathrm{B}} = + // \frac{2^{52}}{2^5}\ \mathrm{B} = + // 2^{47}\ \mathrm{B} = + // 128\ \mathrm{TiB} + // ``` // - **WithdrawFee** \ // Fee paid for withdrawal of funds paid by the account owner. // Value: little-endian integer. Default: 0. From 5602b8fa2a47c0aea528276f5dce3124cf07542c Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 5 Sep 2024 16:24:35 +0300 Subject: [PATCH 425/440] [#50] *: Replace NeoFS with FrostFS in doc comments Signed-off-by: Aleksey Savchuk --- accounting/service.proto | 18 +++++++++--------- accounting/types.proto | 2 +- acl/types.proto | 6 +++--- container/service.proto | 12 ++++++------ container/types.proto | 2 +- netmap/service.proto | 8 ++++---- netmap/types.proto | 38 +++++++++++++++++++------------------- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 11 ++++++----- session/service.proto | 2 +- session/types.proto | 8 ++++---- status/types.proto | 14 +++++++------- tombstone/types.proto | 6 +++--- 14 files changed, 66 insertions(+), 65 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index ac988c9..eedd4ce 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -9,13 +9,13 @@ import "accounting/types.proto"; import "refs/types.proto"; import "session/types.proto"; -// Accounting service provides methods for interaction with NeoFS sidechain via -// other NeoFS nodes to get information about the account balance. Deposit and -// Withdraw operations can't be implemented here, as they require Mainnet NeoFS -// smart contract invocation. Transfer operations between internal NeoFS -// accounts are possible if both use the same token type. +// Accounting service provides methods for interaction with FrostFS sidechain +// via other FrostFS nodes to get information about the account balance. Deposit +// and Withdraw operations can't be implemented here, as they require Mainnet +// FrostFS smart contract invocation. Transfer operations between internal +// FrostFS accounts are possible if both use the same token type. service AccountingService { - // Returns the amount of funds in GAS token for the requested NeoFS account. + // Returns the amount of funds in GAS token for the requested FrostFS account. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -27,9 +27,9 @@ service AccountingService { // BalanceRequest message message BalanceRequest { // To indicate the account for which the balance is requested, its identifier - // is used. It can be any existing account in NeoFS sidechain `Balance` smart - // contract. If omitted, client implementation MUST set it to the request's - // signer `OwnerID`. + // is used. It can be any existing account in FrostFS sidechain `Balance` + // smart contract. If omitted, client implementation MUST set it to the + // request's signer `OwnerID`. message Body { // Valid user identifier in `OwnerID` format for which the balance is // requested. Required field. diff --git a/accounting/types.proto b/accounting/types.proto index eadf9a8..5dd9b50 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -5,7 +5,7 @@ package neo.fs.v2.accounting; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/accounting/grpc;accounting"; option csharp_namespace = "Neo.FileStorage.API.Accounting"; -// Standard floating point data type can't be used in NeoFS due to inexactness +// Standard floating point data type can't be used in FrostFS due to inexactness // of the result when doing lots of small number operations. To solve the lost // precision issue, special `Decimal` format is used for monetary computations. // diff --git a/acl/types.proto b/acl/types.proto index b36df14..fdaffd4 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -89,14 +89,14 @@ enum HeaderType { // Filter object headers OBJECT = 2; - // Filter service headers. These are not processed by NeoFS nodes and + // Filter service headers. These are not processed by FrostFS nodes and // exist for service use only. SERVICE = 3; } // Describes a single eACL rule. message EACLRecord { - // NeoFS request Verb to match + // FrostFS request Verb to match Operation operation = 1 [ json_name = "operation" ]; // Rule execution result. Either allows or denies access if filters match. @@ -165,7 +165,7 @@ message EACLRecord { // Extended ACL rules table. A list of ACL rules defined additionally to Basic // ACL. Extended ACL rules can be attached to a container and can be updated // or may be defined in `BearerToken` structure. Please see the corresponding -// NeoFS Technical Specification section for detailed description. +// FrostFS Technical Specification section for detailed description. message EACLTable { // eACL format version. Effectively, the version of API library used to create // eACL Table. diff --git a/container/service.proto b/container/service.proto index f5bebf0..f1f22de 100644 --- a/container/service.proto +++ b/container/service.proto @@ -11,8 +11,8 @@ import "refs/types.proto"; import "session/types.proto"; // `ContainerService` provides API to interact with `Container` smart contract -// in NeoFS sidechain via other NeoFS nodes. All of those actions can be done -// equivalently by directly issuing transactions and RPC calls to sidechain +// in FrostFS sidechain via other FrostFS nodes. All of those actions can be +// done equivalently by directly issuing transactions and RPC calls to sidechain // nodes. service ContainerService { // `Put` invokes `Container` smart contract's `Put` method and returns @@ -64,7 +64,7 @@ service ContainerService { rpc List(ListRequest) returns (ListResponse); } -// New NeoFS Container creation request +// New FrostFS Container creation request message PutRequest { // Container creation request has container structure's signature as a // separate field. It's not stored in sidechain, just verified on container @@ -72,7 +72,7 @@ message PutRequest { // the stable-marshalled container strucutre, hence there is no need for // additional signature checks. message Body { - // Container structure to register in NeoFS + // Container structure to register in FrostFS container.Container container = 1; // Signature of a stable-marshalled container according to RFC-6979. @@ -91,7 +91,7 @@ message PutRequest { neo.fs.v2.session.RequestVerificationHeader verify_header = 3; } -// New NeoFS Container creation response +// New FrostFS Container creation response message PutResponse { // Container put response body contains information about the newly registered // container as seen by `Container` smart contract. `ContainerID` can be @@ -120,7 +120,7 @@ message DeleteRequest { // the container owner's intent. The signature will be verified by `Container` // smart contract, so signing algorithm must be supported by NeoVM. message Body { - // Identifier of the container to delete from NeoFS + // Identifier of the container to delete from FrostFS neo.fs.v2.refs.ContainerID container_id = 1; // `ContainerID` signed with the container owner's key according to diff --git a/container/types.proto b/container/types.proto index 8b4a8a9..d133a45 100644 --- a/container/types.proto +++ b/container/types.proto @@ -50,7 +50,7 @@ message Container { // (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ // Disables homomorphic hashing for the container if the value equals "true" // string. Any other values are interpreted as missing attribute. Container - // could be accepted in a NeoFS network only if the global network hashing + // could be accepted in a FrostFS network only if the global network hashing // configuration value corresponds with that attribute's value. After // container inclusion, network setting is ignored. // diff --git a/netmap/service.proto b/netmap/service.proto index f5e7d9f..dce43f4 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -12,7 +12,7 @@ import "session/types.proto"; // `NetmapService` provides methods to work with `Network Map` and the // information required to build it. The resulting `Network Map` is stored in // sidechain `Netmap` smart contract, while related information can be obtained -// from other NeoFS nodes. +// from other FrostFS nodes. service NetmapService { // Get NodeInfo structure from the particular node directly. // Node information can be taken from `Netmap` smart contract. In some cases, @@ -27,7 +27,7 @@ service NetmapService { // - Common failures (SECTION_FAILURE_COMMON). rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); - // Read recent information about the NeoFS network. + // Read recent information about the FrostFS network. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -35,7 +35,7 @@ service NetmapService { // - Common failures (SECTION_FAILURE_COMMON). rpc NetworkInfo(NetworkInfoRequest) returns (NetworkInfoResponse); - // Returns network map snapshot of the current NeoFS epoch. + // Returns network map snapshot of the current FrostFS epoch. // // Statuses: // - **OK** (0, SECTION_SUCCESS): @@ -65,7 +65,7 @@ message LocalNodeInfoRequest { message LocalNodeInfoResponse { // Local Node Info, including API Version in use. message Body { - // Latest NeoFS API version in use + // Latest FrostFS API version in use neo.fs.v2.refs.Version version = 1; // NodeInfo structure with recent information from node itself diff --git a/netmap/types.proto b/netmap/types.proto index dfaac13..969790c 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -122,7 +122,7 @@ message PlacementPolicy { // bucket repeated Replica replicas = 1 [ json_name = "replicas" ]; - // Container backup factor controls how deep NeoFS will search for nodes + // Container backup factor controls how deep FrostFS will search for nodes // alternatives to include into container's nodes subset uint32 container_backup_factor = 2 [ json_name = "containerBackupFactor" ]; @@ -136,25 +136,25 @@ message PlacementPolicy { bool unique = 5 [ json_name = "unique" ]; } -// NeoFS node description +// FrostFS node description message NodeInfo { - // Public key of the NeoFS node in a binary format + // Public key of the FrostFS node in a binary format bytes public_key = 1 [ json_name = "publicKey" ]; // Ways to connect to a node repeated string addresses = 2 [ json_name = "addresses" ]; - // Administrator-defined Attributes of the NeoFS Storage Node. + // Administrator-defined Attributes of the FrostFS Storage Node. // // `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 // string. Value can't be empty. // // Attributes can be constructed into a chain of attributes: any attribute can // have a parent attribute and a child attribute (except the first and the - // last one). A string representation of the chain of attributes in NeoFS + // last one). A string representation of the chain of attributes in FrostFS // Storage Node configuration uses ":" and "/" symbols, e.g.: // - // `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` + // `FrostFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` // // Therefore the string attribute representation in the Node configuration // must use "\:", "\/" and "\\" escaped symbols if any of them appears in an @@ -210,7 +210,7 @@ message NodeInfo { // Must contain a comma-separated list of multi-addresses. // // For detailed description of each well-known attribute please see the - // corresponding section in NeoFS Technical Specification. + // corresponding section in FrostFS Technical Specification. message Attribute { // Key of the node attribute string key = 1 [ json_name = "key" ]; @@ -222,13 +222,13 @@ message NodeInfo { // `Country`. repeated string parents = 3 [ json_name = "parents" ]; } - // Carries list of the NeoFS node attributes in a key-value form. Key name + // Carries list of the FrostFS node attributes in a key-value form. Key name // must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo // structures with duplicated attribute names or attributes with empty values // will be considered invalid. repeated Attribute attributes = 3 [ json_name = "attributes" ]; - // Represents the enumeration of various states of the NeoFS node. + // Represents the enumeration of various states of the FrostFS node. enum State { // Unknown state UNSPECIFIED = 0; @@ -243,7 +243,7 @@ message NodeInfo { MAINTENANCE = 3; } - // Carries state of the NeoFS node + // Carries state of the FrostFS node State state = 4 [ json_name = "state" ]; } @@ -256,7 +256,7 @@ message Netmap { repeated NodeInfo nodes = 2 [ json_name = "nodes" ]; } -// NeoFS network configuration +// FrostFS network configuration message NetworkConfig { // Single configuration parameter. Key MUST be network-unique. // @@ -275,7 +275,7 @@ message NetworkConfig { // Fee paid for container creation by the container owner. // Value: little-endian integer. Default: 0. // - **EpochDuration** \ - // NeoFS epoch duration measured in Sidechain blocks. + // FrostFS epoch duration measured in Sidechain blocks. // Value: little-endian integer. Default: 0. // - **HomomorphicHashingDisabled** \ // Flag of disabling the homomorphic hashing of objects' payload. @@ -287,11 +287,11 @@ message NetworkConfig { // Flag allowing setting the MAINTENANCE state to storage nodes. // Value: true if any byte != 0. Default: false. // - **MaxObjectSize** \ - // Maximum size of physically stored NeoFS object measured in bytes. + // Maximum size of physically stored FrostFS object measured in bytes. // Value: little-endian integer. Default: 0. // // This value refers to the maximum size of a **physically** stored object - // in NeoFS. However, from a user's perspective, the **logical** size of a + // in FrostFS. However, from a user's perspective, the **logical** size of a // stored object can be significantly larger. The relationship between the // physical and logical object sizes is governed by the following formula // @@ -340,18 +340,18 @@ message NetworkConfig { repeated Parameter parameters = 1 [ json_name = "parameters" ]; } -// Information about NeoFS network +// Information about FrostFS network message NetworkInfo { - // Number of the current epoch in the NeoFS network + // Number of the current epoch in the FrostFS network uint64 current_epoch = 1 [ json_name = "currentEpoch" ]; - // Magic number of the sidechain of the NeoFS network + // Magic number of the sidechain of the FrostFS network uint64 magic_number = 2 [ json_name = "magicNumber" ]; - // MillisecondsPerBlock network parameter of the sidechain of the NeoFS + // MillisecondsPerBlock network parameter of the sidechain of the FrostFS // network int64 ms_per_block = 3 [ json_name = "msPerBlock" ]; - // NeoFS network configuration + // FrostFS network configuration NetworkConfig network_config = 4 [ json_name = "networkConfig" ]; } diff --git a/object/service.proto b/object/service.proto index 2c53297..e6ab5e0 100644 --- a/object/service.proto +++ b/object/service.proto @@ -151,7 +151,7 @@ service ObjectService { rpc Head(HeadRequest) returns (HeadResponse); // Search objects in container. Search query allows to match by Object - // Header's filed values. Please see the corresponding NeoFS Technical + // Header's filed values. Please see the corresponding FrostFS Technical // Specification section for more details. // // Extended headers can change `Search` behaviour: diff --git a/object/types.proto b/object/types.proto index be8f348..6e9469b 100644 --- a/object/types.proto +++ b/object/types.proto @@ -155,7 +155,7 @@ message Header { // MIME Content Type of object's payload // // For detailed description of each well-known attribute please see the - // corresponding section in NeoFS Technical Specification. + // corresponding section in FrostFS Technical Specification. message Attribute { // string key to the object attribute string key = 1 [ json_name = "key" ]; diff --git a/refs/types.proto b/refs/types.proto index ebc076f..fe12ec6 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -5,7 +5,7 @@ package neo.fs.v2.refs; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc;refs"; option csharp_namespace = "Neo.FileStorage.API.Refs"; -// Objects in NeoFS are addressed by their ContainerID and ObjectID. +// Objects in FrostFS are addressed by their ContainerID and ObjectID. // // String presentation of `Address` is a concatenation of string encoded // `ContainerID` and `ObjectID` delimited by '/' character. @@ -16,8 +16,9 @@ message Address { ObjectID object_id = 2 [ json_name = "objectID" ]; } -// NeoFS Object unique identifier. Objects are immutable and content-addressed. -// It means `ObjectID` will change if the `header` or the `payload` changes. +// FrostFS Object unique identifier. Objects are immutable and +// content-addressed. It means `ObjectID` will change if the `header` or the +// `payload` changes. // // `ObjectID` is a 32 byte long // [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of @@ -37,7 +38,7 @@ message ObjectID { bytes value = 1 [ json_name = "value" ]; } -// NeoFS container identifier. Container structures are immutable and +// FrostFS container identifier. Container structures are immutable and // content-addressed. // // `ContainerID` is a 32 byte long @@ -90,7 +91,7 @@ message Version { uint32 minor = 2 [ json_name = "minor" ]; } -// Signature of something in NeoFS. +// Signature of something in FrostFS. message Signature { // Public key used for signing bytes key = 1 [ json_name = "key" ]; diff --git a/session/service.proto b/session/service.proto index 6e12147..544556b 100644 --- a/session/service.proto +++ b/session/service.proto @@ -11,7 +11,7 @@ import "session/types.proto"; // `SessionService` allows to establish a temporary trust relationship between // two peer nodes and generate a `SessionToken` as the proof of trust to be // attached in requests for further verification. Please see corresponding -// section of NeoFS Technical Specification for details. +// section of FrostFS Technical Specification for details. service SessionService { // Open a new session between two peers. // diff --git a/session/types.proto b/session/types.proto index e039081..c5bb695 100644 --- a/session/types.proto +++ b/session/types.proto @@ -50,7 +50,7 @@ message ObjectSessionContext { refs.ContainerID container = 1 [ json_name = "container" ]; // Indicates which objects the session is spread to. Objects are expected - // to be stored in the NeoFS container referenced by `container` field. + // to be stored in the FrostFS container referenced by `container` field. // Each element MUST have correct format. repeated refs.ObjectID objects = 2 [ json_name = "objects" ]; } @@ -88,7 +88,7 @@ message ContainerSessionContext { refs.ContainerID container_id = 3 [ json_name = "containerID" ]; } -// NeoFS Session Token. +// FrostFS Session Token. message SessionToken { // Session Token body message Body { @@ -126,7 +126,7 @@ message SessionToken { } // Session Token contains the proof of trust between peers to be attached in // requests for further verification. Please see corresponding section of - // NeoFS Technical Specification for details. + // FrostFS Technical Specification for details. Body body = 1 [ json_name = "body" ]; // Signature of `SessionToken` information @@ -186,7 +186,7 @@ message RequestMetaHeader { // `RequestMetaHeader` of the origin request RequestMetaHeader origin = 7 [ json_name = "origin" ]; - // NeoFS network magic. Must match the value for the network + // FrostFS network magic. Must match the value for the network // that the server belongs to. uint64 magic_number = 8 [ json_name = "magicNumber" ]; } diff --git a/status/types.proto b/status/types.proto index 302a11b..d3e09fd 100644 --- a/status/types.proto +++ b/status/types.proto @@ -5,12 +5,12 @@ package neo.fs.v2.status; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc;status"; option csharp_namespace = "Neo.FileStorage.API.Status"; -// Declares the general format of the status returns of the NeoFS RPC protocol. -// Status is present in all response messages. Each RPC of NeoFS protocol -// describes the possible outcomes and details of the operation. +// Declares the general format of the status returns of the FrostFS RPC +// protocol. Status is present in all response messages. Each RPC of FrostFS +// protocol describes the possible outcomes and details of the operation. // // Each status is assigned a one-to-one numeric code. Any unique result of an -// operation in NeoFS is unambiguously associated with the code value. +// operation in FrostFS is unambiguously associated with the code value. // // Numerical set of codes is split into 1024-element sections. An enumeration // is defined for each section. Values can be referred to in the following ways: @@ -78,7 +78,7 @@ enum Section { SECTION_APE_MANAGER = 5; } -// Section of NeoFS successful return codes. +// Section of FrostFS successful return codes. enum Success { // [**0**] Default success. Not detailed. // If the server cannot match successful outcome to the code, it should @@ -93,9 +93,9 @@ enum CommonFail { // use this code. INTERNAL = 0; - // [**1025**] Wrong magic of the NeoFS network. + // [**1025**] Wrong magic of the FrostFS network. // Details: - // - [**0**] Magic number of the served NeoFS network (big-endian 64-bit + // - [**0**] Magic number of the served FrostFS network (big-endian 64-bit // unsigned integer). WRONG_MAGIC_NUMBER = 1; diff --git a/tombstone/types.proto b/tombstone/types.proto index 6547958..ccf1257 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -8,10 +8,10 @@ option csharp_namespace = "Neo.FileStorage.API.Tombstone"; import "refs/types.proto"; // Tombstone keeps record of deleted objects for a few epochs until they are -// purged from the NeoFS network. +// purged from the FrostFS network. message Tombstone { - // Last NeoFS epoch number of the tombstone lifetime. It's set by the - // tombstone creator depending on the current NeoFS network settings. A + // Last FrostFS epoch number of the tombstone lifetime. It's set by the + // tombstone creator depending on the current FrostFS network settings. A // tombstone object must have the same expiration epoch value in // `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) // attribute. Otherwise, the tombstone will be rejected by a storage node. From 2a46a9ea0a9c51165d07c1e02b76e56408bdd12d Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 5 Sep 2024 16:27:53 +0300 Subject: [PATCH 426/440] [#50] *: Regenerate docs Signed-off-by: Aleksey Savchuk --- proto-docs/accounting.md | 20 ++-- proto-docs/acl.md | 15 +-- proto-docs/ape.md | 4 +- proto-docs/container.md | 235 ++------------------------------------- proto-docs/netmap.md | 80 +++++++++---- proto-docs/object.md | 28 +++-- proto-docs/refs.md | 11 +- proto-docs/session.md | 10 +- proto-docs/status.md | 12 +- proto-docs/tombstone.md | 4 +- 10 files changed, 118 insertions(+), 301 deletions(-) diff --git a/proto-docs/accounting.md b/proto-docs/accounting.md index cdc82a1..a8bfd16 100644 --- a/proto-docs/accounting.md +++ b/proto-docs/accounting.md @@ -35,11 +35,11 @@ ### Service "neo.fs.v2.accounting.AccountingService" -Accounting service provides methods for interaction with NeoFS sidechain via -other NeoFS nodes to get information about the account balance. Deposit and -Withdraw operations can't be implemented here, as they require Mainnet NeoFS -smart contract invocation. Transfer operations between internal NeoFS -accounts are possible if both use the same token type. +Accounting service provides methods for interaction with FrostFS sidechain +via other FrostFS nodes to get information about the account balance. Deposit +and Withdraw operations can't be implemented here, as they require Mainnet +FrostFS smart contract invocation. Transfer operations between internal +FrostFS accounts are possible if both use the same token type. ``` rpc Balance(BalanceRequest) returns (BalanceResponse); @@ -48,7 +48,7 @@ rpc Balance(BalanceRequest) returns (BalanceResponse); #### Method Balance -Returns the amount of funds in GAS token for the requested NeoFS account. +Returns the amount of funds in GAS token for the requested FrostFS account. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -78,9 +78,9 @@ BalanceRequest message ### Message BalanceRequest.Body To indicate the account for which the balance is requested, its identifier -is used. It can be any existing account in NeoFS sidechain `Balance` smart -contract. If omitted, client implementation MUST set it to the request's -signer `OwnerID`. +is used. It can be any existing account in FrostFS sidechain `Balance` +smart contract. If omitted, client implementation MUST set it to the +request's signer `OwnerID`. | Field | Type | Label | Description | @@ -131,7 +131,7 @@ rounding. ### Message Decimal -Standard floating point data type can't be used in NeoFS due to inexactness +Standard floating point data type can't be used in FrostFS due to inexactness of the result when doing lots of small number operations. To solve the lost precision issue, special `Decimal` format is used for monetary computations. diff --git a/proto-docs/acl.md b/proto-docs/acl.md index bac7747..fdc7ade 100644 --- a/proto-docs/acl.md +++ b/proto-docs/acl.md @@ -71,11 +71,12 @@ Deprecated: eACL tables are no longer relevant - `APEOverrides` should be used i ### Message BearerToken.Body.APEOverride APEOverride is the list of APE chains defined for a target. -These chains are meant to serve as overrides to the already defined (or even undefined) -APE chains for the target (see contract `Policy`). +These chains are meant to serve as overrides to the already defined (or +even undefined) APE chains for the target (see contract `Policy`). -The server-side processing of the bearer token with set APE overrides must verify if a client is permitted -to override chains for the target, preventing unauthorized access through the APE mechanism. +The server-side processing of the bearer token with set APE overrides +must verify if a client is permitted to override chains for the target, +preventing unauthorized access through the APE mechanism. | Field | Type | Label | Description | @@ -106,7 +107,7 @@ Describes a single eACL rule. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| operation | [Operation](#neo.fs.v2.acl.Operation) | | NeoFS request Verb to match | +| operation | [Operation](#neo.fs.v2.acl.Operation) | | FrostFS request Verb to match | | action | [Action](#neo.fs.v2.acl.Action) | | Rule execution result. Either allows or denies access if filters match. | | filters | [EACLRecord.Filter](#neo.fs.v2.acl.EACLRecord.Filter) | repeated | List of filters to match and see if rule is applicable | | targets | [EACLRecord.Target](#neo.fs.v2.acl.EACLRecord.Target) | repeated | List of target subjects to apply ACL rule to | @@ -174,7 +175,7 @@ keys to match. Extended ACL rules table. A list of ACL rules defined additionally to Basic ACL. Extended ACL rules can be attached to a container and can be updated or may be defined in `BearerToken` structure. Please see the corresponding -NeoFS Technical Specification section for detailed description. +FrostFS Technical Specification section for detailed description. | Field | Type | Label | Description | @@ -210,7 +211,7 @@ Enumeration of possible sources of Headers to apply filters. | HEADER_UNSPECIFIED | 0 | Unspecified header, default value. | | REQUEST | 1 | Filter request headers | | OBJECT | 2 | Filter object headers | -| SERVICE | 3 | Filter service headers. These are not processed by NeoFS nodes and exist for service use only. | +| SERVICE | 3 | Filter service headers. These are not processed by FrostFS nodes and exist for service use only. | diff --git a/proto-docs/ape.md b/proto-docs/ape.md index 39bc946..9795bc5 100644 --- a/proto-docs/ape.md +++ b/proto-docs/ape.md @@ -72,8 +72,8 @@ TargetType is a type target to which a rule chain is defined. | ----------- | ----- | -------- | --------- | ----------- | | double | | double | double | float | | float | | float | float | float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers - if your field is likely to have negative values, use sint32 instead. | int32 | int | int | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers - if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | | uint32 | Uses variable-length encoding. | uint32 | int | int/long | | uint64 | Uses variable-length encoding. | uint64 | long | int/long | | sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | diff --git a/proto-docs/container.md b/proto-docs/container.md index 3df304f..76cc115 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -8,19 +8,10 @@ - [ContainerService](#neo.fs.v2.container.ContainerService) - Messages - - [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) - - [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) - - [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) - - [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) - - [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) - [DeleteRequest](#neo.fs.v2.container.DeleteRequest) - [DeleteRequest.Body](#neo.fs.v2.container.DeleteRequest.Body) - [DeleteResponse](#neo.fs.v2.container.DeleteResponse) - [DeleteResponse.Body](#neo.fs.v2.container.DeleteResponse.Body) - - [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) - - [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) - - [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) - - [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) - [GetRequest](#neo.fs.v2.container.GetRequest) - [GetRequest.Body](#neo.fs.v2.container.GetRequest.Body) - [GetResponse](#neo.fs.v2.container.GetResponse) @@ -33,10 +24,6 @@ - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) - [PutResponse](#neo.fs.v2.container.PutResponse) - [PutResponse.Body](#neo.fs.v2.container.PutResponse.Body) - - [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) - - [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) - - [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) - - [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) - [container/types.proto](#container/types.proto) @@ -62,8 +49,8 @@ ### Service "neo.fs.v2.container.ContainerService" `ContainerService` provides API to interact with `Container` smart contract -in NeoFS sidechain via other NeoFS nodes. All of those actions can be done -equivalently by directly issuing transactions and RPC calls to sidechain +in FrostFS sidechain via other FrostFS nodes. All of those actions can be +done equivalently by directly issuing transactions and RPC calls to sidechain nodes. ``` @@ -71,9 +58,6 @@ rpc Put(PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Get(GetRequest) returns (GetResponse); rpc List(ListRequest) returns (ListResponse); -rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse); -rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse); -rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse); ``` @@ -141,114 +125,9 @@ Statuses: | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) | -#### Method SetExtendedACL - -Invokes 'SetEACL' method of 'Container` smart contract and returns response -immediately. After one more block in sidechain, changes in an Extended ACL -are added into smart contract storage. - -Statuses: -- **OK** (0, SECTION_SUCCESS): \ - request to save container eACL has been sent to the sidechain; -- Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - set container eACL access denied. - -| Name | Input | Output | -| ---- | ----- | ------ | -| SetExtendedACL | [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) | [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) | -#### Method GetExtendedACL - -Returns Extended ACL table and signature from `Container` smart contract -storage. - -Statuses: -- **OK** (0, SECTION_SUCCESS): \ - container eACL has been successfully read; -- Common failures (SECTION_FAILURE_COMMON); -- **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \ - container not found; -- **EACL_NOT_FOUND** (3073, SECTION_CONTAINER): \ - eACL table not found; -- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ - access to container eACL is denied. - -| Name | Input | Output | -| ---- | ----- | ------ | -| GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) | -#### Method AnnounceUsedSpace - -Announces the space values used by the container for P2P synchronization. - -Statuses: -- **OK** (0, SECTION_SUCCESS): \ - estimation of used space has been successfully announced; -- Common failures (SECTION_FAILURE_COMMON). - -| Name | Input | Output | -| ---- | ----- | ------ | -| AnnounceUsedSpace | [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) | [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) | - - -### Message AnnounceUsedSpaceRequest -Announce container used space - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceUsedSpaceRequest.Body](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body) | | Body of announce used space request message. | -| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceUsedSpaceRequest.Body -Container used space announcement body. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| announcements | [AnnounceUsedSpaceRequest.Body.Announcement](#neo.fs.v2.container.AnnounceUsedSpaceRequest.Body.Announcement) | repeated | List of announcements. If nodes share several containers, announcements are transferred in a batch. | - - - - -### Message AnnounceUsedSpaceRequest.Body.Announcement -Announcement contains used space information for a single container. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| epoch | [uint64](#uint64) | | Epoch number for which the container size estimation was produced. | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container. | -| used_space | [uint64](#uint64) | | Used space is a sum of object payload sizes of a specified container, stored in the node. It must not include inhumed objects. | - - - - -### Message AnnounceUsedSpaceResponse -Announce container used space - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [AnnounceUsedSpaceResponse.Body](#neo.fs.v2.container.AnnounceUsedSpaceResponse.Body) | | Body of announce used space response message. | -| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message AnnounceUsedSpaceResponse.Body -`AnnounceUsedSpaceResponse` has an empty body because announcements are -one way communication. - - - ### Message DeleteRequest @@ -272,7 +151,7 @@ smart contract, so signing algorithm must be supported by NeoVM. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to delete from NeoFS | +| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container to delete from FrostFS | | signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | `ContainerID` signed with the container owner's key according to RFC-6979. | @@ -298,58 +177,6 @@ and done via consensus in Inner Ring nodes. - - -### Message GetExtendedACLRequest -Get Extended ACL - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [GetExtendedACLRequest.Body](#neo.fs.v2.container.GetExtendedACLRequest.Body) | | Body of get extended acl request message. | -| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message GetExtendedACLRequest.Body -Get Extended ACL request body - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Identifier of the container having Extended ACL | - - - - -### Message GetExtendedACLResponse -Get Extended ACL - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [GetExtendedACLResponse.Body](#neo.fs.v2.container.GetExtendedACLResponse.Body) | | Body of get extended acl response message. | -| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message GetExtendedACLResponse.Body -Get Extended ACL Response body can be empty if the requested container does -not have Extended ACL Table attached or Extended ACL has not been allowed -at the time of container creation. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL requested, if available | -| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of stable-marshalled Extended ACL according to RFC-6979. | -| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token if Extended ACL was set within a session | - - ### Message GetRequest @@ -452,7 +279,7 @@ List containers response body. ### Message PutRequest -New NeoFS Container creation request +New FrostFS Container creation request | Field | Type | Label | Description | @@ -474,14 +301,14 @@ additional signature checks. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| container | [Container](#neo.fs.v2.container.Container) | | Container structure to register in NeoFS | +| container | [Container](#neo.fs.v2.container.Container) | | Container structure to register in FrostFS | | signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of a stable-marshalled container according to RFC-6979. | ### Message PutResponse -New NeoFS Container creation response +New FrostFS Container creation response | Field | Type | Label | Description | @@ -504,54 +331,6 @@ returned here to make sure everything has been done as expected. | ----- | ---- | ----- | ----------- | | container_id | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Unique identifier of the newly created container | - - - -### Message SetExtendedACLRequest -Set Extended ACL - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [SetExtendedACLRequest.Body](#neo.fs.v2.container.SetExtendedACLRequest.Body) | | Body of set extended acl request message. | -| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message SetExtendedACLRequest.Body -Set Extended ACL request body does not have separate `ContainerID` -reference. It will be taken from `EACLTable.container_id` field. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| eacl | [neo.fs.v2.acl.EACLTable](#neo.fs.v2.acl.EACLTable) | | Extended ACL table to set for the container | -| signature | [neo.fs.v2.refs.SignatureRFC6979](#neo.fs.v2.refs.SignatureRFC6979) | | Signature of stable-marshalled Extended ACL table according to RFC-6979. | - - - - -### Message SetExtendedACLResponse -Set Extended ACL - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| body | [SetExtendedACLResponse.Body](#neo.fs.v2.container.SetExtendedACLResponse.Body) | | Body of set extended acl response message. | -| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | -| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | - - - - -### Message SetExtendedACLResponse.Body -`SetExtendedACLResponse` has an empty body because the operation is -asynchronous and the update should be reflected in `Container` smart -contract's storage after next block is issued in sidechain. - - @@ -612,7 +391,7 @@ There are some "well-known" attributes affecting system behaviour: (`__NEOFS__DISABLE_HOMOMORPHIC_HASHING` is deprecated) \ Disables homomorphic hashing for the container if the value equals "true" string. Any other values are interpreted as missing attribute. Container - could be accepted in a NeoFS network only if the global network hashing + could be accepted in a FrostFS network only if the global network hashing configuration value corresponds with that attribute's value. After container inclusion, network setting is ignored. diff --git a/proto-docs/netmap.md b/proto-docs/netmap.md index cbf5593..b49287c 100644 --- a/proto-docs/netmap.md +++ b/proto-docs/netmap.md @@ -55,7 +55,7 @@ `NetmapService` provides methods to work with `Network Map` and the information required to build it. The resulting `Network Map` is stored in sidechain `Netmap` smart contract, while related information can be obtained -from other NeoFS nodes. +from other FrostFS nodes. ``` rpc LocalNodeInfo(LocalNodeInfoRequest) returns (LocalNodeInfoResponse); @@ -83,7 +83,7 @@ information about the server has been successfully read; | LocalNodeInfo | [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) | [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) | #### Method NetworkInfo -Read recent information about the NeoFS network. +Read recent information about the FrostFS network. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -95,7 +95,7 @@ information about the current network state has been successfully read; | NetworkInfo | [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) | [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) | #### Method NetmapSnapshot -Returns network map snapshot of the current NeoFS epoch. +Returns network map snapshot of the current FrostFS epoch. Statuses: - **OK** (0, SECTION_SUCCESS): @@ -149,7 +149,7 @@ Local Node Info, including API Version in use. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Latest NeoFS API version in use | +| version | [neo.fs.v2.refs.Version](#neo.fs.v2.refs.Version) | | Latest FrostFS API version in use | | node_info | [NodeInfo](#neo.fs.v2.netmap.NodeInfo) | | NodeInfo structure with recent information from node itself | @@ -287,7 +287,7 @@ Network map structure ### Message NetworkConfig -NeoFS network configuration +FrostFS network configuration | Field | Type | Label | Description | @@ -315,7 +315,7 @@ System parameters: Fee paid for container creation by the container owner. Value: little-endian integer. Default: 0. - **EpochDuration** \ - NeoFS epoch duration measured in Sidechain blocks. + FrostFS epoch duration measured in Sidechain blocks. Value: little-endian integer. Default: 0. - **HomomorphicHashingDisabled** \ Flag of disabling the homomorphic hashing of objects' payload. @@ -327,8 +327,39 @@ System parameters: Flag allowing setting the MAINTENANCE state to storage nodes. Value: true if any byte != 0. Default: false. - **MaxObjectSize** \ - Maximum size of physically stored NeoFS object measured in bytes. + Maximum size of physically stored FrostFS object measured in bytes. Value: little-endian integer. Default: 0. + + This value refers to the maximum size of a **physically** stored object + in FrostFS. However, from a user's perspective, the **logical** size of a + stored object can be significantly larger. The relationship between the + physical and logical object sizes is governed by the following formula + + ```math + \mathrm{Stored\ Object\ Size} \le + \frac{ + \left(\mathrm{Max\ Object\ Size}\right)^2 + }{ + \mathrm{Object\ ID\ Size} + } + ``` + + This arises from the fact that a tombstone, also being an object, stores + the IDs of inhumed objects and cannot be divided into smaller objects, + thus having an upper limit for its size. + + For example, if: + * Max Object Size Size = 64 MiB; + * Object ID Size = 32 B; + + then: + ```math + \mathrm{Stored\ Object\ Size} \le + \frac{\left(64\ \mathrm{MiB}\right)^2}{32\ \mathrm{B}} = + \frac{2^{52}}{2^5}\ \mathrm{B} = + 2^{47}\ \mathrm{B} = + 128\ \mathrm{TiB} + ``` - **WithdrawFee** \ Fee paid for withdrawal of funds paid by the account owner. Value: little-endian integer. Default: 0. @@ -349,45 +380,45 @@ System parameters: ### Message NetworkInfo -Information about NeoFS network +Information about FrostFS network | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network | -| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network | -| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the NeoFS network | -| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | NeoFS network configuration | +| current_epoch | [uint64](#uint64) | | Number of the current epoch in the FrostFS network | +| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the FrostFS network | +| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the FrostFS network | +| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | FrostFS network configuration | ### Message NodeInfo -NeoFS node description +FrostFS node description | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| public_key | [bytes](#bytes) | | Public key of the NeoFS node in a binary format | +| public_key | [bytes](#bytes) | | Public key of the FrostFS node in a binary format | | addresses | [string](#string) | repeated | Ways to connect to a node | -| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the NeoFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. | -| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the NeoFS node | +| attributes | [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute) | repeated | Carries list of the FrostFS node attributes in a key-value form. Key name must be a node-unique valid UTF-8 string. Value can't be empty. NodeInfo structures with duplicated attribute names or attributes with empty values will be considered invalid. | +| state | [NodeInfo.State](#neo.fs.v2.netmap.NodeInfo.State) | | Carries state of the FrostFS node | ### Message NodeInfo.Attribute -Administrator-defined Attributes of the NeoFS Storage Node. +Administrator-defined Attributes of the FrostFS Storage Node. `Attribute` is a Key-Value metadata pair. Key name must be a valid UTF-8 string. Value can't be empty. Attributes can be constructed into a chain of attributes: any attribute can have a parent attribute and a child attribute (except the first and the -last one). A string representation of the chain of attributes in NeoFS +last one). A string representation of the chain of attributes in FrostFS Storage Node configuration uses ":" and "/" symbols, e.g.: - `NEOFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` + `FrostFS_NODE_ATTRIBUTE_1=key1:val1/key2:val2` Therefore the string attribute representation in the Node configuration must use "\:", "\/" and "\\" escaped symbols if any of them appears in an @@ -434,8 +465,8 @@ explicitly set: [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). Calculated automatically from `UN-LOCODE` attribute. * Continent \ - Node's continent name according to the [Seven-Continent model] - (https://en.wikipedia.org/wiki/Continent#Number). Calculated + Node's continent name according to the [Seven-Continent + model](https://en.wikipedia.org/wiki/Continent#Number). Calculated automatically from `UN-LOCODE` attribute. * ExternalAddr Node's preferred way for communications with external clients. @@ -443,7 +474,7 @@ explicitly set: Must contain a comma-separated list of multi-addresses. For detailed description of each well-known attribute please see the -corresponding section in NeoFS Technical Specification. +corresponding section in FrostFS Technical Specification. | Field | Type | Label | Description | @@ -464,7 +495,7 @@ storage policy definition languages. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a named bucket | -| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset | +| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep FrostFS will search for nodes alternatives to include into container's nodes subset | | selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset | | filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors | | unique | [bool](#bool) | | Unique flag defines non-overlapping application for replicas | @@ -522,7 +553,7 @@ hash distance. ### NodeInfo.State -Represents the enumeration of various states of the NeoFS node. +Represents the enumeration of various states of the FrostFS node. | Name | Number | Description | | ---- | ------ | ----------- | @@ -550,6 +581,7 @@ Operations on filters | OR | 7 | Logical OR | | AND | 8 | Logical AND | | NOT | 9 | Logical negation | +| LIKE | 10 | Matches pattern | diff --git a/proto-docs/object.md b/proto-docs/object.md index 27981e5..dd30ede 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -254,7 +254,7 @@ Statuses: #### Method Search Search objects in container. Search query allows to match by Object -Header's filed values. Please see the corresponding NeoFS Technical +Header's filed values. Please see the corresponding FrostFS Technical Specification section for more details. Extended headers can change `Search` behaviour: @@ -404,16 +404,20 @@ been deleted; #### Method Patch Patch the object. Request uses gRPC stream. First message must set -the address of the object that is going to get patched. If the object's attributes -are patched, then these attrubutes must be set only within the first stream message. +the address of the object that is going to get patched. If the object's +attributes are patched, then these attrubutes must be set only within the +first stream message. -If the patch request is performed by NOT the object's owner but if the actor has the permission -to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner -loses the object's ownership after the patch request is successfully done. +If the patch request is performed by NOT the object's owner but if the +actor has the permission to perform the patch, then `OwnerID` of the object +is changed. In this case the object's owner loses the object's ownership +after the patch request is successfully done. -As objects are content-addressable the patching causes new object ID generation for the patched object. -This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases: -1. The chunk of the applying patch contains the same value as the object's payload within the same range; +As objects are content-addressable the patching causes new object ID +generation for the patched object. This object id is set witihn +`PatchResponse`. But the object id may remain unchanged in such cases: +1. The chunk of the applying patch contains the same value as the object's +payload within the same range; 2. The patch that reverts the changes applied by preceding patch; 3. The application of the same patches for the object a few times. @@ -996,8 +1000,8 @@ prefix to the name. Here is the list of fields available via this prefix: * $Object:split.splitID \ 16 byte UUIDv4 used to identify the split object hierarchy parts * $Object:ec.parent \ - If the object is stored according to EC policy, then ec_parent attribute - is set to return an id list of all related EC chunks. + If the object is stored according to EC policy, then ec_parent + attribute is set to return an id list of all related EC chunks. There are some well-known filter aliases to match objects by certain properties: @@ -1160,7 +1164,7 @@ And some well-known attributes used by applications only: MIME Content Type of object's payload For detailed description of each well-known attribute please see the -corresponding section in NeoFS Technical Specification. +corresponding section in FrostFS Technical Specification. | Field | Type | Label | Description | diff --git a/proto-docs/refs.md b/proto-docs/refs.md index 5b559d3..3ad3126 100644 --- a/proto-docs/refs.md +++ b/proto-docs/refs.md @@ -32,7 +32,7 @@ ### Message Address -Objects in NeoFS are addressed by their ContainerID and ObjectID. +Objects in FrostFS are addressed by their ContainerID and ObjectID. String presentation of `Address` is a concatenation of string encoded `ContainerID` and `ObjectID` delimited by '/' character. @@ -65,7 +65,7 @@ Depending on checksum algorithm type, the string presentation may vary: ### Message ContainerID -NeoFS container identifier. Container structures are immutable and +FrostFS container identifier. Container structures are immutable and content-addressed. `ContainerID` is a 32 byte long @@ -90,8 +90,9 @@ with/without paddings are accepted. ### Message ObjectID -NeoFS Object unique identifier. Objects are immutable and content-addressed. -It means `ObjectID` will change if the `header` or the `payload` changes. +FrostFS Object unique identifier. Objects are immutable and +content-addressed. It means `ObjectID` will change if the `header` or the +`payload` changes. `ObjectID` is a 32 byte long [SHA256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash of @@ -141,7 +142,7 @@ with/without paddings are accepted. ### Message Signature -Signature of something in NeoFS. +Signature of something in FrostFS. | Field | Type | Label | Description | diff --git a/proto-docs/session.md b/proto-docs/session.md index 36a73ea..984db48 100644 --- a/proto-docs/session.md +++ b/proto-docs/session.md @@ -48,7 +48,7 @@ `SessionService` allows to establish a temporary trust relationship between two peer nodes and generate a `SessionToken` as the proof of trust to be attached in requests for further verification. Please see corresponding -section of NeoFS Technical Specification for details. +section of FrostFS Technical Specification for details. ``` rpc Create(CreateRequest) returns (CreateResponse); @@ -168,7 +168,7 @@ Carries objects involved in the object session. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | container | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | | Indicates which container the session is spread to. Field MUST be set and correct. | -| objects | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Indicates which objects the session is spread to. Objects are expected to be stored in the NeoFS container referenced by `container` field. Each element MUST have correct format. | +| objects | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | Indicates which objects the session is spread to. Objects are expected to be stored in the FrostFS container referenced by `container` field. Each element MUST have correct format. | @@ -187,7 +187,7 @@ request meta headers are folded in matryoshka style. | session_token | [SessionToken](#neo.fs.v2.session.SessionToken) | | Session token within which the request is sent | | bearer_token | [neo.fs.v2.acl.BearerToken](#neo.fs.v2.acl.BearerToken) | | `BearerToken` with eACL overrides for the request | | origin | [RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | `RequestMetaHeader` of the origin request | -| magic_number | [uint64](#uint64) | | NeoFS network magic. Must match the value for the network that the server belongs to. | +| magic_number | [uint64](#uint64) | | FrostFS network magic. Must match the value for the network that the server belongs to. | @@ -237,12 +237,12 @@ Verification info for the response signed by all intermediate nodes ### Message SessionToken -NeoFS Session Token. +FrostFS Session Token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| body | [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) | | Session Token contains the proof of trust between peers to be attached in requests for further verification. Please see corresponding section of NeoFS Technical Specification for details. | +| body | [SessionToken.Body](#neo.fs.v2.session.SessionToken.Body) | | Session Token contains the proof of trust between peers to be attached in requests for further verification. Please see corresponding section of FrostFS Technical Specification for details. | | signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Signature of `SessionToken` information | diff --git a/proto-docs/status.md b/proto-docs/status.md index 373a7a7..76534fb 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -26,12 +26,12 @@ ### Message Status -Declares the general format of the status returns of the NeoFS RPC protocol. -Status is present in all response messages. Each RPC of NeoFS protocol -describes the possible outcomes and details of the operation. +Declares the general format of the status returns of the FrostFS RPC +protocol. Status is present in all response messages. Each RPC of FrostFS +protocol describes the possible outcomes and details of the operation. Each status is assigned a one-to-one numeric code. Any unique result of an -operation in NeoFS is unambiguously associated with the code value. +operation in FrostFS is unambiguously associated with the code value. Numerical set of codes is split into 1024-element sections. An enumeration is defined for each section. Values can be referred to in the following ways: @@ -98,7 +98,7 @@ Section of failed statuses independent of the operation. | Name | Number | Description | | ---- | ------ | ----------- | | INTERNAL | 0 | [**1024**] Internal server error, default failure. Not detailed. If the server cannot match failed outcome to the code, it should use this code. | -| WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the NeoFS network. Details: - [**0**] Magic number of the served NeoFS network (big-endian 64-bit unsigned integer). | +| WRONG_MAGIC_NUMBER | 1 | [**1025**] Wrong magic of the FrostFS network. Details: - [**0**] Magic number of the served FrostFS network (big-endian 64-bit unsigned integer). | | SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. | | NODE_UNDER_MAINTENANCE | 3 | [**1027**] Node is under maintenance. | | INVALID_ARGUMENT | 4 | [**1028**] Invalid argument error. If the server fails on validation of a request parameter as the client sent it incorrectly, then this code should be used. | @@ -165,7 +165,7 @@ Section of statuses for session-related operations. ### Success -Section of NeoFS successful return codes. +Section of FrostFS successful return codes. | Name | Number | Description | | ---- | ------ | ----------- | diff --git a/proto-docs/tombstone.md b/proto-docs/tombstone.md index 268e9a2..467ad55 100644 --- a/proto-docs/tombstone.md +++ b/proto-docs/tombstone.md @@ -26,12 +26,12 @@ ### Message Tombstone Tombstone keeps record of deleted objects for a few epochs until they are -purged from the NeoFS network. +purged from the FrostFS network. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| expiration_epoch | [uint64](#uint64) | | Last NeoFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current NeoFS network settings. A tombstone object must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Otherwise, the tombstone will be rejected by a storage node. | +| expiration_epoch | [uint64](#uint64) | | Last FrostFS epoch number of the tombstone lifetime. It's set by the tombstone creator depending on the current FrostFS network settings. A tombstone object must have the same expiration epoch value in `__SYSTEM__EXPIRATION_EPOCH` (`__NEOFS__EXPIRATION_EPOCH` is deprecated) attribute. Otherwise, the tombstone will be rejected by a storage node. | | split_id | [bytes](#bytes) | | 16 byte UUID used to identify the split object hierarchy parts. Must be unique inside a container. All objects participating in the split must have the same `split_id` value. | | members | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | repeated | List of objects to be deleted. | From 74bbc3a76bf363d8ae3837c74ea7da511331ef32 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 11 Sep 2024 13:22:24 +0300 Subject: [PATCH 427/440] [#64] Update obsolete URLs Signed-off-by: Vitaliy Potyarkin --- CONTRIBUTING.md | 13 +++++++------ README.md | 7 +++---- doc/release_instructions.md | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c26de50..b6ecdf5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,8 +3,8 @@ First, thank you for contributing! We love and encourage pull requests from everyone. Please follow the guidelines: -- Check the open [issues](https://github.com/TrueCloudLab/frostfs-api/issues) and - [pull requests](https://github.com/TrueCloudLab/frostfs-api/pulls) for existing +- Check the open [issues](https://git.frostfs.info/TrueCloudLab/frostfs-api/issues) and + [pull requests](https://git.frostfs.info/TrueCloudLab/frostfs-api/pulls) for existing discussions. - Open an issue first, to discuss a new feature or enhancement. @@ -25,19 +25,20 @@ Start by forking the `frostfs-api` repository, make changes in a branch and then send a pull request. We encourage pull requests to discuss code changes. Here are the steps in details: -### Set up your GitHub Repository -Fork [NeoFS node upstream](https://github.com/TrueCloudLab/frostfs-api/fork) source +### Set up your repository + +Fork [FrostFS upstream](https://git.frostfs.info/TrueCloudLab/frostfs-api/fork) source repository to your own personal repository. Copy the URL of your fork (you will need it for the `git clone` command below). ```sh -$ git clone https://github.com/TrueCloudLab/frostfs-api +$ git clone https://git.frostfs.info/TrueCloudLab/frostfs-api ``` ### Set up git remote as ``upstream`` ```sh $ cd frostfs-api -$ git remote add upstream https://github.com/TrueCloudLab/frostfs-api +$ git remote add upstream https://git.frostfs.info/TrueCloudLab/frostfs-api $ git fetch upstream $ git merge upstream/master ... diff --git a/README.md b/README.md index 5a262ae..561995d 100644 --- a/README.md +++ b/README.md @@ -2,18 +2,17 @@ FrostFS

- FrostFS API language-agnostic protocol definitions + FrostFS API language-agnostic protocol definitions

--- -![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/TrueCloudLab/frostfs-api?sort=semver) -![License](https://img.shields.io/github/license/TrueCloudLab/frostfs-api.svg?style=popout) +![Release](https://git.frostfs.info/TrueCloudLab/frostfs-api/badges/release.svg) ## Overview FrostFS-API repository is the basis for language-specific libraries, e.g.: -- [frostfs-api-go](https://github.com/TrueCloudLab/frostfs-api-go) +- [frostfs-api-go](https://git.frostfs.info/TrueCloudLab/frostfs-api-go) Those libraries contain compiled protocol buffers definitions, wrapped with language-specific code. Use them to integrate applications with FrostFS. diff --git a/doc/release_instructions.md b/doc/release_instructions.md index 853b08a..28834e4 100644 --- a/doc/release_instructions.md +++ b/doc/release_instructions.md @@ -1,6 +1,6 @@ # Release instructions -This documents outlines the neofs-api release process and can be used as a TODO +This documents outlines the frostfs-api release process and can be used as a TODO list for a new release. ## Pre-release checks From 83f2fc594413cfe1c4efa1f812e3a61427fc2e61 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 11 Sep 2024 15:56:26 +0300 Subject: [PATCH 428/440] [#65] Remove reference to NeoFS spec Can't update it anymore. Will eventually be superseded by docsite Signed-off-by: Vitaliy Potyarkin --- doc/release_instructions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/release_instructions.md b/doc/release_instructions.md index 28834e4..e7f8af2 100644 --- a/doc/release_instructions.md +++ b/doc/release_instructions.md @@ -60,4 +60,3 @@ releases. * Close corresponding X.Y.Z Github milestone * Make announcements in Matrix and Discord channels -* Update [NeoFS Technical Specification](https://github.com/nspcc-dev/neofs-spec) From b2f5205976250851af2c7da9bcf98101cd11b080 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Thu, 12 Sep 2024 21:44:19 +0300 Subject: [PATCH 429/440] [#66] .forgejo: Make 'fmt' job fail on changed files Signed-off-by: Aleksey Savchuk --- .forgejo/workflows/fmt.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/fmt.yaml b/.forgejo/workflows/fmt.yaml index d56bcf1..ddd50a7 100644 --- a/.forgejo/workflows/fmt.yaml +++ b/.forgejo/workflows/fmt.yaml @@ -12,4 +12,6 @@ jobs: apt update apt install -y clang-format - name: Run fmt - run: make fmt + run: | + make fmt + git diff --exit-code --quiet From 5bfbd249bcc666bf53bc4ff729fcc14d8d42025b Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Oct 2024 14:14:02 +0300 Subject: [PATCH 430/440] [#67] container: Remove unused import Fix warning from protoc: `container/grpc/service.proto:8:1: warning: Import acl/grpc/types.proto is unused.` Refs #60 Signed-off-by: Evgenii Stratonikov --- container/service.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/container/service.proto b/container/service.proto index f1f22de..493b08e 100644 --- a/container/service.proto +++ b/container/service.proto @@ -5,7 +5,6 @@ package neo.fs.v2.container; option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container"; option csharp_namespace = "Neo.FileStorage.API.Container"; -import "acl/types.proto"; import "container/types.proto"; import "refs/types.proto"; import "session/types.proto"; From 4c51a9b9d63e53ca0b430d9e4aa6d7e692465821 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Wed, 6 Nov 2024 12:50:32 +0300 Subject: [PATCH 431/440] [#71] Stop using obsolete .github directory This commit is a part of multi-repo cleanup effort: https://git.frostfs.info/TrueCloudLab/frostfs-infra/issues/136 Signed-off-by: Vitaliy Potyarkin --- .../ISSUE_TEMPLATE/bug_report.md | 0 .../ISSUE_TEMPLATE/config.yml | 0 .../ISSUE_TEMPLATE/feature_request.md | 0 {.github => .forgejo}/logo.svg | 0 {.github => .forgejo}/markdown.tmpl | 0 .github/CODEOWNERS | 1 - .github/workflows/buf.yml | 36 ------------------- .github/workflows/dco.yml | 21 ----------- CODEOWNERS | 1 + CONTRIBUTING.md | 2 +- Makefile | 2 +- README.md | 2 +- doc/release_instructions.md | 10 +++--- 13 files changed, 9 insertions(+), 66 deletions(-) rename {.github => .forgejo}/ISSUE_TEMPLATE/bug_report.md (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/config.yml (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/feature_request.md (100%) rename {.github => .forgejo}/logo.svg (100%) rename {.github => .forgejo}/markdown.tmpl (100%) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/workflows/buf.yml delete mode 100644 .github/workflows/dco.yml create mode 100644 CODEOWNERS diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.forgejo/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from .github/ISSUE_TEMPLATE/bug_report.md rename to .forgejo/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/config.yml rename to .forgejo/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.forgejo/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from .github/ISSUE_TEMPLATE/feature_request.md rename to .forgejo/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/logo.svg b/.forgejo/logo.svg similarity index 100% rename from .github/logo.svg rename to .forgejo/logo.svg diff --git a/.github/markdown.tmpl b/.forgejo/markdown.tmpl similarity index 100% rename from .github/markdown.tmpl rename to .forgejo/markdown.tmpl diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 29c4211..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @alexvanin @realloc @fyrchik @anatoly-bogatyrev diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml deleted file mode 100644 index 5d9d740..0000000 --- a/.github/workflows/buf.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Buf lint - -on: - pull_request: - branches: - - master - -jobs: - lint: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: wizhi/setup-buf@v1 - with: - version: 0.20.5 - - run: buf check lint - - breaking: - runs-on: ubuntu-20.04 - steps: - - name: Setup buf - uses: wizhi/setup-buf@v1 - with: - version: 0.20.5 - - name: Check out ref code - uses: actions/checkout@v2 - with: - ref: ${{ github.base_ref }} - path: baseref - - run: cd baseref && buf image build -o image.bin - - - name: Check out code - uses: actions/checkout@v2 - with: - path: prclone - - run: cd prclone && buf check breaking --against-input ../baseref/image.bin diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index 40ed8fc..0000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: DCO check - -on: - pull_request: - branches: - - master - -jobs: - commits_check_job: - runs-on: ubuntu-latest - name: Commits Check - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@master - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@master - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..4690d7e --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +.* @alexvanin @realloc @fyrchik @a.bogatyrev diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6ecdf5..1ca386f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,7 +87,7 @@ $ git push origin feature/123-something_awesome ``` ### Create a Pull Request -Pull requests can be created via GitHub. Refer to [this +Pull requests can be created via git.frostfs.info. Refer to [this document](https://help.github.com/articles/creating-a-pull-request/) for detailed steps on how to create a pull request. After a Pull Request gets peer reviewed and approved, it will be merged. diff --git a/Makefile b/Makefile index c08d609..6173f5c 100755 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ doc: @for f in `find . -type f -name '*.proto' -exec dirname {} \; | sort -u `; do \ echo "⇒ Documentation for $$(basename $$f)"; \ protoc \ - --doc_opt=.github/markdown.tmpl,$${f}.md \ + --doc_opt=.forgejo/markdown.tmpl,$${f}.md \ --proto_path=.:/usr/local/include \ --doc_out=proto-docs/ $${f}/*.proto; \ done diff --git a/README.md b/README.md index 561995d..5447b7b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

-FrostFS +FrostFS

FrostFS API language-agnostic protocol definitions diff --git a/doc/release_instructions.md b/doc/release_instructions.md index e7f8af2..d4fb9d4 100644 --- a/doc/release_instructions.md +++ b/doc/release_instructions.md @@ -20,7 +20,7 @@ Add an entry to the CHANGELOG.md following the style established there. Add a codename for releases with the new major version, version and release date in the heading. Write a paragraph describing the most significant changes done in this release. Then add sections with what has been added, changed and removed, -describing each change briefly with a reference to GitHub issues, where +describing each change briefly with a reference to issues, where available. ## Release commit @@ -38,7 +38,7 @@ Release v2.9.0 - Anmyeondo (안면도, 安眠島) Use `vX.Y.Z` tag following the semantic versioning standard. For pre-release versions use `vX.Y.Z-rc.N` scheme. -## Push changes and release tag to Github +## Push changes and release tag to repository This step should bypass the default PR mechanism to get a correct result (so that releasing requires admin privileges for the project), both the `master` @@ -48,9 +48,9 @@ branch update and tag must be pushed simultaneously like this: $ git push origin master v2.7.0 ``` -## Make a proper Github release +## Make a proper release -Edit an automatically-created release on Github. +Edit an automatically-created release on git.frostfs.info Release title has to follow ` ( )` scheme for major releases and just `` for regular point @@ -58,5 +58,5 @@ releases. ## Post-release actions -* Close corresponding X.Y.Z Github milestone +* Close corresponding X.Y.Z milestone * Make announcements in Matrix and Discord channels From 1a6bb369ec4cdf262e01be533973e0865a4ae1bb Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 16 Oct 2024 17:36:52 +0300 Subject: [PATCH 432/440] [#70] container: Add ListStream method Signed-off-by: Ekaterina Lebedeva --- container/service.proto | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/container/service.proto b/container/service.proto index 493b08e..ff79fcb 100644 --- a/container/service.proto +++ b/container/service.proto @@ -61,6 +61,17 @@ service ContainerService { // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ // container list access denied. rpc List(ListRequest) returns (ListResponse); + + // Returns all owner's containers from `Container` smart contract' storage + // via stream. + // + // Statuses: + // - **OK** (0, SECTION_SUCCESS): \ + // container list has been successfully read; + // - Common failures (SECTION_FAILURE_COMMON); + // - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + // container list access denied. + rpc ListStream(ListStreamRequest) returns (stream ListStreamResponse); } // New FrostFS Container creation request @@ -245,3 +256,44 @@ message ListResponse { // transmission. neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; } + +// List containers stream +message ListStreamRequest { + // List containers stream request body. + message Body { + // Identifier of the container owner. + neo.fs.v2.refs.OwnerID owner_id = 1; + } + // Body of list containers stream request message. + Body body = 1; + + // Carries request meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.RequestMetaHeader meta_header = 2; + + // Carries request verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.RequestVerificationHeader verify_header = 3; +} + +// List containers stream +message ListStreamResponse { + // List containers stream response body. + message Body { + // List of `ContainerID`s belonging to the requested `OwnerID` + repeated refs.ContainerID container_ids = 1; + } + + // Body of list containers stream response message. + Body body = 1; + + // Carries response meta information. Header data is used only to regulate + // message transport and does not affect request execution. + neo.fs.v2.session.ResponseMetaHeader meta_header = 2; + + // Carries response verification information. This header is used to + // authenticate the nodes of the message route and check the correctness of + // transmission. + neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; +} From 8540f0d18d5d26fd32ead801478e8405b8fbaaaf Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 13 Nov 2024 15:39:21 +0300 Subject: [PATCH 433/440] [#70] container: Fix wrong tick in comments Signed-off-by: Ekaterina Lebedeva --- container/service.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/container/service.proto b/container/service.proto index ff79fcb..a9a33d2 100644 --- a/container/service.proto +++ b/container/service.proto @@ -52,7 +52,7 @@ service ContainerService { // access to container is denied. rpc Get(GetRequest) returns (GetResponse); - // Returns all owner's containers from 'Container` smart contract' storage. + // Returns all owner's containers from `Container` smart contract storage. // // Statuses: // - **OK** (0, SECTION_SUCCESS): \ @@ -62,7 +62,7 @@ service ContainerService { // container list access denied. rpc List(ListRequest) returns (ListResponse); - // Returns all owner's containers from `Container` smart contract' storage + // Returns all owner's containers from `Container` smart contract storage // via stream. // // Statuses: From 2ed394d380a3e40f490a56c478814fb65907f686 Mon Sep 17 00:00:00 2001 From: Vitaliy Potyarkin Date: Tue, 10 Dec 2024 15:42:13 +0300 Subject: [PATCH 434/440] [#73] Refine CODEOWNERS settings Signed-off-by: Vitaliy Potyarkin --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index 4690d7e..e72ee14 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1 +1,3 @@ .* @alexvanin @realloc @fyrchik @a.bogatyrev +.forgejo/.* @potyarkin +Makefile @potyarkin From e33194282c0035bed8fcc652175f5a3dabd902a8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 26 Dec 2024 14:17:07 +0300 Subject: [PATCH 435/440] [#75] CODEOWNERS: Add SDK developers team Signed-off-by: Evgenii Stratonikov --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index e72ee14..854e751 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,3 +1,3 @@ -.* @alexvanin @realloc @fyrchik @a.bogatyrev +.* @alexvanin @realloc @fyrchik @a.bogatyrev @TrueCloudLab/storage-sdk-developers .forgejo/.* @potyarkin Makefile @potyarkin From 52e5bc646f1093be42581362a58e245734bdd8ac Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 26 Dec 2024 14:06:59 +0300 Subject: [PATCH 436/440] [#74] Use edition directive instead of syntax https://go.dev/blog/protobuf-opaque Signed-off-by: Evgenii Stratonikov --- accounting/service.proto | 2 +- accounting/types.proto | 2 +- acl/types.proto | 2 +- ape/types.proto | 2 +- apemanager/service.proto | 2 +- container/service.proto | 2 +- container/types.proto | 2 +- lock/types.proto | 2 +- netmap/service.proto | 2 +- netmap/types.proto | 2 +- object/service.proto | 2 +- object/types.proto | 2 +- refs/types.proto | 2 +- session/service.proto | 2 +- session/types.proto | 2 +- status/types.proto | 2 +- tombstone/types.proto | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/accounting/service.proto b/accounting/service.proto index eedd4ce..cd49b4d 100644 --- a/accounting/service.proto +++ b/accounting/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.accounting; diff --git a/accounting/types.proto b/accounting/types.proto index 5dd9b50..7f5e89c 100644 --- a/accounting/types.proto +++ b/accounting/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.accounting; diff --git a/acl/types.proto b/acl/types.proto index fdaffd4..78f247a 100644 --- a/acl/types.proto +++ b/acl/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.acl; diff --git a/ape/types.proto b/ape/types.proto index 3a97e60..2cbc5a9 100644 --- a/ape/types.proto +++ b/ape/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package frostfs.v2.ape; diff --git a/apemanager/service.proto b/apemanager/service.proto index 166ba4d..64c2565 100644 --- a/apemanager/service.proto +++ b/apemanager/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package frostfs.v2.apemanager; diff --git a/container/service.proto b/container/service.proto index a9a33d2..72b3789 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.container; diff --git a/container/types.proto b/container/types.proto index d133a45..d114205 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.container; diff --git a/lock/types.proto b/lock/types.proto index 2fdafa5..dc55276 100644 --- a/lock/types.proto +++ b/lock/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.lock; diff --git a/netmap/service.proto b/netmap/service.proto index dce43f4..c21fb53 100644 --- a/netmap/service.proto +++ b/netmap/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.netmap; diff --git a/netmap/types.proto b/netmap/types.proto index 969790c..b76b3c1 100644 --- a/netmap/types.proto +++ b/netmap/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.netmap; diff --git a/object/service.proto b/object/service.proto index e6ab5e0..f1ac927 100644 --- a/object/service.proto +++ b/object/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.object; diff --git a/object/types.proto b/object/types.proto index 6e9469b..f1df067 100644 --- a/object/types.proto +++ b/object/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.object; diff --git a/refs/types.proto b/refs/types.proto index fe12ec6..2464c34 100644 --- a/refs/types.proto +++ b/refs/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.refs; diff --git a/session/service.proto b/session/service.proto index 544556b..c9a7948 100644 --- a/session/service.proto +++ b/session/service.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.session; diff --git a/session/types.proto b/session/types.proto index c5bb695..1e5b9db 100644 --- a/session/types.proto +++ b/session/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.session; diff --git a/status/types.proto b/status/types.proto index d3e09fd..60fd312 100644 --- a/status/types.proto +++ b/status/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.status; diff --git a/tombstone/types.proto b/tombstone/types.proto index ccf1257..aac19b0 100644 --- a/tombstone/types.proto +++ b/tombstone/types.proto @@ -1,4 +1,4 @@ -syntax = "proto3"; +edition = "2023"; package neo.fs.v2.tombstone; From b337e61e98705d79b01d55a3aeb22997fc5870de Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Wed, 5 Feb 2025 13:43:36 +0300 Subject: [PATCH 437/440] [#78] status: Introduce `RESOURCE_EXHAUSTED` common status Signed-off-by: Aleksey Savchuk --- status/types.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/status/types.proto b/status/types.proto index 60fd312..6a98f84 100644 --- a/status/types.proto +++ b/status/types.proto @@ -109,6 +109,10 @@ enum CommonFail { // request parameter as the client sent it incorrectly, then this code should // be used. INVALID_ARGUMENT = 4; + + // [**1029**] Resource exhausted failure. This code should be used + // if the operation cannot be performed due to a lack of resources. + RESOURCE_EXHAUSTED = 5; } // Section of statuses for object-related operations. From a9eaff2fd6f6f4a12e519890bba7c59deefd1600 Mon Sep 17 00:00:00 2001 From: Ori Bruk Date: Tue, 11 Mar 2025 18:41:01 +0300 Subject: [PATCH 438/440] [#82] Update documentation info Signed-off-by: Ori Bruk --- object/service.proto | 4 +++ proto-docs/container.md | 70 ++++++++++++++++++++++++++++++++++++++++- proto-docs/object.md | 5 ++- proto-docs/status.md | 1 + 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/object/service.proto b/object/service.proto index f1ac927..8ee955a 100644 --- a/object/service.proto +++ b/object/service.proto @@ -124,6 +124,9 @@ service ObjectService { // returned. If `main_only` request field is set, the short header with only // the very minimal information will be returned instead. // + // Max header size is currently not limited by this API, but may be restricted + // on the service level. By default, gRPC uses a message size of 4 MiB. + // // Extended headers can change `Head` behaviour: // * [ __SYSTEM__NETMAP_EPOCH ] \ // (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -570,6 +573,7 @@ message HeadResponse { ShortHeader short_header = 2; // Meta information of split hierarchy. + // Indicates that the object is virtual, manual assembly is required. SplitInfo split_info = 3; // Meta information for EC object assembly. diff --git a/proto-docs/container.md b/proto-docs/container.md index 76cc115..7ee5dab 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -20,6 +20,10 @@ - [ListRequest.Body](#neo.fs.v2.container.ListRequest.Body) - [ListResponse](#neo.fs.v2.container.ListResponse) - [ListResponse.Body](#neo.fs.v2.container.ListResponse.Body) + - [ListStreamRequest](#neo.fs.v2.container.ListStreamRequest) + - [ListStreamRequest.Body](#neo.fs.v2.container.ListStreamRequest.Body) + - [ListStreamResponse](#neo.fs.v2.container.ListStreamResponse) + - [ListStreamResponse.Body](#neo.fs.v2.container.ListStreamResponse.Body) - [PutRequest](#neo.fs.v2.container.PutRequest) - [PutRequest.Body](#neo.fs.v2.container.PutRequest.Body) - [PutResponse](#neo.fs.v2.container.PutResponse) @@ -58,6 +62,7 @@ rpc Put(PutRequest) returns (PutResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Get(GetRequest) returns (GetResponse); rpc List(ListRequest) returns (ListResponse); +rpc ListStream(ListStreamRequest) returns (stream ListStreamResponse); ``` @@ -113,7 +118,7 @@ Statuses: | Get | [GetRequest](#neo.fs.v2.container.GetRequest) | [GetResponse](#neo.fs.v2.container.GetResponse) | #### Method List -Returns all owner's containers from 'Container` smart contract' storage. +Returns all owner's containers from `Container` smart contract storage. Statuses: - **OK** (0, SECTION_SUCCESS): \ @@ -125,6 +130,21 @@ Statuses: | Name | Input | Output | | ---- | ----- | ------ | | List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) | +#### Method ListStream + +Returns all owner's containers from `Container` smart contract storage +via stream. + +Statuses: +- **OK** (0, SECTION_SUCCESS): \ + container list has been successfully read; +- Common failures (SECTION_FAILURE_COMMON); +- **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \ + container list access denied. + +| Name | Input | Output | +| ---- | ----- | ------ | +| ListStream | [ListStreamRequest](#neo.fs.v2.container.ListStreamRequest) | [ListStreamResponse](#neo.fs.v2.container.ListStreamResponse) | @@ -276,6 +296,54 @@ List containers response body. | container_ids | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | repeated | List of `ContainerID`s belonging to the requested `OwnerID` | + + +### Message ListStreamRequest +List containers stream + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListStreamRequest.Body](#neo.fs.v2.container.ListStreamRequest.Body) | | Body of list containers stream request message. | +| meta_header | [neo.fs.v2.session.RequestMetaHeader](#neo.fs.v2.session.RequestMetaHeader) | | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.RequestVerificationHeader](#neo.fs.v2.session.RequestVerificationHeader) | | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListStreamRequest.Body +List containers stream request body. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| owner_id | [neo.fs.v2.refs.OwnerID](#neo.fs.v2.refs.OwnerID) | | Identifier of the container owner. | + + + + +### Message ListStreamResponse +List containers stream + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| body | [ListStreamResponse.Body](#neo.fs.v2.container.ListStreamResponse.Body) | | Body of list containers stream response message. | +| meta_header | [neo.fs.v2.session.ResponseMetaHeader](#neo.fs.v2.session.ResponseMetaHeader) | | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | +| verify_header | [neo.fs.v2.session.ResponseVerificationHeader](#neo.fs.v2.session.ResponseVerificationHeader) | | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. | + + + + +### Message ListStreamResponse.Body +List containers stream response body. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| container_ids | [neo.fs.v2.refs.ContainerID](#neo.fs.v2.refs.ContainerID) | repeated | List of `ContainerID`s belonging to the requested `OwnerID` | + + ### Message PutRequest diff --git a/proto-docs/object.md b/proto-docs/object.md index dd30ede..14b9ae6 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -223,6 +223,9 @@ Returns the object Headers without data payload. By default full header is returned. If `main_only` request field is set, the short header with only the very minimal information will be returned instead. +Max header size is currently not limited by this API, but may be restricted +on the service level. By default, gRPC uses a message size of 4 MiB. + Extended headers can change `Head` behaviour: * [ __SYSTEM__NETMAP_EPOCH ] \ (`__NEOFS__NETMAP_EPOCH` is deprecated) \ @@ -728,7 +731,7 @@ Object HEAD response body | ----- | ---- | ----- | ----------- | | header | [HeaderWithSignature](#neo.fs.v2.object.HeaderWithSignature) | | Full object's `Header` with `ObjectID` signature | | short_header | [ShortHeader](#neo.fs.v2.object.ShortHeader) | | Short object header | -| split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. | +| split_info | [SplitInfo](#neo.fs.v2.object.SplitInfo) | | Meta information of split hierarchy. Indicates that the object is virtual, manual assembly is required. | | ec_info | [ECInfo](#neo.fs.v2.object.ECInfo) | | Meta information for EC object assembly. | diff --git a/proto-docs/status.md b/proto-docs/status.md index 76534fb..b00d000 100644 --- a/proto-docs/status.md +++ b/proto-docs/status.md @@ -102,6 +102,7 @@ Section of failed statuses independent of the operation. | SIGNATURE_VERIFICATION_FAIL | 2 | [**1026**] Signature verification failure. | | NODE_UNDER_MAINTENANCE | 3 | [**1027**] Node is under maintenance. | | INVALID_ARGUMENT | 4 | [**1028**] Invalid argument error. If the server fails on validation of a request parameter as the client sent it incorrectly, then this code should be used. | +| RESOURCE_EXHAUSTED | 5 | [**1029**] Resource exhausted failure. This code should be used if the operation cannot be performed due to a lack of resources. | From 9c7730b67bbe2163e8d1ea82de48e488c9dd0bff Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 4 Mar 2025 16:50:03 +0300 Subject: [PATCH 439/440] [#81] object: Extend `PatchRequest.Body` with `new_split_header` field * This field updates object's split header. Signed-off-by: Airat Arifullin --- object/service.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/object/service.proto b/object/service.proto index 8ee955a..c5e4fc7 100644 --- a/object/service.proto +++ b/object/service.proto @@ -891,6 +891,10 @@ message PatchRequest { // key, then it just replaces it while merging the lists. bool replace_attributes = 3; + // New split header for the object. This defines how the object will relate + // to other objects in a split operation. + neo.fs.v2.object.Header.Split new_split_header = 5; + // The patch for the object's payload. message Patch { // The range of the source object for which the payload is replaced by the From 6ea41833977464d82e9bf96394254271f34ea68d Mon Sep 17 00:00:00 2001 From: Roman Loginov Date: Wed, 5 Feb 2025 13:32:45 +0300 Subject: [PATCH 440/440] [#77] object: Add a refinement to description on the FileName attribute Signed-off-by: Roman Loginov --- object/types.proto | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/object/types.proto b/object/types.proto index f1df067..62a6792 100644 --- a/object/types.proto +++ b/object/types.proto @@ -141,7 +141,8 @@ message Header { // * Name \ // Human-friendly name // * FileName \ - // File name to be associated with the object on saving + // File name to be associated with the object on saving. FileName must not + // contain the delimiting symbol '/'. // * FilePath \ // Full path to be associated with the object on saving. Should start with a // '/' and use '/' as a delimiting symbol. Trailing '/' should be