Commit graph

4 commits

Author SHA1 Message Date
Leonard Lyubich
cc1163fd57 [#298] pkg/session/test: Set lifetime fields in Generate func
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-07 13:26:59 +03:00
Leonard Lyubich
2648abb49e [#283] pkg/session: Add container context generator
Implement `sessiontest.ContainerContext` function for testing.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-28 16:32:02 +03:00
Leonard Lyubich
fb0b1ea108 [#283] pkg/session: Cover Token's Sign/Verify methods with unit test
Add `sessiontest.GenerateSigned` function which returns signed random token.
Clarify that `sessiontest.Generate` returns an unsigned token. Use these
functions to assert the correctness of `Sign` / `VerifySignature` methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-28 16:32:02 +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