2022-03-24 08:05:41 +00:00
|
|
|
package bearertest
|
|
|
|
|
|
|
|
import (
|
2024-05-30 08:27:21 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape"
|
2023-03-07 11:20:03 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer"
|
|
|
|
eacltest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/eacl/test"
|
|
|
|
usertest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user/test"
|
2022-03-24 08:05:41 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Token returns random bearer.Token.
|
|
|
|
//
|
|
|
|
// Resulting token is unsigned.
|
|
|
|
func Token() (t bearer.Token) {
|
2022-06-01 10:39:33 +00:00
|
|
|
t.SetExp(3)
|
|
|
|
t.SetNbf(2)
|
|
|
|
t.SetIat(1)
|
2023-11-21 08:35:10 +00:00
|
|
|
t.ForUser(usertest.ID())
|
2022-03-24 08:05:41 +00:00
|
|
|
t.SetEACLTable(*eacltest.Table())
|
2024-05-30 08:27:21 +00:00
|
|
|
t.SetAPEOverride(APEOverride())
|
2022-03-24 08:05:41 +00:00
|
|
|
|
|
|
|
return t
|
|
|
|
}
|
2024-05-30 08:27:21 +00:00
|
|
|
|
|
|
|
func APEOverride() bearer.APEOverride {
|
|
|
|
return bearer.APEOverride{
|
|
|
|
Target: ape.ChainTarget{
|
|
|
|
TargetType: ape.TargetTypeContainer,
|
|
|
|
Name: "F8JsMnChywiPvbDvpxMbjTjx5KhWHHp6gCDt8BhzL9kF",
|
|
|
|
},
|
|
|
|
Chains: []ape.Chain{{Raw: []byte("{}")}},
|
|
|
|
}
|
|
|
|
}
|