Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.2.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvanin committed Jan 17, 2020
2 parents e945525 + 0a2fd1d commit 25cf1e8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
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

### Added
Expand Down Expand Up @@ -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.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.10]: https://github.com/nspcc-dev/neofs-proto/compare/v0.2.9...v0.2.10
1 change: 1 addition & 0 deletions session/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type (
LastEpoch uint64
ObjectID []ObjectID
OwnerID OwnerID
PublicKeys [][]byte
}
)

Expand Down
1 change: 1 addition & 0 deletions session/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (s *simpleStore) New(p TokenParams) *PToken {
LastEpoch: p.LastEpoch,
ObjectID: p.ObjectID,
OwnerID: p.OwnerID,
PublicKeys: p.PublicKeys,
},
PrivateKey: key,
}
Expand Down
13 changes: 11 additions & 2 deletions session/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ func TestTokenStore(t *testing.T) {

c := newTestClient(t)
require.NotNil(t, c)
pk := [][]byte{crypto.MarshalPublicKey(&c.PublicKey)}

// 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)

// check that it can be fetched
Expand All @@ -68,7 +73,11 @@ func TestTokenStore(t *testing.T) {
require.Equal(t, token, t1)

// 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)

data := []byte{1, 2, 3}
Expand Down

0 comments on commit 25cf1e8

Please sign in to comment.