In the well-known BasicACL constants we need to set the always toggled
bits for the system group. Otherwise it may be confusing for those who
read the specification and try to match it with the reference
implementation or the resulting BasicACL set in the container.
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
Create new `SessionTokenBody` instead of using one from the parameter in
order to prevent data corruption.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
There is a problem when containers with newer versions considered invalid by
Client. This does not allow receiving correct containers of new versions
through the client.
Fix the problem by turning off version check in `Client.GetContainer`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
In latest NeoFS API changes `NodeInfo` message carries list of network
addresses. There is a need
Add `SetAddresses` / `IterateAddresses` / `NumberOfAddresses` methods to
provide the access to node's address group. Mark `Address` / `SetAddress`
methods as deprecated.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Fix failure to comply with a requirement of stdlib `io.Reader` docs: `When
Read encounters an error or end-of-file condition after successfully reading
n > 0 bytes, it returns the number of bytes read.`
Prepare a platform for unit tests and test the affected case.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement `String` / `FromString` method pair in all levels of enum
definitions. From now `String()` returns canonical protojson-compatible
values.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Define `ReaderHandler` type. Add `GetObjectParams.WithPayloadReaderHandler`
method which accepts `ReaderHandler`. The handler is called right after
header receipt in `Client.GetObject`. After the handler is called,
`GetObject` returns object header immediately.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document field values of instance constructed via
`NewXHeader`. Assert the values in corresponding
unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `XHeader.ToV2` method return `nil`
when called on `nil`. Document that `NewXHeaderFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document field values of instance constructed via
`NewVersion`. Assert the values in corresponding
unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `Version.ToV2` method return `nil`
when called on `nil`. Document that `NewVersionFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document field values of instance constructed via
`NewSignature`. Assert the values in corresponding
unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `Signature.ToV2` method return `nil`
when called on `nil`. Document that `NewSignatureFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document field values of instance constructed via `NewChecksum`.
Assert the values in corresponding unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `Checksum.ToV2` method return `nil`
when called on `nil`. Document that `NewChecksumFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `BearerToken.ToV2` method return `nil`
when called on `nil`. Write corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `StorageGroup.ToV2` method return `nil`
when called on `nil`. Document that `NewFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>