forked from TrueCloudLab/frostfs-rest-gw
[#15] Sign base64 token representation
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
5bee10d096
commit
fd0ff4b803
4 changed files with 21 additions and 4 deletions
|
@ -3,6 +3,7 @@ package handlers
|
|||
import (
|
||||
"testing"
|
||||
|
||||
sessionv2 "github.com/nspcc-dev/neofs-api-go/v2/session"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
@ -35,3 +36,17 @@ func TestCheckContainerName(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPrepareSessionToken(t *testing.T) {
|
||||
st := &SessionToken{
|
||||
BearerToken: BearerToken{
|
||||
Token: "ChASxCTiXwREjLAG7nkxjDHVEhsKGTVxfQ56a0uQeFmOO63mqykBS1HNpw1rxSgaBgjIAhjkASIhAnLj82Qmdlcg7JtoyhDjJ1OsRFjtmxdXbzrwVkwxWAdWMgQIAxAB",
|
||||
Signature: "2ebdc1f2fea2bba397d1be6f982a6fe1b2bc9f46a348b700108fe2eba4e6531a1bb585febf9a40a3fa2e085fca5e2a75ca57f61166117c6d3e04a95ef9a2d2196f52648546784853e17c0b7ba762eae1",
|
||||
Key: "03bd9108c0b49f657e9eee50d1399022bd1e436118e5b7529a1b7cd606652f578f",
|
||||
},
|
||||
Verb: sessionv2.ContainerVerbSetEACL,
|
||||
}
|
||||
|
||||
_, err := prepareSessionToken(st, true)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue