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

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-13 15:08:37 +03:00 committed by Alex Vanin
parent d8fa8df442
commit ec957be60c
6 changed files with 108 additions and 44 deletions

View file

@ -468,3 +468,14 @@ func (bt *BearerToken) StableSize() (size int) {
return size
}
func (bt *BearerToken) Unmarshal(data []byte) error {
m := new(acl.BearerToken)
if err := proto.Unmarshal(data, m); err != nil {
return err
}
*bt = *BearerTokenFromGRPCMessage(m)
return nil
}