[#168] acl: Implement binary/JSON encoders/decoders on HeaderFilter

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 14:31:53 +03:00 committed by Alex Vanin
parent 9bebc1247d
commit 7f42156201
6 changed files with 175 additions and 60 deletions

View file

@ -64,3 +64,15 @@ func TestBearerTokenJSON(t *testing.T) {
require.Equal(t, exp, got)
})
}
func TestFilterJSON(t *testing.T) {
f := generateFilter(acl.HeaderTypeObject, "key", "value")
data, err := f.MarshalJSON()
require.NoError(t, err)
f2 := new(acl.HeaderFilter)
require.NoError(t, f2.UnmarshalJSON(data))
require.Equal(t, f, f2)
}