Define `SysAttributeZoneDefault` constant for default zone in V2 code. Add
`SetNativeName` function which sets name with default zone.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Implement `GetNativeNameWithZone` / `SetNativeNameWithZone` function which
gets / sets `__NEOFS_NAME` and `__NEOFS_ZONE` container attributes.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Recompile NeoFS API protobuf files. Implement `NetworkParameter` and
`NetworkConfig` types. Expand `NetworkInfo` type with MillisecondsPerBlock
and `NetworkConfig`.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
There is a need to analyze some response information in API client.
Define `ResponseMetaInfo` structure of response information. Add
`WithResponseInfoHandler` client option which allows to set the response
info callback. The callback is called right after any response is received.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Copy `Curve` field of `ecdsa.PublicKey` arg to `keys.PublicKey` instance in
`NEO3WalletFromPublicKey` function.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
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>
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>
Document field values of instance constructed via `NewToken`.
Assert the values in corresponding unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `Token.ToV2` method return `nil`
when called on `nil`. Document that `NewTokenFromV2`
function return `nil` when called on `nil`. Write
corresponding unit tests.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
`NewTrust`, `NewPeerToPeerTrust` and `NewGlobalTrust`
Document field values of instance constructed via
`NewTrust`, `NewPeerToPeerTrust` and `NewGlobalTrust`.
Assert the values in corresponding unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
`PeerToPeerTrust` and `GlobalTrust` to nil message
Document that `Trust.ToV2`, `PeerToPeerTrust.ToV2`
and `GlobalTrust.ToV2` methods return `nil`when
called on `nil`. Document that `TrustFromV2`,
`PeerToPeerTrustFromV2`and `GlobalTrustFromV2`
functions 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 `NewPeerID`.
Assert the values in corresponding unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Document that `PeerID.ToV2` method return `nil`
when called on `nil`. Document that `PeerIDFromV2`
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 `NewID`.
Assert the values in corresponding unit test.
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>