Commit graph

15 commits

Author SHA1 Message Date
Pavel Karpy
f92f9cd424 [#302] pkg/container: Document default values set in New
Make `nil` as a default value for attributes.
Document field values of instance constructed
via `New`. Assert the values in corresponding
unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-09 17:23:35 +03:00
Pavel Karpy
c08b90dbbc [#302] pkg/container: Convert nil Container to nil message
Make `Container.ToV2` method to return `nil`
when called on `nil`. Write corresponding
unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-09 17:23:35 +03:00
Leonard Lyubich
65080c8b69 [#295] pkg: Remove usage of deprecated elements
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>
2021-06-01 08:04:12 +03:00
Leonard Lyubich
37b415347d [#283] pkg/token: Replace SessionToken into a session package
There is a need to add session token to `eacl.Table` structure. To do this,
we need to replace `token.SessionToken` type to another package since `eacl`
package imports `token` one (potential cross-import).

Create `pkg/session` package and replace session token implementation to it.
Related API in `container` package is deprecated from now.

Additionally implement test generator of random session tokens.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
fcbe0bbd2e [#283] pkg/container: Add session token and signature to Container
Container can be created within a session, and should be signed.

Add `SessionToken` / `SetSessionToken` (`Signature` / `SetSignature`)
methods to carry session token (signature) in `Container` structure.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
7988405753 [#194] pkg/container: Implement container constructor with format check
Implement NewVerifiedFromV2 function that verifies format of NeoFS API V2
Container message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-24 12:54:53 +03:00
Leonard Lyubich
70c29ca3e5 [#194] pkg/container: Implement container nonce getter/setter as UUID
Implement NonceUUID/SetNonceUUID methods on container structure. Change
implementation of Nonce/SetNonce methods and mark them deprecated.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-24 12:54:53 +03:00
Leonard Lyubich
459d295788 [#199] sdk/container: Correct linter's remarks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-16 18:51:14 +03:00
Leonard Lyubich
a684da6118 [#168] container: Implement binary/JSON encoders/decoders on Container
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-13 18:07:26 +03:00
Alex Vanin
f16a420bed [#193] pkg/container: Wrap container structure with SDK functions
All setters and getters should work with SDK types.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-13 12:28:00 +03:00
Leonard Lyubich
53697081ce [#189] sdk: Fix type conflicts after netmap package refactoring
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-06 09:28:50 +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
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
Leonard Lyubich
63c8d6e9ea [#128] sdk: Use owner ID instead of NEO3Wallet
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>
2020-09-18 10:45:11 +03:00
Alex Vanin
aa539cd0c4 [#126] sdk: implement container rpc for in client
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00