freezerwatch 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/CODE_OF_CONDUCT.md +13 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +40 -0
  7. data/Rakefile +1 -0
  8. data/bin/console +14 -0
  9. data/bin/freezerwatch +9 -0
  10. data/bin/setup +7 -0
  11. data/freezerwatch.gemspec +23 -0
  12. data/lib/freezerwatch.rb +5 -0
  13. data/lib/freezerwatch/version.rb +3 -0
  14. data/node_modules/.bin/freezerwatch +139 -0
  15. data/node_modules/freezerwatch/.npmignore +3 -0
  16. data/node_modules/freezerwatch/.ruby-version +1 -0
  17. data/node_modules/freezerwatch/Gemfile +4 -0
  18. data/node_modules/freezerwatch/Gemfile.lock +79 -0
  19. data/node_modules/freezerwatch/LICENSE +23 -0
  20. data/node_modules/freezerwatch/README.md +41 -0
  21. data/node_modules/freezerwatch/Rakefile +13 -0
  22. data/node_modules/freezerwatch/freezerwatch.js +139 -0
  23. data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
  24. data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
  25. data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
  26. data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
  27. data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
  28. data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
  29. data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
  30. data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
  31. data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
  32. data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
  33. data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
  34. data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
  35. data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
  36. data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
  37. data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
  38. data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
  39. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
  40. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
  41. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
  42. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
  43. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
  44. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
  45. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  46. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
  47. data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
  48. data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
  49. data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
  50. data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
  51. data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
  52. data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
  53. data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
  54. data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
  55. data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
  56. data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
  57. data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
  58. data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
  59. data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
  60. data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
  61. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
  62. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
  63. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
  64. data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
  65. data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
  66. data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
  67. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
  68. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
  69. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
  70. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
  71. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
  72. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
  73. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
  74. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
  75. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
  76. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
  77. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
  78. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
  79. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
  80. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
  81. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
  82. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
  83. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
  84. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
  85. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
  86. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
  87. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
  88. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
  89. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
  90. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
  91. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
  92. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
  93. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
  94. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
  95. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
  96. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
  97. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
  98. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
  99. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +2 -0
  100. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
  101. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
  102. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
  103. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
  104. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +42 -0
  105. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +6 -0
  106. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +38 -0
  107. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +21 -0
  108. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +14 -0
  109. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +48 -0
  110. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +15 -0
  111. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +18 -0
  112. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +13 -0
  113. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +13 -0
  114. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +7 -0
  115. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
  116. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
  117. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
  118. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
  119. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
  120. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
  121. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
  122. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
  123. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
  124. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
  125. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
  126. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
  127. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
  128. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
  129. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
  130. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
  131. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
  132. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
  133. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
  134. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
  135. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
  136. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
  137. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
  138. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
  139. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
  140. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
  141. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
  142. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
  143. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
  144. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
  145. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
  146. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
  147. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
  148. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
  149. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
  150. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
  151. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
  152. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
  153. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
  154. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
  155. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
  156. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
  157. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
  158. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
  159. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
  160. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
  161. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
  162. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
  163. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
  164. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
  165. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
  166. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
  167. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
  168. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
  169. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
  170. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
  171. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
  172. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
  173. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
  174. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
  175. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
  176. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
  177. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
  178. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
  179. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
  180. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
  181. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
  182. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
  183. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
  184. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
  185. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
  186. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
  187. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
  188. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
  189. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
  190. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
  191. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
  192. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
  193. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
  194. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
  195. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
  196. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
  197. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
  198. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
  199. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
  200. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
  201. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
  202. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
  203. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
  204. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
  205. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
  206. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
  207. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
  208. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
  209. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
  210. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
  211. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
  212. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
  213. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
  214. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
  215. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
  216. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
  217. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
  218. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
  219. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
  220. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
  221. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
  222. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
  223. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
  224. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
  225. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
  226. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
  227. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
  228. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
  229. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
  230. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
  231. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
  232. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
  233. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
  234. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
  235. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
  236. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
  237. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
  238. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
  239. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
  240. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
  241. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
  242. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
  243. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
  244. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
  245. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
  246. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
  247. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
  248. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
  249. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
  250. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
  251. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
  252. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
  253. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
  254. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
  255. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
  256. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
  257. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
  258. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
  259. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
  260. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
  261. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
  262. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
  263. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
  264. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
  265. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
  266. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
  267. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
  268. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
  269. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
  270. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
  271. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
  272. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
  273. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
  274. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
  275. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
  276. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
  277. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
  278. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
  279. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
  280. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
  281. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
  282. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
  283. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
  284. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
  285. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
  286. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
  287. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
  288. data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
  289. data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
  290. data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
  291. data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
  292. data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
  293. data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
  294. data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
  295. data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
  296. data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
  297. data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
  298. data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
  299. data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
  300. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
  301. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
  302. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
  303. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
  304. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
  305. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
  306. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
  307. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
  308. data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
  309. data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
  310. data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
  311. data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
  312. data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
  313. data/node_modules/freezerwatch/package.json +37 -0
  314. metadata +384 -0
@@ -0,0 +1,20 @@
1
+ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
2
+
3
+ // If you have no idea what ASN.1 or BER is, see this:
4
+ // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
5
+
6
+ var Ber = require('./ber/index');
7
+
8
+
9
+
10
+ ///--- Exported API
11
+
12
+ module.exports = {
13
+
14
+ Ber: Ber,
15
+
16
+ BerReader: Ber.Reader,
17
+
18
+ BerWriter: Ber.Writer
19
+
20
+ };
@@ -0,0 +1,63 @@
1
+ {
2
+ "author": {
3
+ "name": "Mark Cavage",
4
+ "email": "mcavage@gmail.com"
5
+ },
6
+ "contributors": [
7
+ {
8
+ "name": "David Gwynne",
9
+ "email": "loki@animata.net"
10
+ },
11
+ {
12
+ "name": "Yunong Xiao",
13
+ "email": "yunong@joyent.com"
14
+ }
15
+ ],
16
+ "name": "asn1",
17
+ "description": "Contains parsers and serializers for ASN.1 (currently BER only)",
18
+ "version": "0.1.11",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git://github.com/mcavage/node-asn1.git"
22
+ },
23
+ "main": "lib/index.js",
24
+ "engines": {
25
+ "node": ">=0.4.9"
26
+ },
27
+ "dependencies": {},
28
+ "devDependencies": {
29
+ "tap": "0.1.4"
30
+ },
31
+ "scripts": {
32
+ "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi",
33
+ "test": "tap ./tst"
34
+ },
35
+ "_npmUser": {
36
+ "name": "mcavage",
37
+ "email": "mcavage@gmail.com"
38
+ },
39
+ "_id": "asn1@0.1.11",
40
+ "_engineSupported": true,
41
+ "_npmVersion": "1.1.0-beta-4",
42
+ "_nodeVersion": "v0.6.6",
43
+ "_defaultsLoaded": true,
44
+ "dist": {
45
+ "shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
46
+ "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
47
+ },
48
+ "maintainers": [
49
+ {
50
+ "name": "mcavage",
51
+ "email": "mcavage@gmail.com"
52
+ }
53
+ ],
54
+ "directories": {},
55
+ "_shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
56
+ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz",
57
+ "_from": "asn1@0.1.11",
58
+ "bugs": {
59
+ "url": "https://github.com/mcavage/node-asn1/issues"
60
+ },
61
+ "readme": "ERROR: No README data found!",
62
+ "homepage": "https://github.com/mcavage/node-asn1#readme"
63
+ }
@@ -0,0 +1,172 @@
1
+ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
2
+
3
+ var test = require('tap').test;
4
+
5
+
6
+
7
+ ///--- Globals
8
+
9
+ var BerReader;
10
+
11
+
12
+
13
+ ///--- Tests
14
+
15
+ test('load library', function(t) {
16
+ BerReader = require('../../lib/index').BerReader;
17
+ t.ok(BerReader);
18
+ try {
19
+ new BerReader();
20
+ t.fail('Should have thrown');
21
+ } catch (e) {
22
+ t.ok(e instanceof TypeError, 'Should have been a type error');
23
+ }
24
+ t.end();
25
+ });
26
+
27
+
28
+ test('read byte', function(t) {
29
+ var reader = new BerReader(new Buffer([0xde]));
30
+ t.ok(reader);
31
+ t.equal(reader.readByte(), 0xde, 'wrong value');
32
+ t.end();
33
+ });
34
+
35
+
36
+ test('read 1 byte int', function(t) {
37
+ var reader = new BerReader(new Buffer([0x02, 0x01, 0x03]));
38
+ t.ok(reader);
39
+ t.equal(reader.readInt(), 0x03, 'wrong value');
40
+ t.equal(reader.length, 0x01, 'wrong length');
41
+ t.end();
42
+ });
43
+
44
+
45
+ test('read 2 byte int', function(t) {
46
+ var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde]));
47
+ t.ok(reader);
48
+ t.equal(reader.readInt(), 0x7ede, 'wrong value');
49
+ t.equal(reader.length, 0x02, 'wrong length');
50
+ t.end();
51
+ });
52
+
53
+
54
+ test('read 3 byte int', function(t) {
55
+ var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03]));
56
+ t.ok(reader);
57
+ t.equal(reader.readInt(), 0x7ede03, 'wrong value');
58
+ t.equal(reader.length, 0x03, 'wrong length');
59
+ t.end();
60
+ });
61
+
62
+
63
+ test('read 4 byte int', function(t) {
64
+ var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01]));
65
+ t.ok(reader);
66
+ t.equal(reader.readInt(), 0x7ede0301, 'wrong value');
67
+ t.equal(reader.length, 0x04, 'wrong length');
68
+ t.end();
69
+ });
70
+
71
+
72
+ test('read boolean true', function(t) {
73
+ var reader = new BerReader(new Buffer([0x01, 0x01, 0xff]));
74
+ t.ok(reader);
75
+ t.equal(reader.readBoolean(), true, 'wrong value');
76
+ t.equal(reader.length, 0x01, 'wrong length');
77
+ t.end();
78
+ });
79
+
80
+
81
+ test('read boolean false', function(t) {
82
+ var reader = new BerReader(new Buffer([0x01, 0x01, 0x00]));
83
+ t.ok(reader);
84
+ t.equal(reader.readBoolean(), false, 'wrong value');
85
+ t.equal(reader.length, 0x01, 'wrong length');
86
+ t.end();
87
+ });
88
+
89
+
90
+ test('read enumeration', function(t) {
91
+ var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20]));
92
+ t.ok(reader);
93
+ t.equal(reader.readEnumeration(), 0x20, 'wrong value');
94
+ t.equal(reader.length, 0x01, 'wrong length');
95
+ t.end();
96
+ });
97
+
98
+
99
+ test('read string', function(t) {
100
+ var dn = 'cn=foo,ou=unit,o=test';
101
+ var buf = new Buffer(dn.length + 2);
102
+ buf[0] = 0x04;
103
+ buf[1] = Buffer.byteLength(dn);
104
+ buf.write(dn, 2);
105
+ var reader = new BerReader(buf);
106
+ t.ok(reader);
107
+ t.equal(reader.readString(), dn, 'wrong value');
108
+ t.equal(reader.length, dn.length, 'wrong length');
109
+ t.end();
110
+ });
111
+
112
+
113
+ test('read sequence', function(t) {
114
+ var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
115
+ t.ok(reader);
116
+ t.equal(reader.readSequence(), 0x30, 'wrong value');
117
+ t.equal(reader.length, 0x03, 'wrong length');
118
+ t.equal(reader.readBoolean(), true, 'wrong value');
119
+ t.equal(reader.length, 0x01, 'wrong length');
120
+ t.end();
121
+ });
122
+
123
+
124
+ test('anonymous LDAPv3 bind', function(t) {
125
+ var BIND = new Buffer(14);
126
+ BIND[0] = 0x30; // Sequence
127
+ BIND[1] = 12; // len
128
+ BIND[2] = 0x02; // ASN.1 Integer
129
+ BIND[3] = 1; // len
130
+ BIND[4] = 0x04; // msgid (make up 4)
131
+ BIND[5] = 0x60; // Bind Request
132
+ BIND[6] = 7; // len
133
+ BIND[7] = 0x02; // ASN.1 Integer
134
+ BIND[8] = 1; // len
135
+ BIND[9] = 0x03; // v3
136
+ BIND[10] = 0x04; // String (bind dn)
137
+ BIND[11] = 0; // len
138
+ BIND[12] = 0x80; // ContextSpecific (choice)
139
+ BIND[13] = 0; // simple bind
140
+
141
+ // Start testing ^^
142
+ var ber = new BerReader(BIND);
143
+ t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence');
144
+ t.equal(ber.length, 12, 'Message length should be 12');
145
+ t.equal(ber.readInt(), 4, 'Message id should have been 4');
146
+ t.equal(ber.readSequence(), 96, 'Bind Request should have been 96');
147
+ t.equal(ber.length, 7, 'Bind length should have been 7');
148
+ t.equal(ber.readInt(), 3, 'LDAP version should have been 3');
149
+ t.equal(ber.readString(), '', 'Bind DN should have been empty');
150
+ t.equal(ber.length, 0, 'string length should have been 0');
151
+ t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)');
152
+ t.equal(ber.readByte(), 0, 'Should have been simple bind');
153
+ t.equal(null, ber.readByte(), 'Should be out of data');
154
+ t.end();
155
+ });
156
+
157
+
158
+ test('long string', function(t) {
159
+ var buf = new Buffer(256);
160
+ var o;
161
+ var s =
162
+ '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' +
163
+ 'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' +
164
+ 'Teena Vradmin\'s description.';
165
+ buf[0] = 0x04;
166
+ buf[1] = 0x81;
167
+ buf[2] = 0x94;
168
+ buf.write(s, 3);
169
+ var ber = new BerReader(buf.slice(0, 3 + s.length));
170
+ t.equal(ber.readString(), s);
171
+ t.end();
172
+ });
@@ -0,0 +1,296 @@
1
+ // Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
2
+
3
+ var test = require('tap').test;
4
+ var sys = require('sys');
5
+
6
+ ///--- Globals
7
+
8
+ var BerWriter;
9
+
10
+ var BerReader;
11
+
12
+
13
+ ///--- Tests
14
+
15
+ test('load library', function(t) {
16
+ BerWriter = require('../../lib/index').BerWriter;
17
+ t.ok(BerWriter);
18
+ t.ok(new BerWriter());
19
+ t.end();
20
+ });
21
+
22
+
23
+ test('write byte', function(t) {
24
+ var writer = new BerWriter();
25
+
26
+ writer.writeByte(0xC2);
27
+ var ber = writer.buffer;
28
+
29
+ t.ok(ber);
30
+ t.equal(ber.length, 1, 'Wrong length');
31
+ t.equal(ber[0], 0xC2, 'value wrong');
32
+
33
+ t.end();
34
+ });
35
+
36
+
37
+ test('write 1 byte int', function(t) {
38
+ var writer = new BerWriter();
39
+
40
+ writer.writeInt(0x7f);
41
+ var ber = writer.buffer;
42
+
43
+ t.ok(ber);
44
+ t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length);
45
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]);
46
+ t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]);
47
+ t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]);
48
+
49
+ t.end();
50
+ });
51
+
52
+
53
+ test('write 2 byte int', function(t) {
54
+ var writer = new BerWriter();
55
+
56
+ writer.writeInt(0x7ffe);
57
+ var ber = writer.buffer;
58
+
59
+ t.ok(ber);
60
+ t.equal(ber.length, 4, 'Wrong length for an int');
61
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
62
+ t.equal(ber[1], 0x02, 'length wrong');
63
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
64
+ t.equal(ber[3], 0xfe, 'value wrong (byte 2)');
65
+
66
+ t.end();
67
+ });
68
+
69
+
70
+ test('write 3 byte int', function(t) {
71
+ var writer = new BerWriter();
72
+
73
+ writer.writeInt(0x7ffffe);
74
+ var ber = writer.buffer;
75
+
76
+ t.ok(ber);
77
+ t.equal(ber.length, 5, 'Wrong length for an int');
78
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
79
+ t.equal(ber[1], 0x03, 'length wrong');
80
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
81
+ t.equal(ber[3], 0xff, 'value wrong (byte 2)');
82
+ t.equal(ber[4], 0xfe, 'value wrong (byte 3)');
83
+
84
+ t.end();
85
+ });
86
+
87
+
88
+ test('write 4 byte int', function(t) {
89
+ var writer = new BerWriter();
90
+
91
+ writer.writeInt(0x7ffffffe);
92
+ var ber = writer.buffer;
93
+
94
+ t.ok(ber);
95
+
96
+ t.equal(ber.length, 6, 'Wrong length for an int');
97
+ t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
98
+ t.equal(ber[1], 0x04, 'length wrong');
99
+ t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
100
+ t.equal(ber[3], 0xff, 'value wrong (byte 2)');
101
+ t.equal(ber[4], 0xff, 'value wrong (byte 3)');
102
+ t.equal(ber[5], 0xfe, 'value wrong (byte 4)');
103
+
104
+ t.end();
105
+ });
106
+
107
+
108
+ test('write boolean', function(t) {
109
+ var writer = new BerWriter();
110
+
111
+ writer.writeBoolean(true);
112
+ writer.writeBoolean(false);
113
+ var ber = writer.buffer;
114
+
115
+ t.ok(ber);
116
+ t.equal(ber.length, 6, 'Wrong length');
117
+ t.equal(ber[0], 0x01, 'tag wrong');
118
+ t.equal(ber[1], 0x01, 'length wrong');
119
+ t.equal(ber[2], 0xff, 'value wrong');
120
+ t.equal(ber[3], 0x01, 'tag wrong');
121
+ t.equal(ber[4], 0x01, 'length wrong');
122
+ t.equal(ber[5], 0x00, 'value wrong');
123
+
124
+ t.end();
125
+ });
126
+
127
+
128
+ test('write string', function(t) {
129
+ var writer = new BerWriter();
130
+ writer.writeString('hello world');
131
+ var ber = writer.buffer;
132
+
133
+ t.ok(ber);
134
+ t.equal(ber.length, 13, 'wrong length');
135
+ t.equal(ber[0], 0x04, 'wrong tag');
136
+ t.equal(ber[1], 11, 'wrong length');
137
+ t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
138
+
139
+ t.end();
140
+ });
141
+
142
+ test('write buffer', function(t) {
143
+ var writer = new BerWriter();
144
+ // write some stuff to start with
145
+ writer.writeString('hello world');
146
+ var ber = writer.buffer;
147
+ var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01,
148
+ 0xff, 0x01, 0x01, 0xff]);
149
+ writer.writeBuffer(buf.slice(2, buf.length), 0x04);
150
+ ber = writer.buffer;
151
+
152
+ t.ok(ber);
153
+ t.equal(ber.length, 26, 'wrong length');
154
+ t.equal(ber[0], 0x04, 'wrong tag');
155
+ t.equal(ber[1], 11, 'wrong length');
156
+ t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
157
+ t.equal(ber[13], buf[0], 'wrong tag');
158
+ t.equal(ber[14], buf[1], 'wrong length');
159
+ for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) {
160
+ t.equal(ber[i], buf[j], 'buffer contents not identical');
161
+ }
162
+ t.end();
163
+ });
164
+
165
+ test('write string array', function(t) {
166
+ var writer = new BerWriter();
167
+ writer.writeStringArray(['hello world', 'fubar!']);
168
+ var ber = writer.buffer;
169
+
170
+ t.ok(ber);
171
+
172
+ t.equal(ber.length, 21, 'wrong length');
173
+ t.equal(ber[0], 0x04, 'wrong tag');
174
+ t.equal(ber[1], 11, 'wrong length');
175
+ t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
176
+
177
+ t.equal(ber[13], 0x04, 'wrong tag');
178
+ t.equal(ber[14], 6, 'wrong length');
179
+ t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value');
180
+
181
+ t.end();
182
+ });
183
+
184
+
185
+ test('resize internal buffer', function(t) {
186
+ var writer = new BerWriter({size: 2});
187
+ writer.writeString('hello world');
188
+ var ber = writer.buffer;
189
+
190
+ t.ok(ber);
191
+ t.equal(ber.length, 13, 'wrong length');
192
+ t.equal(ber[0], 0x04, 'wrong tag');
193
+ t.equal(ber[1], 11, 'wrong length');
194
+ t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
195
+
196
+ t.end();
197
+ });
198
+
199
+
200
+ test('sequence', function(t) {
201
+ var writer = new BerWriter({size: 25});
202
+ writer.startSequence();
203
+ writer.writeString('hello world');
204
+ writer.endSequence();
205
+ var ber = writer.buffer;
206
+
207
+ t.ok(ber);
208
+ console.log(ber);
209
+ t.equal(ber.length, 15, 'wrong length');
210
+ t.equal(ber[0], 0x30, 'wrong tag');
211
+ t.equal(ber[1], 13, 'wrong length');
212
+ t.equal(ber[2], 0x04, 'wrong tag');
213
+ t.equal(ber[3], 11, 'wrong length');
214
+ t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value');
215
+
216
+ t.end();
217
+ });
218
+
219
+
220
+ test('nested sequence', function(t) {
221
+ var writer = new BerWriter({size: 25});
222
+ writer.startSequence();
223
+ writer.writeString('hello world');
224
+ writer.startSequence();
225
+ writer.writeString('hello world');
226
+ writer.endSequence();
227
+ writer.endSequence();
228
+ var ber = writer.buffer;
229
+
230
+ t.ok(ber);
231
+ t.equal(ber.length, 30, 'wrong length');
232
+ t.equal(ber[0], 0x30, 'wrong tag');
233
+ t.equal(ber[1], 28, 'wrong length');
234
+ t.equal(ber[2], 0x04, 'wrong tag');
235
+ t.equal(ber[3], 11, 'wrong length');
236
+ t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value');
237
+ t.equal(ber[15], 0x30, 'wrong tag');
238
+ t.equal(ber[16], 13, 'wrong length');
239
+ t.equal(ber[17], 0x04, 'wrong tag');
240
+ t.equal(ber[18], 11, 'wrong length');
241
+ t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value');
242
+
243
+ t.end();
244
+ });
245
+
246
+
247
+ test('LDAP bind message', function(t) {
248
+ var dn = 'cn=foo,ou=unit,o=test';
249
+ var writer = new BerWriter();
250
+ writer.startSequence();
251
+ writer.writeInt(3); // msgid = 3
252
+ writer.startSequence(0x60); // ldap bind
253
+ writer.writeInt(3); // ldap v3
254
+ writer.writeString(dn);
255
+ writer.writeByte(0x80);
256
+ writer.writeByte(0x00);
257
+ writer.endSequence();
258
+ writer.endSequence();
259
+ var ber = writer.buffer;
260
+
261
+ t.ok(ber);
262
+ t.equal(ber.length, 35, 'wrong length (buffer)');
263
+ t.equal(ber[0], 0x30, 'wrong tag');
264
+ t.equal(ber[1], 33, 'wrong length');
265
+ t.equal(ber[2], 0x02, 'wrong tag');
266
+ t.equal(ber[3], 1, 'wrong length');
267
+ t.equal(ber[4], 0x03, 'wrong value');
268
+ t.equal(ber[5], 0x60, 'wrong tag');
269
+ t.equal(ber[6], 28, 'wrong length');
270
+ t.equal(ber[7], 0x02, 'wrong tag');
271
+ t.equal(ber[8], 1, 'wrong length');
272
+ t.equal(ber[9], 0x03, 'wrong value');
273
+ t.equal(ber[10], 0x04, 'wrong tag');
274
+ t.equal(ber[11], dn.length, 'wrong length');
275
+ t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value');
276
+ t.equal(ber[33], 0x80, 'wrong tag');
277
+ t.equal(ber[34], 0x00, 'wrong len');
278
+
279
+ t.end();
280
+ });
281
+
282
+
283
+ test('Write OID', function(t) {
284
+ var oid = '1.2.840.113549.1.1.1';
285
+ var writer = new BerWriter();
286
+ writer.writeOID(oid);
287
+
288
+ var ber = writer.buffer;
289
+ t.ok(ber);
290
+ console.log(require('util').inspect(ber));
291
+ console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86,
292
+ 0x48, 0x86, 0xf7, 0x0d,
293
+ 0x01, 0x01, 0x01])));
294
+
295
+ t.end();
296
+ });