Merge branch 'release/0.2.10'

This commit is contained in:
alexvanin 2020-01-17 15:09:08 +03:00
commit 25cf1e8b7b
4 changed files with 19 additions and 2 deletions

View file

@ -1,6 +1,11 @@
# Changelog # Changelog
This is the changelog for NeoFS Proto This is the changelog for NeoFS Proto
## [0.2.10] - 2020-01-17
### Changed
- Private token contructor now takes public keys as an argument
## [0.2.9] - 2020-01-17 ## [0.2.9] - 2020-01-17
### Added ### Added
@ -106,3 +111,4 @@ Initial public release
[0.2.7]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.6...v0.2.7 [0.2.7]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.6...v0.2.7
[0.2.8]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.7...v0.2.8 [0.2.8]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.7...v0.2.8
[0.2.9]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.8...v0.2.9 [0.2.9]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.8...v0.2.9
[0.2.10]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.9...v0.2.10

View file

@ -33,6 +33,7 @@ type (
LastEpoch uint64 LastEpoch uint64
ObjectID []ObjectID ObjectID []ObjectID
OwnerID OwnerID OwnerID OwnerID
PublicKeys [][]byte
} }
) )

View file

@ -54,6 +54,7 @@ func (s *simpleStore) New(p TokenParams) *PToken {
LastEpoch: p.LastEpoch, LastEpoch: p.LastEpoch,
ObjectID: p.ObjectID, ObjectID: p.ObjectID,
OwnerID: p.OwnerID, OwnerID: p.OwnerID,
PublicKeys: p.PublicKeys,
}, },
PrivateKey: key, PrivateKey: key,
} }

View file

@ -57,9 +57,14 @@ func TestTokenStore(t *testing.T) {
c := newTestClient(t) c := newTestClient(t)
require.NotNil(t, c) require.NotNil(t, c)
pk := [][]byte{crypto.MarshalPublicKey(&c.PublicKey)}
// create new token // create new token
token := s.New(TokenParams{ObjectID: []ObjectID{oid}, OwnerID: c.OwnerID}) token := s.New(TokenParams{
ObjectID: []ObjectID{oid},
OwnerID: c.OwnerID,
PublicKeys: pk,
})
signToken(t, token, c) signToken(t, token, c)
// check that it can be fetched // check that it can be fetched
@ -68,7 +73,11 @@ func TestTokenStore(t *testing.T) {
require.Equal(t, token, t1) require.Equal(t, token, t1)
// create and sign another token by the same client // create and sign another token by the same client
t1 = s.New(TokenParams{ObjectID: []ObjectID{oid}, OwnerID: c.OwnerID}) t1 = s.New(TokenParams{
ObjectID: []ObjectID{oid},
OwnerID: c.OwnerID,
PublicKeys: pk})
signToken(t, t1, c) signToken(t, t1, c)
data := []byte{1, 2, 3} data := []byte{1, 2, 3}