Commit graph

65 commits

Author SHA1 Message Date
Leonard Lyubich
14fa89b819 [#155] sdk/object: Add Object to RawObject converter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
cecdeeac73 [#155] sdk/object: Add CutPayload method to RawObject
Add CutPayload method that returns RawObject's copy with untethered empty
payload. Changing the result payload doesn't affect source object. Changing
the other fields affects source object.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
dbb5102c02 [#155] sdk/object: Add object type getter/setter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
2fb1547cd8 [#155] sdk/object: Define object types
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
b991e014a9 [#155] sdk/eacl: Fix package cross dependency
Remove the usage of object package constants from eacl unit tests.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Leonard Lyubich
c66b23995c [#155] sdk/object: Add session token getter/setter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-22 18:07:14 +03:00
Alex Vanin
3347e53cde [#151] sdk/netmap: Add public key getter for node
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-22 10:25:09 +03:00
Alex Vanin
59033d330d [#143] sdk/client: Add call option to set bearer token
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
96de0bd25a [#143] sdk/token: Define bearer token structure
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
0259a06783 [#150] sdk/token: Add owner ID
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
73220620c5 [#148] sdk/client: Support object search rpc
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
549fcad76e [#148] sdk/object: Change search filters v2 converter return type
Unified structures from v2 package work with the slice of pointers.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
353448c0c3 [#149] sdk/object: Add address field getters and setters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
7ef249f8db [#149] sdk/netmap: Add net address getter to Node
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Leonard Lyubich
f8e7a577de [#149] sdk/container: Add function to calculate identifier
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
fea8cd48f2 [#146] sdk/object: Add structures for object search rpc call
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
f60069ec9f [#146] sdk/object: Move well-known header const to object type
Extended ACL filters and object search filters use strings to specify
well-known object headers, such as owner id, object id, etc. To unify
these constant they've been moved into object package, because they
specifying object related headers.

This should be noted in nspcc-dev/neofs-spec#12

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
2a7e91fa13 [#144] sdk/token: Use MarshalBinary to uuid of session token
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
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
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
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
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
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
c125749c6e [#132] sdk/object: Implement Address type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00