Commit graph

621 commits

Author SHA1 Message Date
Alex Vanin
5fa271e141 [#144] sdk/client: Add call option to set session token
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
3783133173 [#144] sdk/client: Add RPC to create session token
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
dfcc21242b [#144] sdk/token: Define session token structure
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
0b9ddd10f8 [#145] sdk/object: Implement Object deserialization function
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
1ac6f2eeeb [#145] sdk/object: Refactor logic of field setters
In previous implementation RawObject constructor initialized internal v2
Object structure recursively so that further you can directly set the values
of nested fields. This caused the object created by constructor New to be
different from the object created from the empty object v2.

Remove recursive initialization of v2 Object from New and NewRaw
constructors. Make setters to initialize nested structures on demand.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
052a4a97dc [#139] sdk/acl: Highlight prefix of well known header names
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
d1499e65b9 [#139] sdk/acl: Add test coverage for EACL structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
790add6538 [#139] v2/object: Fix string conversion errors for go1.15
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
15f803119b [#139] sdk/client: Support EACL in RPC client
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
edf2e2d62f [#139] sdk/acl: Add eACL structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
182a3af9b8 [#139] v2/acl: Rename TargetInfo to Target
Corresponds with proto definition.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
3c7c363002 [#142] sdk/container: Add converters to and from v2
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
012cea1add [#142] sdk/container: Use placement policy from neofs-api v2.0
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
1cbfb337a7 [#142] sdk/netmap: Add type aliases for netmap policy
Later on there should be version independent structures.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
644a21edca [#141] sdk/client: Fix object operations
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
4fd6839473 [#140] sdk/object: Implement object format control functions
Implement function for calculating, setting and checking object verification
fields.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
bfdf8a452f [#140] sdk/object: Implement ID comparison method
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
5473b4ef95 [#140] sdk: Implement checksum comparison function
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
6ce70d4a18 [#140] sdk/object: Refactor object types
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
e40995b5d4 [#140] sdk: Define Signature type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
20d644758b [#140] sdk/object: Define Attribute type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
5902f96f3e [#140] sdk: Define checksum type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
e0c34a51f2 [#140] sdk: Refactor version type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
524280a5e8 [#140] sdk: Refactor reference types
Refactor v2-compatible reference types to be wrappers over corresponding
types from v2.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
2026473733 [#137] sdk: Implement netmap filtering and selection
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
efbf73b775 [#138] sdk/object: Fix head request
Now head request returns full header with signature.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
581cb2d2ba [#138] v2/object: Update to neofs-api jindo release
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
c0cc4a4374 [#138] v2/netmap: Update to neofs-api jindo release
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
b19e3a48db [#135] sdk/client: Implement object operations
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
9b0eef0d43 [#135] sdk/object: Add Release method to RawObject
Implement Release method that converts RawObject to read-only finalized
Object instance. Remove ToV2 method overriding from Object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
8e9d456038 [#135] sdk/container: Fix IDFromV2 nil-behavior
Remove nil if-statement from IDFromV2 function to which avoids checking the
correctness of the identifier format. From now IDFromV2 returns format error
on nil argument.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
047bae63d0 [#135] sdk/object: Fix IDFromV2 nil-behavior
Remove nil if-statement from IDFromV2 function to which avoids checking the
correctness of the identifier format. From now IDFromV2 returns format error
on nil argument.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
59f804faa2 [#136] v2/acl: Fix record stable size 2020-09-18 10:45:11 +03:00
Alex Vanin
148618b5b3 [#134] v2/netmap: Update unified structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
505ef59dd6 [#134] v2/netmap: Regenerate proto files
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
94c4e05aa2 [#134] v2/netmap: Remove prototype of stable marshaller
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
7a6c5eac1e [#134] v2/acl: Update unified structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
09cc2a5037 [#134] v2/acl: Regenerate proto files
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
de505ddee9 [#133] sdk: Use cid wrapper to sign container delete request
StableMarshalerWrapper is not suitable for container delete
request, because it signs marshaled structure of container id.
As for delete request, container id itself should be signed.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
acbdbd410e [#132] sdk/object: Implement useful methods and function
Implement method to get address of the object. Implement method to copy the
object w/o payload. Implement function of object deserialization.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
f18e8535c5 [#132] sdk/object: Add payload field to Object
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
e222c441e5 [#132] v2/object: Implement stable unmarshaler on Object
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
c125749c6e [#132] sdk/object: Implement Address type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
104604acae [#132] v2/refs: Implement stable unmarshaler on Address
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
9cba1e233d [#131] sdk: Add owner stringer and script hash converter
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
8c3f8268b9 [#130] sdk: Define object types
Define Object type that represents the immutable NeoFS object. Define
RawObject type that provides interface for convenient construction of NeoFS
object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
a65db08608 [#130] sdk: Define object identifier type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
edd0004b93 [#129] v2: Add unified structure for NodeInfo
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
ac0d57cc9b [#129] v2: Regenerate NodeInfo struct from API
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
63c8d6e9ea [#128] sdk: Use owner ID instead of NEO3Wallet
Replace owner.NEO3Wallet usage with owner.ID usage. Functions that process
the wallet address convert it to the owner identifier through the public
method.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00