Commit graph

530 commits

Author SHA1 Message Date
Leonard Lyubich
8270245455 service: transfer public types to a separate file 2020-05-04 14:00:25 +03:00
Leonard Lyubich
b785eb710a service: transfer TTL code to a separate file 2020-05-04 13:38:27 +03:00
Leonard Lyubich
fc177c4ce3 service: change constant errors
This commit:

  * moves defined errors to a separate file;

  * renames ErrEmptyToken to ErrNilToken;

  * merges ErrZeroTTL and ErrIncorrectTTL into single ErrInvalidTTL.
2020-05-04 13:06:36 +03:00
Leonard Lyubich
e3cab218dc
Merge pull request #73 from nspcc-dev/session-private-token-expiration
session: support the expiration of private tokens
2020-04-29 14:54:43 +03:00
Leonard Lyubich
4fa7360cd1 session: support the expiration of private tokens
All sessions in NeoFS has limited in epochs lifetime. There is a need
to limit the lifetime of private session tokens.

This commmit:

  * extends PrivateToken interface with Expired method;

  * defines EpochLifetimeStore interface with RemoveExpired method
    and embeds it to PrivateTokenStore interface;

  * adds epoch value parameter to private token constructor.
2020-04-29 14:11:19 +03:00
Leonard Lyubich
8cbdb9183f
Merge pull request #72 from nspcc-dev/session-refactor
Session package refactoring
2020-04-29 13:14:17 +03:00
Leonard Lyubich
ffd4338eb3 session: fix NewPrivateToken function doc 2020-04-29 12:59:58 +03:00
Leonard Lyubich
608f578105 session: removes unused errors 2020-04-29 12:50:52 +03:00
Leonard Lyubich
79142ada04 session: replace used type aliases to separate file 2020-04-29 12:49:27 +03:00
Leonard Lyubich
f0867036fb session: remove trivial defaultCurve function 2020-04-29 12:46:05 +03:00
Leonard Lyubich
701bbafcf1 session: change KeyStore documentation 2020-04-29 12:44:35 +03:00
Leonard Lyubich
22265a9f03 session: refactor token store
This commit:

  * changes the set and signatures of TokenStore interface methods;

  * adds unit test for map storage.
2020-04-29 12:39:41 +03:00
Leonard Lyubich
dfc2dd8a78 session: replace PToken structure with PrivateToken interface
In previous implementation PToken contained the full Token structure.
Since private token is used for data signature only, storing unused
fields of a user token is impractical. To emphasize the purpose of
the private part of the session, it makes sense to provide the user
of the session package with its interface. The interface will only provide
the functionality of data signing with private session key.

This commit:

  * removes PToken structure from session package;

  * defines PrivateToken interface of private session part;

  * adds the implementation of PrivateToken on unexported struct;

  * provides the constructor that generates session key internally.
2020-04-29 11:52:05 +03:00
Leonard Lyubich
1e86e1112a
Merge pull request #71 from nspcc-dev/token-sign-verify
Implement Sign/Verify for SessionToken
2020-04-29 11:31:53 +03:00
Leonard Lyubich
cce6566f1e service: prevent NPE in VerifyTokenSignature function
This commit adds next changes to VerifyTokenSignature:

  * returns ErrEmptyToken on nil token argument;

  * returns ErrEmptyPublicKey on nil public key argument.
2020-04-29 10:57:07 +03:00
Leonard Lyubich
82ffde253b service: implement Sign/Verify functions for SessionToken 2020-04-28 19:03:15 +03:00
Evgeniy Kulikov
e47b775a86
Merge pull request #70 from nspcc-dev/use-token-getters-setters
service: access Token message fields through getters and setters
2020-04-28 18:49:10 +03:00
Leonard Lyubich
c6971d2004 service: access Token message fields through getters and setters 2020-04-28 18:40:21 +03:00
Evgeniy Kulikov
091f953ebf
Merge pull request #69 from nspcc-dev/new-fields-getters-setters
New fields getters setters
2020-04-28 17:42:53 +03:00
Leonard Lyubich
d327d836c4 service: define and implement Token field composing interface
This commit:

  * defines SessionToken interface of Token field getters/setters group;

  * implements SessionToken on Token message.
2020-04-28 17:09:01 +03:00
Leonard Lyubich
942bedb8ed service: implement Token field setter on RequestVerificationHeader
After recent changes Token field is presented in RequestVerificationHeader.
There is a need to provide an interface of field getter/setter.

This commit:

  * defines TokenHeader interface of token value container;

  * implements Token field setter on RequestVerificationHeader.
2020-04-28 17:02:47 +03:00
Leonard Lyubich
09f8ee52d0 service: implement Raw field setter on RequestMetaHeader struct
After recent changes Raw field is presented in RequestMetaHeader.
There is a need to provide an interface of field getter/setter.

This commit:

  * defines RawHeader interface of raw value container;

  * embeds RawHeader into MetaHeader interface;

  * implements Raw field setter on RequestMetaHeader.
2020-04-28 17:02:47 +03:00
Evgeniy Kulikov
72a71e6a94
Merge pull request #68 from nspcc-dev/stringify-object-method
object: Stringily method
2020-04-28 16:53:29 +03:00
Evgeniy Kulikov
5ae4e14bfa
object: test coverage for stringify method 2020-04-28 16:39:01 +03:00
Evgeniy Kulikov
4d535876d0
object: implement Stringify for Object 2020-04-28 16:39:01 +03:00
Evgeniy Kulikov
7a7deb0b01
proto: regenerate files 2020-04-28 16:30:47 +03:00
Evgeniy Kulikov
ba32395894
api: update to neofs-api v0.7.3 2020-04-28 16:29:54 +03:00
Evgeniy Kulikov
6c705e079f
Merge pull request #67 from nspcc-dev/update-to-neofs-api-0.7.2
Update to neofs api 0.7.2
2020-04-28 14:33:50 +03:00
Leonard Lyubich
4ac17201b7 Resolve update conflicts 2020-04-28 13:33:43 +03:00
Leonard Lyubich
24108f42c3 Regenerate docs 2020-04-28 12:51:27 +03:00
Leonard Lyubich
e63d112cb2 Update to neofs-api v0.7.2 2020-04-28 12:50:52 +03:00
Evgeniy Kulikov
0cf8e19f36
Merge tag 'v0.7.1' into develop
Release v0.7.1
2020-04-20 14:03:43 +03:00
Evgeniy Kulikov
ce7535cb33
Merge branch 'release/0.7.1' 2020-04-20 14:03:33 +03:00
Evgeniy Kulikov
91e0b2699d
CHANGELOG 2020-04-20 14:03:24 +03:00
Evgeniy Kulikov
92da09ac42
Merge pull request #66 from nspcc-dev/update-to-neofs-api-v0.7.1
Update to NeoFS API v0.7.1
2020-04-20 14:00:44 +03:00
Evgeniy Kulikov
e03b922dd4
docs: regenerate files 2020-04-20 13:55:29 +03:00
Evgeniy Kulikov
bef32abb9c
proto: regenerate files 2020-04-20 13:55:29 +03:00
Evgeniy Kulikov
46942282e5
make: update to NeoFS API v0.7.1 2020-04-20 13:55:29 +03:00
Evgeniy Kulikov
32ebb44434
Merge tag 'v0.7.0' into develop
Release v0.7.0
2020-04-16 17:12:07 +03:00
Evgeniy Kulikov
0389542b4d
Merge branch 'release/0.7.0' 2020-04-16 17:11:56 +03:00
Evgeniy Kulikov
1f2cee7667
CHANGELOG 2020-04-16 17:11:50 +03:00
Evgeniy Kulikov
1aaef95dea
Merge pull request #65 from nspcc-dev/update-to-neofs-api_v0.7.0
Update to NeoFS API v0.7.0
2020-04-16 17:09:40 +03:00
Evgeniy Kulikov
bedde0e33b
proto: regenerate files 2020-04-16 17:06:07 +03:00
Evgeniy Kulikov
e03e3f1270
docs: regenerate files 2020-04-16 17:05:44 +03:00
Evgeniy Kulikov
effdc54f79
api: update to v0.7.0 2020-04-16 17:05:04 +03:00
Evgeniy Kulikov
2f771ac1b2
Merge tag 'v0.6.2' into develop
Release v0.6.2
2020-04-16 11:53:52 +03:00
Evgeniy Kulikov
ce8b200458
Merge branch 'release/0.6.2' 2020-04-16 11:53:42 +03:00
Evgeniy Kulikov
0bf293340b
CHANGELOG 2020-04-16 11:53:34 +03:00
Evgeniy Kulikov
e29cf2d3d7
Merge pull request #64 from nspcc-dev/update-to-neofs-api_v0.6.1
Update to NeoFS API v0.6.1
2020-04-16 11:47:49 +03:00
Evgeniy Kulikov
9b24ba95d4
modules: update dependencies 2020-04-16 11:41:40 +03:00