From 498f9955eacab62c0995676245860333796d5d5f Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 11 Apr 2024 17:06:09 +0300 Subject: [PATCH] [#1089] control: Add USER and GROUP targets for local override storage Signed-off-by: Evgenii Stratonikov --- pkg/services/control/server/policy_engine.go | 14 ++++++++++++++ pkg/services/control/service.pb.go | Bin 259222 -> 259230 bytes pkg/services/control/service_grpc.pb.go | Bin 41725 -> 41765 bytes pkg/services/control/types.pb.go | Bin 33771 -> 34061 bytes pkg/services/control/types.proto | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/pkg/services/control/server/policy_engine.go b/pkg/services/control/server/policy_engine.go index 16b365b21..7ec3d58ac 100644 --- a/pkg/services/control/server/policy_engine.go +++ b/pkg/services/control/server/policy_engine.go @@ -19,6 +19,10 @@ func apeTarget(chainTarget *control.ChainTarget) (engine.Target, error) { return engine.ContainerTarget(chainTarget.GetName()), nil case control.ChainTarget_NAMESPACE: return engine.NamespaceTarget(chainTarget.GetName()), nil + case control.ChainTarget_USER: + return engine.UserTarget(chainTarget.GetName()), nil + case control.ChainTarget_GROUP: + return engine.GroupTarget(chainTarget.GetName()), nil default: } return engine.Target{}, status.Error(codes.InvalidArgument, @@ -42,6 +46,16 @@ func controlTarget(chainTarget *engine.Target) (control.ChainTarget, error) { Name: nm, Type: control.ChainTarget_NAMESPACE, }, nil + case engine.User: + return control.ChainTarget{ + Name: chainTarget.Name, + Type: control.ChainTarget_USER, + }, nil + case engine.Group: + return control.ChainTarget{ + Name: chainTarget.Name, + Type: control.ChainTarget_GROUP, + }, nil default: } return control.ChainTarget{}, status.Error(codes.InvalidArgument, diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index 345110bab826c0f281abf10407d0a3fc5c3e7ef5..9c597beeccd6db19096889a7073067a75a35e221 100644 GIT binary patch delta 41 scmbRCl7HSy{)R1#S$Qm6ocj9Pv+@}CsDYX7YEv13m}$G(ROW(s04`b$SpWb4 delta 31 lcmbRDl7HGu{)R1#S$W&@@)-B1wd+k~1Y)M`dQ+JT;sM*f42u8& diff --git a/pkg/services/control/service_grpc.pb.go b/pkg/services/control/service_grpc.pb.go index 95264fcd3edfb6b803d82f58ae8e3fc0a751049e..feeee0006526e16347ed137d6745eecb0aaafbcc 100644 GIT binary patch delta 165 zcmex+lxgWPrVV=qShzU#^*8So*u(^3tS$9V1;X1a5WKm@{y!sxmoIEI`GSMs=6#L_nIR(e ZuE${7Xk3YjT-T%3~=B_$^N=}S$HHIOc2``&!t%zX2Hyi<0zl~3Q&ed+_x z@uTO?np;_aH9z;TEcjql(+0$pFjM~!X3J0JpZ+D_u?lopenE<1A)@Rpq-Z!Qxg4Zi5BaR8lIoUA;}m{=Aor~-c4&C7V5zO@+-qM$yw0fE`x!7x8P>^4cw1-_|YfkkZj39&kT827{D2--KO|1Wtc@dd72|7>@2PywE z6fnGYd<`cEUWPh~;Si=GRxd`hv^Nn~K45SxK_=F*7ilQRdD3kr@cXkIUM$=ucp4|V J#_za!>kl^1$@BmK delta 468 zcmeC}VtU=qwBd@#OtCVv*q-rOYi+n34GaC3c%6cdxN<>uLGag38IGK?or zkC0>H;+(u8OLX#s44ug`*Htj>%ytA?12(M) z$m~xSn{1Q80n&as8?4gzbCl@4(avMQ> zZUR#LFCXMS#{#f|gZZM9OA2%*X9j`2f1to|@}D?&