Make it easier to test API clients and mock specific methods.
Also add comments on exported methods.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Allow to reuse underlying connection for requests
with different key. If no key is specified the one
provided on client creation is used.
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Make Client.GetContainer method to return an error if received container
structure does not meet NeoFS API specification.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
GetContainer method reads container structure by identifier from the
network. In some cases it is required to additionally check the
correspondence of the container structure to the identifier as a hash from
the binary representation. To do this, a new function
GetVerifiedContainerStructure is defined to execute the check after
receiving the container.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
GetEACL method of Client receives eACL table with signature, verifies the
signature and return the table. In some cases we need to receive table and
signature regardless of their correctness. New method GetEACLWithSignature
provides such an opportunity.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Extended ACL tables should be signed with RFC-6979 standard. Fix Client
.GetEACL implementation to verify eACL signature with SignRFC6979 option.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
There is a need to set dial timeout in SDK client that is used in case of
internal connection opening. Add DialTimeout option constructor to support
this feature.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
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>
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>