forked from TrueCloudLab/frostfs-sdk-go
[#252] session: Add Object.Issuer
method
Add method to get `Object` session's issuer similar to `Container`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
1f7fe6864d
commit
bef4618cd6
2 changed files with 33 additions and 0 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
addresstest "github.com/nspcc-dev/neofs-sdk-go/object/address/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/session"
|
||||
sessiontest "github.com/nspcc-dev/neofs-sdk-go/session/test"
|
||||
"github.com/nspcc-dev/neofs-sdk-go/user"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -294,3 +295,18 @@ func TestObjectSignature(t *testing.T) {
|
|||
require.True(t, x.VerifySignature())
|
||||
}
|
||||
}
|
||||
|
||||
func TestObject_Issuer(t *testing.T) {
|
||||
var token session.Object
|
||||
signer := randSigner()
|
||||
|
||||
require.Zero(t, token.Issuer())
|
||||
|
||||
require.NoError(t, token.Sign(signer))
|
||||
|
||||
var issuer user.ID
|
||||
|
||||
user.IDFromKey(&issuer, signer.PublicKey)
|
||||
|
||||
require.True(t, token.Issuer().Equals(issuer))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue