[#1184] node: Add audit middleware for grpc services

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-06-18 12:40:03 +03:00
parent ac1f014747
commit ecd1ed7a5e
16 changed files with 967 additions and 36 deletions

View file

@ -30,8 +30,8 @@ func initControlService(c *cfg) {
for i := range pubs {
rawPubs = append(rawPubs, pubs[i].Bytes())
}
ctlSvc := controlSvc.New(
var ctlSvc control.ControlServiceServer
ctlSvc = controlSvc.New(
controlSvc.WithKey(&c.key.PrivateKey),
controlSvc.WithAuthorizedKeys(rawPubs),
controlSvc.WithHealthChecker(c),
@ -43,6 +43,7 @@ func initControlService(c *cfg) {
controlSvc.WithTreeService(c.treeService),
controlSvc.WithLocalOverrideStorage(c.cfgObject.cfgAccessPolicyEngine.accessPolicyEngine),
)
ctlSvc = controlSvc.NewAuditService(ctlSvc, c.log, c.audit)
lis, err := net.Listen("tcp", endpoint)
if err != nil {