Commit graph

18 commits

Author SHA1 Message Date
Leonard Lyubich
5e1e220988 service: sign requests on the principle of Matryoshka
This commit changes SignRequestData / VerifyRequestData functions to
add the list of previous public keys to a signed message for all
requests.
2020-06-22 17:26:59 +03:00
Leonard Lyubich
a3c4889945 service: implement BearerToken interface on BearerTokenMsg message
This commit:

  * implements (Set)ExpirationEpoch methods on BearerTokenMsg;

  * removes BearerTokenMsg wrapper.
2020-06-18 16:08:44 +03:00
Leonard Lyubich
a3569ad99e service: ad BearerToken to signed payload of the requests 2020-06-18 15:28:58 +03:00
Leonard Lyubich
3f7d3f8a86 service: make RequestData to provide BearerTokenSource interface 2020-06-18 15:24:17 +03:00
Leonard Lyubich
ee584f325c Update to neofs-api v1.1.0 2020-06-18 15:01:25 +03:00
Leonard Lyubich
877db6be32 service: remove no longer used Sign/Verify methods and functions 2020-05-12 10:45:03 +03:00
Leonard Lyubich
082edf7456 service: implement sign-verify methods on RequestVerificationHeader 2020-05-06 12:50:15 +03:00
Leonard Lyubich
eb94cf7549 service: refactor MetaHeader interface 2020-05-04 14:37:14 +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
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
4ac17201b7 Resolve update conflicts 2020-04-28 13:33:43 +03:00
Evgeniy Kulikov
b118f469d2
Migrate to new repo 2020-03-31 10:05:26 +03:00
Evgeniy Kulikov
53af48372f
prepare to rename neofs-proto to neofs-api 2020-01-30 16:35:30 +03:00
Evgeniy Kulikov
8d028100e9
service: Use sync pool for Sign/Verify request headers
```
// Before
BenchmarkSignRequestHeader-8   	     146	   8070375 ns/op	 4210607 B/op	      48 allocs/op
BenchmarkVerifyRequestHeader-8   	      14	  83058325 ns/op	42085955 B/op	    1601 allocs/op

// After
BenchmarkSignRequestHeader-8   	     156	   7709172 ns/op	   33902 B/op	      45 allocs/op
BenchmarkVerifyRequestHeader-8   	      15	  76910232 ns/op	   54368 B/op	    1563 allocs/op

// Summary:
benchmark                          old ns/op     new ns/op     delta
BenchmarkSignRequestHeader-8       8070375       7709172       -4.48%
BenchmarkVerifyRequestHeader-8     83058325      76910232      -7.40%

benchmark                          old allocs     new allocs     delta
BenchmarkSignRequestHeader-8       48             45             -6.25%
BenchmarkVerifyRequestHeader-8     1601           1563           -2.37%

benchmark                          old bytes     new bytes     delta
BenchmarkSignRequestHeader-8       4210607       33902         -99.19%
BenchmarkVerifyRequestHeader-8     42085955      54368         -99.87%
```
2019-12-20 17:14:51 +03:00
Evgeniy Kulikov
891ba27ede
service: get rid of proto.Message in Maintainable/Verifiable requests 2019-12-05 14:30:08 +03:00
Evgeniy Kulikov
eda9ea3829
service: add method to RequestVerificationHeader to validate owner 2019-11-26 13:43:01 +03:00
Evgeniy Kulikov
5c344bfceb
Fix issue with Sign/VerifyRequestHeader proto.Clone
proto.Clone couldn't makes copy for custom fields.
We should reset and restore MetaHeader before/after Sign/Verify.
Add test coverage to check that all works like expected.
2019-11-21 13:10:57 +03:00
Evgeniy Kulikov
24e5497b1d
Update develop branch 2019-11-21 13:10:57 +03:00