Tree service: Do not wrap error from APE support/v0.42 #1321

Merged

View file

@ -138,7 +138,7 @@ func (s *Service) checkAPE(ctx context.Context, bt *bearer.Token,
request, err := s.newAPERequest(ctx, namespace, cid, operation, role, publicKey) request, err := s.newAPERequest(ctx, namespace, cid, operation, role, publicKey)
if err != nil { if err != nil {
return apeErr(err) return fmt.Errorf("failed to create ape request: %w", err)
} }
var cr engine.ChainRouter var cr engine.ChainRouter
@ -167,7 +167,7 @@ func (s *Service) checkAPE(ctx context.Context, bt *bearer.Token,
rt := engine.NewRequestTargetExtended(namespace, cid.EncodeToString(), fmt.Sprintf("%s:%s", namespace, publicKey.Address()), groups) rt := engine.NewRequestTargetExtended(namespace, cid.EncodeToString(), fmt.Sprintf("%s:%s", namespace, publicKey.Address()), groups)
status, found, err := cr.IsAllowed(apechain.Ingress, rt, request) status, found, err := cr.IsAllowed(apechain.Ingress, rt, request)
if err != nil { if err != nil {
return apeErr(err) return err
} }
if found && status == apechain.Allow { if found && status == apechain.Allow {
return nil return nil