forked from TrueCloudLab/frostfs-api-go
[#169] sdk/client: Do not resign session token
In some cases SDK Client provided with signed and prepared session token. In this case we don't need to change verb or sign it. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
d3e3889425
commit
7b3736567c
2 changed files with 16 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
package token
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg"
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/owner"
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/session"
|
||||
)
|
||||
|
@ -68,3 +69,10 @@ func (t *SessionToken) SetSessionKey(v []byte) {
|
|||
body.SetSessionKey(v)
|
||||
})
|
||||
}
|
||||
|
||||
func (t *SessionToken) Signature() *pkg.Signature {
|
||||
return pkg.NewSignatureFromV2(
|
||||
(*session.SessionToken)(t).
|
||||
GetSignature(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue