[#1328] services/tree: Implement access control

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-05-05 14:00:30 +03:00 committed by fyrchik
parent 94b9e13431
commit 16e3421825
8 changed files with 1904 additions and 218 deletions

View file

@ -52,16 +52,10 @@ func (s *Service) replicateLoop(ctx context.Context) {
func (s *Service) replicate(ctx context.Context, op movePair) error {
req := newApplyRequest(&op)
// TODO(@fyrchik): #1328 access control
//err := signature.SignDataWithHandler(s.key, req, func(key, sign []byte) {
// req.Signature = &Signature{
// Key: key,
// Sign: sign,
// }
//})
//if err != nil {
// return fmt.Errorf("can't sign data: %w", err)
//}
err := signMessage(req, s.key)
if err != nil {
return fmt.Errorf("can't sign data: %w", err)
}
nodes, err := s.getContainerNodes(op.cid)
if err != nil {