From b3ccd0166f503cb7dad13cef6fa2ae18d61f3218 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 21 Feb 2023 11:23:08 +0300 Subject: [PATCH] [#17] acl: Add impersonate flag to bearer token Signed-off-by: Denis Kirillov --- CHANGELOG.md | 2 ++ acl/convert.go | 3 +++ acl/grpc/types.go | 5 +++++ acl/grpc/types.pb.go | Bin 38771 -> 39444 bytes acl/marshal.go | 5 ++++- acl/types.go | 14 ++++++++++++++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab694e..8f7a84e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [Unreleased] ### Added +- Add impersonate flag to bearer token (#17) + ### Fixed ### Changed ### Updated diff --git a/acl/convert.go b/acl/convert.go index d42aebd..3020f4d 100644 --- a/acl/convert.go +++ b/acl/convert.go @@ -427,6 +427,7 @@ func (bt *BearerTokenBody) ToGRPCMessage() grpc.Message { m.SetOwnerId(bt.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID)) m.SetLifetime(bt.lifetime.ToGRPCMessage().(*acl.BearerToken_Body_TokenLifetime)) m.SetEaclTable(bt.eacl.ToGRPCMessage().(*acl.EACLTable)) + m.SetImpersonate(bt.impersonate) } return m @@ -479,6 +480,8 @@ func (bt *BearerTokenBody) FromGRPCMessage(m grpc.Message) error { err = bt.eacl.FromGRPCMessage(eacl) } + bt.impersonate = v.GetAllowImpersonate() + return err } diff --git a/acl/grpc/types.go b/acl/grpc/types.go index e1e5336..b07f893 100644 --- a/acl/grpc/types.go +++ b/acl/grpc/types.go @@ -84,6 +84,11 @@ func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) { m.Lifetime = v } +// SetImpersonate allows impersonate. +func (m *BearerToken_Body) SetImpersonate(v bool) { + m.AllowImpersonate = v +} + // SetBody sets bearer token body. func (m *BearerToken) SetBody(v *BearerToken_Body) { m.Body = v diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 3581b88bc3a0e56e325115f4013d693fd476b583..583f89ac0cf970438f7b790a14291264c888316a 100644 GIT binary patch delta 1268 zcmah{OHUI~6pjs#v={}fSS6SX2@y;q({|c|@d3dFL?(i66isB>xy909249Ay^_X46 zhhqUjGMHiBwXDlBS#BB(1JB8G#!DWz3~sQ#{vqb+DU-9TwLzD%jhPP2w2pXe%CXbj zb-96Lf5}PNwh7PA?;BCW_LLX4^hthF7n-kTw?v00P`rHJ)=C(OJv-LM1bVz}XBE7N zw8OdK+RBfir79@LgLnxX*eRf+laYkT#g^8cSinCY@H^bgI~L36rpqgfBTquUlu{X( zSoir-(Mtd1?W!};FjGp=R5;*QN{TKnk%%}G@=Q}K&y0wZNpZ$0PV^9Jz~L)RU}tKB z@|6>rBuJ|8Io;XaO-1xqM4_U8(+ef)4(44Mcx^Vp3FBbEASxCAfG^V;+;s zpioETk&5&~&pvP^68%}*ykKnLeDwL|?RH$YI@XFO-eU``-PlL76 z-s(72-0`SFjc@f7kBN$JnAV%7iVJzlkv7FCQx&$rSGNmULnymGK(5Nt{RItjo*y2$ zL1-)-h2_E_I8`93cL@EuOksENKdc{%H86@o)uj0AXHlz0Pn0OUFSbCobXqv1(ytrh z$;D@-Z4M};6%EAtmKh0bx+%DH0W53)WVS*J5hY+v0xAtxjcrY;_qqlj^3=pV49DiG zpt-b149+*JL0R8jCx$0}#odCJV<8w$*TBu$u#haL^2bXoTFDPLC@DcNR~9wkYx|rA ztDe73l~W`|x8|q^xld9N_KwM)F!{|qDH@okoP^wOG9W?DEK5Kxm0b3yA&LVF8km>- oburR_n~ra}1!BQ@idIx{A|nE;5>OHZkZ05>ERF^%edTEAHz8zz@Bjb+ delta 751 zcmY+CKZp}S6vnybP!dkTaK>n&M)41L3r_aWY-~Ib1vy<5t`Q}LNwkp@kz}*G$>mR_ zAcFAOSz3uA;#!FW8%u>Kh>hskDu`H|cFudV$DPfvJKvjce)GL||Aq1UsqyUN+2p4` zo=y%dJ}($mJNb0&uVGZ(hb^ zb9jh^GeHsM=p=o94fo+zbR2JMC9FiJ){kZJC(hx0H-|^@JikC#h~pBnUHt;5K>#U+ zqX24MO_qkmd=sexN@4pis8CoiT414|z<>^%T4jWtIIou775Z)jx}}rSMMC|g);@R7xfLt`F7Q%TC@WzeM^U| zI-@9bmk8|eAWdJjLJ8a!iU79