Source: security/policy/validation-request.js

  1. /**
  2. * Copyright (C) 2014-2018 Regents of the University of California.
  3. * @author: Jeff Thompson <jefft0@remap.ucla.edu>
  4. * From ndn-cxx security by Yingdi Yu <yingdi@cs.ucla.edu>.
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. * A copy of the GNU Lesser General Public License is in the file COPYING.
  19. */
  20. /**
  21. * A ValidationRequest is used to return information from
  22. * PolicyManager.checkVerificationPolicy.
  23. *
  24. * Create a new ValidationRequest with the given values.
  25. * @param {Interest} interest An interest for fetching more data.
  26. * @param {function} onVerified If the signature is verified, this calls
  27. * onVerified(data).
  28. * @param {function} onValidationFailed If the signature check fails, this calls
  29. * onValidationFailed(data, reason).
  30. * @param {number} retry The number of retrials when there is an interest timeout.
  31. * @param {number} stepCount The number of verification steps that have been
  32. * done, used to track the verification progress.
  33. * @constructor
  34. */
  35. var ValidationRequest = function ValidationRequest
  36. (interest, onVerified, onValidationFailed, retry, stepCount)
  37. {
  38. this.interest = interest;
  39. this.onVerified = onVerified;
  40. this.onValidationFailed = onValidationFailed;
  41. this.retry = retry;
  42. this.stepCount = stepCount;
  43. };
  44. exports.ValidationRequest = ValidationRequest;