Remove usage of deprecated of `container.ID` and `token.SessionToken` code
elements. Replace using of custom message generators with the ones provided
by packages. Replace string comparison with `Equal` method call.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Nil slice of records of the `Table` should be converted to nil slice in
corresponding field of API v2 message structure.
Add nil-check in `Table.ToV2` implementation. The changes fix corresponding
unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Document field values of instance constructed via `NewTable`. Assert the
values in corresponding unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Nil slices of targets and filters of the `Record` should be converted to nil
slices in corresponding fields of API v2 message structure.
Add nil-check in `Record.ToV2` implementation. The changes fix corresponding
unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Document field values of instance constructed via `NewRecord`. Assert the
values in corresponding unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Document field values of instance constructed via `NewTarget`. Assert the
values in corresponding unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Document field values of instance constructed via `NewFilter`. Assert the
values in corresponding unit test.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Extended ACL table can be set within a session, and should be signed.
Add `SessionToken` / `SetSessionToken` (`Signature` / `SetSignature`)
methods to carry session token (signature) in `Table` structure.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In previous implementation Target provided Keys/SetKeys methods which
allowed working with ECDSA keys. There was also a bug in the NewTargetFromV2
function when the binary key differed in format from the ECDSA key. New
BinaryKeys/SetBinaryKeys methods work with binary keys. To work with ECDSA
keys added functions TargetECDSAKeys/SetTargetECDSAKeys. Old methods are
left and marked deprecated.
Type Record provided an interface for adding a Target by Role and a list of
ECDSA keys. New SetTargets method allows to set the list of Target's,
AddTarget function allows to add a single Target. AddFormedTarget works like
old AddTarget method, which is now deprecated.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
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>