forked from TrueCloudLab/frostfs-api-go
service: implement Token field setter on RequestVerificationHeader
After recent changes Token field is presented in RequestVerificationHeader. There is a need to provide an interface of field getter/setter. This commit: * defines TokenHeader interface of token value container; * implements Token field setter on RequestVerificationHeader.
This commit is contained in:
parent
09f8ee52d0
commit
942bedb8ed
2 changed files with 25 additions and 0 deletions
|
@ -188,3 +188,17 @@ func TestVerifyAndSignRequestHeaderWithoutCloning(t *testing.T) {
|
|||
|
||||
require.Contains(t, buf.String(), "proto: don't know how to copy")
|
||||
}
|
||||
|
||||
func TestRequestVerificationHeader_SetToken(t *testing.T) {
|
||||
id, err := refs.NewUUID()
|
||||
require.NoError(t, err)
|
||||
|
||||
token := new(Token)
|
||||
token.ID = id
|
||||
|
||||
h := new(RequestVerificationHeader)
|
||||
|
||||
h.SetToken(token)
|
||||
|
||||
require.Equal(t, token, h.GetToken())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue