@blazedpath/commons 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (626) hide show
  1. package/README.md +4 -1
  2. package/dist/blz-base/health/index.d.ts +1 -0
  3. package/dist/blz-base/health/index.js +1 -0
  4. package/dist/blz-base/index.d.ts +108 -0
  5. package/dist/blz-base/index.js +1 -0
  6. package/dist/blz-cache/LruCache.d.ts +31 -0
  7. package/dist/blz-cache/LruCache.js +1 -0
  8. package/dist/blz-cache/index.d.ts +2 -0
  9. package/dist/blz-cache/index.js +1 -0
  10. package/dist/blz-config/index.d.ts +16 -0
  11. package/dist/blz-config/index.js +1 -0
  12. package/dist/blz-core/index.d.ts +32 -0
  13. package/dist/blz-core/index.js +1 -0
  14. package/dist/blz-cryptography/index.d.ts +2 -0
  15. package/dist/blz-cryptography/index.js +1 -0
  16. package/dist/blz-datetimes/index.d.ts +35 -0
  17. package/dist/blz-datetimes/index.js +1 -0
  18. package/dist/blz-file/fileService.d.ts +25 -0
  19. package/dist/blz-file/fileService.js +1 -0
  20. package/dist/blz-file/index.d.ts +2 -0
  21. package/dist/blz-file/index.js +1 -0
  22. package/dist/blz-file/index.test.js +1 -0
  23. package/dist/blz-file/lab.js +1 -0
  24. package/dist/blz-hazelcast/index.d.ts +25 -0
  25. package/dist/blz-hazelcast/index.js +1 -0
  26. package/dist/blz-hazelcast/lib/credentials.d.ts +10 -0
  27. package/dist/blz-hazelcast/lib/credentials.js +1 -0
  28. package/dist/blz-hazelcast/lib/credentialsFactory.d.ts +1 -0
  29. package/dist/blz-hazelcast/lib/credentialsFactory.js +1 -0
  30. package/dist/blz-hazelcast/lib/hazelcastCache.d.ts +27 -0
  31. package/dist/blz-hazelcast/lib/hazelcastCache.js +1 -0
  32. package/dist/blz-iterable/index.d.ts +49 -0
  33. package/dist/blz-iterable/index.js +1 -0
  34. package/dist/blz-json-schema/index.d.ts +1 -0
  35. package/dist/blz-json-schema/index.js +1 -0
  36. package/dist/blz-jwt/index.d.ts +12 -0
  37. package/dist/blz-jwt/index.js +1 -0
  38. package/dist/blz-kafka/index.d.ts +9 -0
  39. package/dist/blz-kafka/index.js +1 -0
  40. package/dist/blz-math/index.d.ts +22 -0
  41. package/dist/blz-math/index.js +1 -0
  42. package/dist/blz-mongodb/index.d.ts +28 -0
  43. package/dist/blz-mongodb/index.js +1 -0
  44. package/dist/blz-rds/__test__/scape.test.js +1 -0
  45. package/dist/blz-rds/blz-rds-executor.d.ts +4 -0
  46. package/dist/blz-rds/blz-rds-executor.js +1 -0
  47. package/dist/blz-rds/blz-rds-helper.d.ts +5 -0
  48. package/dist/blz-rds/blz-rds-helper.js +1 -0
  49. package/dist/blz-rds/commands/core/add.d.ts +2 -0
  50. package/dist/blz-rds/commands/core/add.js +1 -0
  51. package/dist/blz-rds/commands/core/and.d.ts +3 -0
  52. package/dist/blz-rds/commands/core/and.js +1 -0
  53. package/dist/blz-rds/commands/core/asc.d.ts +2 -0
  54. package/dist/blz-rds/commands/core/asc.js +1 -0
  55. package/dist/blz-rds/commands/core/avg.d.ts +2 -0
  56. package/dist/blz-rds/commands/core/avg.js +1 -0
  57. package/dist/blz-rds/commands/core/column-ref.d.ts +2 -0
  58. package/dist/blz-rds/commands/core/column-ref.js +1 -0
  59. package/dist/blz-rds/commands/core/count-distinct.d.ts +2 -0
  60. package/dist/blz-rds/commands/core/count-distinct.js +1 -0
  61. package/dist/blz-rds/commands/core/count.d.ts +2 -0
  62. package/dist/blz-rds/commands/core/count.js +1 -0
  63. package/dist/blz-rds/commands/core/decimal.d.ts +2 -0
  64. package/dist/blz-rds/commands/core/decimal.js +1 -0
  65. package/dist/blz-rds/commands/core/desc.d.ts +2 -0
  66. package/dist/blz-rds/commands/core/desc.js +1 -0
  67. package/dist/blz-rds/commands/core/distinct.d.ts +2 -0
  68. package/dist/blz-rds/commands/core/distinct.js +1 -0
  69. package/dist/blz-rds/commands/core/divide.d.ts +2 -0
  70. package/dist/blz-rds/commands/core/divide.js +1 -0
  71. package/dist/blz-rds/commands/core/embedded-exists.d.ts +3 -0
  72. package/dist/blz-rds/commands/core/embedded-exists.js +1 -0
  73. package/dist/blz-rds/commands/core/embedded-select.d.ts +2 -0
  74. package/dist/blz-rds/commands/core/embedded-select.js +1 -0
  75. package/dist/blz-rds/commands/core/equals.d.ts +3 -0
  76. package/dist/blz-rds/commands/core/equals.js +1 -0
  77. package/dist/blz-rds/commands/core/false.d.ts +2 -0
  78. package/dist/blz-rds/commands/core/false.js +1 -0
  79. package/dist/blz-rds/commands/core/greater-or-equal.d.ts +3 -0
  80. package/dist/blz-rds/commands/core/greater-or-equal.js +1 -0
  81. package/dist/blz-rds/commands/core/greater.d.ts +3 -0
  82. package/dist/blz-rds/commands/core/greater.js +1 -0
  83. package/dist/blz-rds/commands/core/in.d.ts +3 -0
  84. package/dist/blz-rds/commands/core/in.js +1 -0
  85. package/dist/blz-rds/commands/core/integer.d.ts +2 -0
  86. package/dist/blz-rds/commands/core/integer.js +1 -0
  87. package/dist/blz-rds/commands/core/is-not-null.d.ts +3 -0
  88. package/dist/blz-rds/commands/core/is-not-null.js +1 -0
  89. package/dist/blz-rds/commands/core/is-null-or-value.d.ts +3 -0
  90. package/dist/blz-rds/commands/core/is-null-or-value.js +1 -0
  91. package/dist/blz-rds/commands/core/is-null.d.ts +3 -0
  92. package/dist/blz-rds/commands/core/is-null.js +1 -0
  93. package/dist/blz-rds/commands/core/less-or-equal.d.ts +3 -0
  94. package/dist/blz-rds/commands/core/less-or-equal.js +1 -0
  95. package/dist/blz-rds/commands/core/less-unary.d.ts +2 -0
  96. package/dist/blz-rds/commands/core/less-unary.js +1 -0
  97. package/dist/blz-rds/commands/core/less.d.ts +3 -0
  98. package/dist/blz-rds/commands/core/less.js +1 -0
  99. package/dist/blz-rds/commands/core/like.d.ts +3 -0
  100. package/dist/blz-rds/commands/core/like.js +1 -0
  101. package/dist/blz-rds/commands/core/max.d.ts +2 -0
  102. package/dist/blz-rds/commands/core/max.js +1 -0
  103. package/dist/blz-rds/commands/core/min.d.ts +2 -0
  104. package/dist/blz-rds/commands/core/min.js +1 -0
  105. package/dist/blz-rds/commands/core/multiply.d.ts +2 -0
  106. package/dist/blz-rds/commands/core/multiply.js +1 -0
  107. package/dist/blz-rds/commands/core/not-equals.d.ts +3 -0
  108. package/dist/blz-rds/commands/core/not-equals.js +1 -0
  109. package/dist/blz-rds/commands/core/not-in.d.ts +3 -0
  110. package/dist/blz-rds/commands/core/not-in.js +1 -0
  111. package/dist/blz-rds/commands/core/not.d.ts +3 -0
  112. package/dist/blz-rds/commands/core/not.js +1 -0
  113. package/dist/blz-rds/commands/core/null.d.ts +2 -0
  114. package/dist/blz-rds/commands/core/null.js +1 -0
  115. package/dist/blz-rds/commands/core/nvl.d.ts +2 -0
  116. package/dist/blz-rds/commands/core/nvl.js +1 -0
  117. package/dist/blz-rds/commands/core/or.d.ts +3 -0
  118. package/dist/blz-rds/commands/core/or.js +1 -0
  119. package/dist/blz-rds/commands/core/parameter.d.ts +2 -0
  120. package/dist/blz-rds/commands/core/parameter.js +1 -0
  121. package/dist/blz-rds/commands/core/remainder.d.ts +2 -0
  122. package/dist/blz-rds/commands/core/remainder.js +1 -0
  123. package/dist/blz-rds/commands/core/string.d.ts +2 -0
  124. package/dist/blz-rds/commands/core/string.js +1 -0
  125. package/dist/blz-rds/commands/core/subtract.d.ts +2 -0
  126. package/dist/blz-rds/commands/core/subtract.js +1 -0
  127. package/dist/blz-rds/commands/core/sum.d.ts +2 -0
  128. package/dist/blz-rds/commands/core/sum.js +1 -0
  129. package/dist/blz-rds/commands/core/true.d.ts +2 -0
  130. package/dist/blz-rds/commands/core/true.js +1 -0
  131. package/dist/blz-rds/commands/core/tuple.d.ts +2 -0
  132. package/dist/blz-rds/commands/core/tuple.js +1 -0
  133. package/dist/blz-rds/commands/datetimes/add-days.d.ts +2 -0
  134. package/dist/blz-rds/commands/datetimes/add-days.js +1 -0
  135. package/dist/blz-rds/commands/datetimes/add-hours.d.ts +2 -0
  136. package/dist/blz-rds/commands/datetimes/add-hours.js +1 -0
  137. package/dist/blz-rds/commands/datetimes/add-milliseconds.d.ts +2 -0
  138. package/dist/blz-rds/commands/datetimes/add-milliseconds.js +1 -0
  139. package/dist/blz-rds/commands/datetimes/add-minutes.d.ts +2 -0
  140. package/dist/blz-rds/commands/datetimes/add-minutes.js +1 -0
  141. package/dist/blz-rds/commands/datetimes/add-months.d.ts +2 -0
  142. package/dist/blz-rds/commands/datetimes/add-months.js +1 -0
  143. package/dist/blz-rds/commands/datetimes/add-seconds.d.ts +2 -0
  144. package/dist/blz-rds/commands/datetimes/add-seconds.js +1 -0
  145. package/dist/blz-rds/commands/datetimes/add-years.d.ts +2 -0
  146. package/dist/blz-rds/commands/datetimes/add-years.js +1 -0
  147. package/dist/blz-rds/commands/datetimes/date-diff.d.ts +2 -0
  148. package/dist/blz-rds/commands/datetimes/date-diff.js +1 -0
  149. package/dist/blz-rds/commands/datetimes/date.d.ts +2 -0
  150. package/dist/blz-rds/commands/datetimes/date.js +1 -0
  151. package/dist/blz-rds/commands/datetimes/datetime-diff.d.ts +2 -0
  152. package/dist/blz-rds/commands/datetimes/datetime-diff.js +1 -0
  153. package/dist/blz-rds/commands/datetimes/datetime.d.ts +2 -0
  154. package/dist/blz-rds/commands/datetimes/datetime.js +1 -0
  155. package/dist/blz-rds/commands/datetimes/day.d.ts +2 -0
  156. package/dist/blz-rds/commands/datetimes/day.js +1 -0
  157. package/dist/blz-rds/commands/datetimes/hour.d.ts +2 -0
  158. package/dist/blz-rds/commands/datetimes/hour.js +1 -0
  159. package/dist/blz-rds/commands/datetimes/millisecond.d.ts +2 -0
  160. package/dist/blz-rds/commands/datetimes/millisecond.js +1 -0
  161. package/dist/blz-rds/commands/datetimes/minute.d.ts +2 -0
  162. package/dist/blz-rds/commands/datetimes/minute.js +1 -0
  163. package/dist/blz-rds/commands/datetimes/month-text.d.ts +2 -0
  164. package/dist/blz-rds/commands/datetimes/month-text.js +1 -0
  165. package/dist/blz-rds/commands/datetimes/month.d.ts +2 -0
  166. package/dist/blz-rds/commands/datetimes/month.js +1 -0
  167. package/dist/blz-rds/commands/datetimes/now.d.ts +2 -0
  168. package/dist/blz-rds/commands/datetimes/now.js +1 -0
  169. package/dist/blz-rds/commands/datetimes/second.d.ts +2 -0
  170. package/dist/blz-rds/commands/datetimes/second.js +1 -0
  171. package/dist/blz-rds/commands/datetimes/subtract-days.d.ts +2 -0
  172. package/dist/blz-rds/commands/datetimes/subtract-days.js +1 -0
  173. package/dist/blz-rds/commands/datetimes/subtract-hours.d.ts +2 -0
  174. package/dist/blz-rds/commands/datetimes/subtract-hours.js +1 -0
  175. package/dist/blz-rds/commands/datetimes/subtract-milliseconds.d.ts +2 -0
  176. package/dist/blz-rds/commands/datetimes/subtract-milliseconds.js +1 -0
  177. package/dist/blz-rds/commands/datetimes/subtract-minutes.d.ts +2 -0
  178. package/dist/blz-rds/commands/datetimes/subtract-minutes.js +1 -0
  179. package/dist/blz-rds/commands/datetimes/subtract-seconds.d.ts +2 -0
  180. package/dist/blz-rds/commands/datetimes/subtract-seconds.js +1 -0
  181. package/dist/blz-rds/commands/datetimes/time-diff.d.ts +2 -0
  182. package/dist/blz-rds/commands/datetimes/time-diff.js +1 -0
  183. package/dist/blz-rds/commands/datetimes/time.d.ts +2 -0
  184. package/dist/blz-rds/commands/datetimes/time.js +1 -0
  185. package/dist/blz-rds/commands/datetimes/today.d.ts +2 -0
  186. package/dist/blz-rds/commands/datetimes/today.js +1 -0
  187. package/dist/blz-rds/commands/datetimes/week-day-text.d.ts +2 -0
  188. package/dist/blz-rds/commands/datetimes/week-day-text.js +1 -0
  189. package/dist/blz-rds/commands/datetimes/week-day.d.ts +2 -0
  190. package/dist/blz-rds/commands/datetimes/week-day.js +1 -0
  191. package/dist/blz-rds/commands/datetimes/week.d.ts +2 -0
  192. package/dist/blz-rds/commands/datetimes/week.js +1 -0
  193. package/dist/blz-rds/commands/datetimes/year.d.ts +2 -0
  194. package/dist/blz-rds/commands/datetimes/year.js +1 -0
  195. package/dist/blz-rds/commands/math/abs.d.ts +2 -0
  196. package/dist/blz-rds/commands/math/abs.js +1 -0
  197. package/dist/blz-rds/commands/math/acos.d.ts +2 -0
  198. package/dist/blz-rds/commands/math/acos.js +1 -0
  199. package/dist/blz-rds/commands/math/asin.d.ts +2 -0
  200. package/dist/blz-rds/commands/math/asin.js +1 -0
  201. package/dist/blz-rds/commands/math/atan.d.ts +2 -0
  202. package/dist/blz-rds/commands/math/atan.js +1 -0
  203. package/dist/blz-rds/commands/math/atan2.d.ts +2 -0
  204. package/dist/blz-rds/commands/math/atan2.js +1 -0
  205. package/dist/blz-rds/commands/math/ceil.d.ts +2 -0
  206. package/dist/blz-rds/commands/math/ceil.js +1 -0
  207. package/dist/blz-rds/commands/math/cos.d.ts +2 -0
  208. package/dist/blz-rds/commands/math/cos.js +1 -0
  209. package/dist/blz-rds/commands/math/cosh.d.ts +2 -0
  210. package/dist/blz-rds/commands/math/cosh.js +1 -0
  211. package/dist/blz-rds/commands/math/exp.d.ts +2 -0
  212. package/dist/blz-rds/commands/math/exp.js +1 -0
  213. package/dist/blz-rds/commands/math/floor.d.ts +2 -0
  214. package/dist/blz-rds/commands/math/floor.js +1 -0
  215. package/dist/blz-rds/commands/math/log.d.ts +2 -0
  216. package/dist/blz-rds/commands/math/log.js +1 -0
  217. package/dist/blz-rds/commands/math/log10.d.ts +2 -0
  218. package/dist/blz-rds/commands/math/log10.js +1 -0
  219. package/dist/blz-rds/commands/math/pow.d.ts +2 -0
  220. package/dist/blz-rds/commands/math/pow.js +1 -0
  221. package/dist/blz-rds/commands/math/random.d.ts +2 -0
  222. package/dist/blz-rds/commands/math/random.js +1 -0
  223. package/dist/blz-rds/commands/math/round.d.ts +2 -0
  224. package/dist/blz-rds/commands/math/round.js +1 -0
  225. package/dist/blz-rds/commands/math/sign.d.ts +2 -0
  226. package/dist/blz-rds/commands/math/sign.js +1 -0
  227. package/dist/blz-rds/commands/math/sin.d.ts +2 -0
  228. package/dist/blz-rds/commands/math/sin.js +1 -0
  229. package/dist/blz-rds/commands/math/sinh.d.ts +2 -0
  230. package/dist/blz-rds/commands/math/sinh.js +1 -0
  231. package/dist/blz-rds/commands/math/sqrt.d.ts +2 -0
  232. package/dist/blz-rds/commands/math/sqrt.js +1 -0
  233. package/dist/blz-rds/commands/math/tan.d.ts +2 -0
  234. package/dist/blz-rds/commands/math/tan.js +1 -0
  235. package/dist/blz-rds/commands/math/tanh.d.ts +2 -0
  236. package/dist/blz-rds/commands/math/tanh.js +1 -0
  237. package/dist/blz-rds/commands/math/trunc.d.ts +2 -0
  238. package/dist/blz-rds/commands/math/trunc.js +1 -0
  239. package/dist/blz-rds/commands/strings/concat.d.ts +2 -0
  240. package/dist/blz-rds/commands/strings/concat.js +1 -0
  241. package/dist/blz-rds/commands/strings/contains.d.ts +3 -0
  242. package/dist/blz-rds/commands/strings/contains.js +1 -0
  243. package/dist/blz-rds/commands/strings/ends-with.d.ts +3 -0
  244. package/dist/blz-rds/commands/strings/ends-with.js +1 -0
  245. package/dist/blz-rds/commands/strings/index-of.d.ts +2 -0
  246. package/dist/blz-rds/commands/strings/index-of.js +1 -0
  247. package/dist/blz-rds/commands/strings/is-null-or-empty.d.ts +3 -0
  248. package/dist/blz-rds/commands/strings/is-null-or-empty.js +1 -0
  249. package/dist/blz-rds/commands/strings/is-null-or-white-space.d.ts +3 -0
  250. package/dist/blz-rds/commands/strings/is-null-or-white-space.js +1 -0
  251. package/dist/blz-rds/commands/strings/join.d.ts +2 -0
  252. package/dist/blz-rds/commands/strings/join.js +1 -0
  253. package/dist/blz-rds/commands/strings/last-index-of.d.ts +2 -0
  254. package/dist/blz-rds/commands/strings/last-index-of.js +1 -0
  255. package/dist/blz-rds/commands/strings/length.d.ts +2 -0
  256. package/dist/blz-rds/commands/strings/length.js +1 -0
  257. package/dist/blz-rds/commands/strings/pad-left.d.ts +2 -0
  258. package/dist/blz-rds/commands/strings/pad-left.js +1 -0
  259. package/dist/blz-rds/commands/strings/pad-right.d.ts +2 -0
  260. package/dist/blz-rds/commands/strings/pad-right.js +1 -0
  261. package/dist/blz-rds/commands/strings/replace.d.ts +2 -0
  262. package/dist/blz-rds/commands/strings/replace.js +1 -0
  263. package/dist/blz-rds/commands/strings/starts-with.d.ts +3 -0
  264. package/dist/blz-rds/commands/strings/starts-with.js +1 -0
  265. package/dist/blz-rds/commands/strings/substring.d.ts +2 -0
  266. package/dist/blz-rds/commands/strings/substring.js +1 -0
  267. package/dist/blz-rds/commands/strings/to-lower.d.ts +2 -0
  268. package/dist/blz-rds/commands/strings/to-lower.js +1 -0
  269. package/dist/blz-rds/commands/strings/to-upper.d.ts +2 -0
  270. package/dist/blz-rds/commands/strings/to-upper.js +1 -0
  271. package/dist/blz-rds/commands/strings/trim-end.d.ts +2 -0
  272. package/dist/blz-rds/commands/strings/trim-end.js +1 -0
  273. package/dist/blz-rds/commands/strings/trim-start.d.ts +2 -0
  274. package/dist/blz-rds/commands/strings/trim-start.js +1 -0
  275. package/dist/blz-rds/commands/strings/trim.d.ts +2 -0
  276. package/dist/blz-rds/commands/strings/trim.js +1 -0
  277. package/dist/blz-rds/index.d.ts +53 -0
  278. package/dist/blz-rds/index.js +1 -0
  279. package/dist/blz-rds-mysql/base.d.ts +83 -0
  280. package/dist/blz-rds-mysql/base.js +1 -0
  281. package/dist/blz-rds-mysql/connection-manager.d.ts +8 -0
  282. package/dist/blz-rds-mysql/connection-manager.js +1 -0
  283. package/dist/blz-rds-mysql/execute-bulk-insert.d.ts +2 -0
  284. package/dist/blz-rds-mysql/execute-bulk-insert.js +1 -0
  285. package/dist/blz-rds-mysql/execute-bulk-merge.d.ts +2 -0
  286. package/dist/blz-rds-mysql/execute-bulk-merge.js +1 -0
  287. package/dist/blz-rds-mysql/execute-non-query.d.ts +14 -0
  288. package/dist/blz-rds-mysql/execute-non-query.js +1 -0
  289. package/dist/blz-rds-mysql/execute-query.d.ts +11 -0
  290. package/dist/blz-rds-mysql/execute-query.js +1 -0
  291. package/dist/blz-rds-mysql/index.d.ts +9 -0
  292. package/dist/blz-rds-mysql/index.js +1 -0
  293. package/dist/blz-rds-mysql/stored-procedure.d.ts +19 -0
  294. package/dist/blz-rds-mysql/stored-procedure.js +1 -0
  295. package/dist/blz-rds-mysqlx/base.d.ts +83 -0
  296. package/dist/blz-rds-mysqlx/base.js +1 -0
  297. package/dist/blz-rds-mysqlx/connection-manager.d.ts +6 -0
  298. package/dist/blz-rds-mysqlx/connection-manager.js +1 -0
  299. package/dist/blz-rds-mysqlx/execute-bulk-insert.d.ts +2 -0
  300. package/dist/blz-rds-mysqlx/execute-bulk-insert.js +1 -0
  301. package/dist/blz-rds-mysqlx/execute-bulk-merge.d.ts +2 -0
  302. package/dist/blz-rds-mysqlx/execute-bulk-merge.js +1 -0
  303. package/dist/blz-rds-mysqlx/execute-non-query.d.ts +4 -0
  304. package/dist/blz-rds-mysqlx/execute-non-query.js +1 -0
  305. package/dist/blz-rds-mysqlx/execute-query.d.ts +7 -0
  306. package/dist/blz-rds-mysqlx/execute-query.js +1 -0
  307. package/dist/blz-rds-mysqlx/index.d.ts +9 -0
  308. package/dist/blz-rds-mysqlx/index.js +1 -0
  309. package/dist/blz-rds-mysqlx/stored-procedure.d.ts +20 -0
  310. package/dist/blz-rds-mysqlx/stored-procedure.js +1 -0
  311. package/dist/blz-rds-oracle/index.d.ts +25 -0
  312. package/dist/blz-rds-oracle/index.js +1 -0
  313. package/dist/blz-rds-postgres/base.d.ts +94 -0
  314. package/dist/blz-rds-postgres/base.js +1 -0
  315. package/dist/blz-rds-postgres/connection-manager.d.ts +6 -0
  316. package/dist/blz-rds-postgres/connection-manager.js +1 -0
  317. package/dist/blz-rds-postgres/execute-bulk-insert.d.ts +5 -0
  318. package/dist/blz-rds-postgres/execute-bulk-insert.js +1 -0
  319. package/dist/blz-rds-postgres/execute-bulk-merge.d.ts +4 -0
  320. package/dist/blz-rds-postgres/execute-bulk-merge.js +1 -0
  321. package/dist/blz-rds-postgres/execute-non-query.d.ts +12 -0
  322. package/dist/blz-rds-postgres/execute-non-query.js +1 -0
  323. package/dist/blz-rds-postgres/execute-query.d.ts +4 -0
  324. package/dist/blz-rds-postgres/execute-query.js +1 -0
  325. package/dist/blz-rds-postgres/index.d.ts +9 -0
  326. package/dist/blz-rds-postgres/index.js +1 -0
  327. package/dist/blz-rds-postgres/result-set.js +1 -0
  328. package/dist/blz-rds-postgres/stored-procedure.d.ts +19 -0
  329. package/dist/blz-rds-postgres/stored-procedure.js +1 -0
  330. package/dist/blz-redis/index.d.ts +31 -0
  331. package/dist/blz-redis/index.js +1 -0
  332. package/dist/blz-redis/lib/redisCache.d.ts +33 -0
  333. package/dist/blz-redis/lib/redisCache.js +1 -0
  334. package/dist/blz-regex/index.d.ts +3 -0
  335. package/dist/blz-regex/index.js +1 -0
  336. package/dist/blz-security/__test__/autorization.test.js +1 -0
  337. package/dist/blz-security/__test__/autorizationKpn.test.js +1 -0
  338. package/dist/blz-security/__test__/orderManagement.test.js +1 -0
  339. package/dist/blz-security/__test__/secureUrl.test.js +1 -0
  340. package/dist/blz-security/__test__/solveMergeRule.test.js +1 -0
  341. package/dist/blz-security/__test__/sqlInjectionGuard.test.js +1 -0
  342. package/dist/blz-security/__test__/xssGuard.test.js +1 -0
  343. package/dist/blz-security/authorizationService.d.ts +42 -0
  344. package/dist/blz-security/authorizationService.js +2 -0
  345. package/dist/blz-security/config/global.js +1 -0
  346. package/dist/blz-security/filescanner/index.d.ts +24 -0
  347. package/dist/blz-security/filescanner/index.js +1 -0
  348. package/dist/blz-security/helpers/consts.d.ts +28 -0
  349. package/dist/blz-security/helpers/consts.js +1 -0
  350. package/dist/blz-security/helpers/utils.d.ts +82 -0
  351. package/dist/blz-security/helpers/utils.js +1 -0
  352. package/dist/blz-security/implementations/cache.d.ts +58 -0
  353. package/dist/blz-security/implementations/cache.js +1 -0
  354. package/dist/blz-security/implementations/oidc.d.ts +100 -0
  355. package/dist/blz-security/implementations/oidc.js +1 -0
  356. package/dist/blz-security/implementations/pkceCacheStore.d.ts +2 -0
  357. package/dist/blz-security/implementations/pkceCacheStore.js +1 -0
  358. package/dist/blz-security/implementations/saml.js +1 -0
  359. package/dist/blz-security/implementations/uma.d.ts +31 -0
  360. package/dist/blz-security/implementations/uma.js +1 -0
  361. package/dist/blz-security/implementations/webAuthn.js +1 -0
  362. package/dist/blz-security/implementations/wstg.js +1 -0
  363. package/dist/blz-security/index.d.ts +4 -0
  364. package/dist/blz-security/index.js +2 -0
  365. package/dist/blz-security/lab/index.js +1 -0
  366. package/dist/blz-security/middleware/HapiServerAzureAd.d.ts +26 -0
  367. package/dist/blz-security/middleware/HapiServerAzureAd.js +1 -0
  368. package/dist/blz-security/middleware/HapiServerKeycloak.d.ts +47 -0
  369. package/dist/blz-security/middleware/HapiServerKeycloak.js +1 -0
  370. package/dist/blz-security/middleware/HapiServerSimToken.d.ts +13 -0
  371. package/dist/blz-security/middleware/HapiServerSimToken.js +1 -0
  372. package/dist/blz-security/middleware/hapi.d.ts +14 -0
  373. package/dist/blz-security/middleware/hapi.js +1 -0
  374. package/dist/blz-security/middleware/hapiServer.js +1 -0
  375. package/dist/blz-security/navigationMemoryRepository.d.ts +6 -0
  376. package/dist/blz-security/navigationMemoryRepository.js +1 -0
  377. package/dist/blz-security/navigationMongoDbRepository.d.ts +15 -0
  378. package/dist/blz-security/navigationMongoDbRepository.js +1 -0
  379. package/dist/blz-security/secureUrlService.d.ts +7 -0
  380. package/dist/blz-security/secureUrlService.js +1 -0
  381. package/dist/blz-security/securityService.d.ts +72 -0
  382. package/dist/blz-security/securityService.js +1 -0
  383. package/dist/blz-security/sqlInjectionGuard.d.ts +37 -0
  384. package/dist/blz-security/sqlInjectionGuard.js +1 -0
  385. package/dist/blz-security/xssGuard.d.ts +14 -0
  386. package/dist/blz-security/xssGuard.js +1 -0
  387. package/dist/blz-strings/index.d.ts +42 -0
  388. package/dist/blz-strings/index.js +1 -0
  389. package/dist/blz-uuid/index.d.ts +1 -0
  390. package/dist/blz-uuid/index.js +1 -0
  391. package/dist/blz-yaml/index.d.ts +2 -0
  392. package/dist/blz-yaml/index.js +1 -0
  393. package/dist/index.d.ts +34 -0
  394. package/dist/index.js +1 -0
  395. package/dist/process-managers/index.d.ts +25 -0
  396. package/dist/process-managers/index.js +1 -0
  397. package/package.json +52 -41
  398. package/blz-base/health/index.js +0 -215
  399. package/blz-base/index.js +0 -1466
  400. package/blz-cache/LruCache.js +0 -44
  401. package/blz-cache/index.js +0 -29
  402. package/blz-config/index.js +0 -434
  403. package/blz-core/index.js +0 -364
  404. package/blz-cryptography/index.js +0 -54
  405. package/blz-datetimes/index.js +0 -356
  406. package/blz-file/example.dat +0 -2545
  407. package/blz-file/fileService.js +0 -205
  408. package/blz-file/index.js +0 -94
  409. package/blz-file/index.test.js +0 -31
  410. package/blz-file/lab.js +0 -33
  411. package/blz-hazelcast/index.js +0 -189
  412. package/blz-hazelcast/lib/credentials.js +0 -25
  413. package/blz-hazelcast/lib/credentialsFactory.js +0 -12
  414. package/blz-hazelcast/lib/hazelcastCache.js +0 -234
  415. package/blz-iterable/index.js +0 -446
  416. package/blz-json-schema/index.js +0 -11
  417. package/blz-jwt/index.js +0 -121
  418. package/blz-kafka/index.js +0 -522
  419. package/blz-math/index.js +0 -131
  420. package/blz-mongodb/index.js +0 -326
  421. package/blz-rds/__test__/scape.test.js +0 -58
  422. package/blz-rds/blz-rds-executor.js +0 -578
  423. package/blz-rds/blz-rds-helper.js +0 -310
  424. package/blz-rds/commands/core/add.js +0 -13
  425. package/blz-rds/commands/core/and.js +0 -18
  426. package/blz-rds/commands/core/asc.js +0 -10
  427. package/blz-rds/commands/core/avg.js +0 -10
  428. package/blz-rds/commands/core/column-ref.js +0 -8
  429. package/blz-rds/commands/core/count-distinct.js +0 -10
  430. package/blz-rds/commands/core/count.js +0 -10
  431. package/blz-rds/commands/core/decimal.js +0 -8
  432. package/blz-rds/commands/core/desc.js +0 -10
  433. package/blz-rds/commands/core/distinct.js +0 -10
  434. package/blz-rds/commands/core/divide.js +0 -11
  435. package/blz-rds/commands/core/embedded-exists.js +0 -17
  436. package/blz-rds/commands/core/embedded-select.js +0 -17
  437. package/blz-rds/commands/core/equals.js +0 -9
  438. package/blz-rds/commands/core/false.js +0 -8
  439. package/blz-rds/commands/core/greater-or-equal.js +0 -9
  440. package/blz-rds/commands/core/greater.js +0 -9
  441. package/blz-rds/commands/core/in.js +0 -9
  442. package/blz-rds/commands/core/integer.js +0 -8
  443. package/blz-rds/commands/core/is-not-null.js +0 -11
  444. package/blz-rds/commands/core/is-null-or-value.js +0 -10
  445. package/blz-rds/commands/core/is-null.js +0 -11
  446. package/blz-rds/commands/core/less-or-equal.js +0 -9
  447. package/blz-rds/commands/core/less-unary.js +0 -12
  448. package/blz-rds/commands/core/less.js +0 -9
  449. package/blz-rds/commands/core/like.js +0 -12
  450. package/blz-rds/commands/core/max.js +0 -10
  451. package/blz-rds/commands/core/min.js +0 -10
  452. package/blz-rds/commands/core/multiply.js +0 -13
  453. package/blz-rds/commands/core/not-equals.js +0 -9
  454. package/blz-rds/commands/core/not-in.js +0 -9
  455. package/blz-rds/commands/core/not.js +0 -13
  456. package/blz-rds/commands/core/null.js +0 -8
  457. package/blz-rds/commands/core/nvl.js +0 -11
  458. package/blz-rds/commands/core/or.js +0 -13
  459. package/blz-rds/commands/core/parameter.js +0 -34
  460. package/blz-rds/commands/core/remainder.js +0 -16
  461. package/blz-rds/commands/core/string.js +0 -8
  462. package/blz-rds/commands/core/subtract.js +0 -13
  463. package/blz-rds/commands/core/sum.js +0 -10
  464. package/blz-rds/commands/core/true.js +0 -8
  465. package/blz-rds/commands/core/tuple.js +0 -13
  466. package/blz-rds/commands/datetimes/add-days.js +0 -11
  467. package/blz-rds/commands/datetimes/add-hours.js +0 -11
  468. package/blz-rds/commands/datetimes/add-milliseconds.js +0 -11
  469. package/blz-rds/commands/datetimes/add-minutes.js +0 -11
  470. package/blz-rds/commands/datetimes/add-months.js +0 -11
  471. package/blz-rds/commands/datetimes/add-seconds.js +0 -11
  472. package/blz-rds/commands/datetimes/add-years.js +0 -11
  473. package/blz-rds/commands/datetimes/date-diff.js +0 -11
  474. package/blz-rds/commands/datetimes/date.js +0 -12
  475. package/blz-rds/commands/datetimes/datetime-diff.js +0 -11
  476. package/blz-rds/commands/datetimes/datetime.js +0 -15
  477. package/blz-rds/commands/datetimes/day.js +0 -10
  478. package/blz-rds/commands/datetimes/hour.js +0 -10
  479. package/blz-rds/commands/datetimes/millisecond.js +0 -10
  480. package/blz-rds/commands/datetimes/minute.js +0 -10
  481. package/blz-rds/commands/datetimes/month-text.js +0 -10
  482. package/blz-rds/commands/datetimes/month.js +0 -10
  483. package/blz-rds/commands/datetimes/now.js +0 -9
  484. package/blz-rds/commands/datetimes/second.js +0 -10
  485. package/blz-rds/commands/datetimes/subtract-days.js +0 -11
  486. package/blz-rds/commands/datetimes/subtract-hours.js +0 -11
  487. package/blz-rds/commands/datetimes/subtract-milliseconds.js +0 -11
  488. package/blz-rds/commands/datetimes/subtract-minutes.js +0 -11
  489. package/blz-rds/commands/datetimes/subtract-seconds.js +0 -11
  490. package/blz-rds/commands/datetimes/time-diff.js +0 -11
  491. package/blz-rds/commands/datetimes/time.js +0 -13
  492. package/blz-rds/commands/datetimes/today.js +0 -9
  493. package/blz-rds/commands/datetimes/week-day-text.js +0 -10
  494. package/blz-rds/commands/datetimes/week-day.js +0 -10
  495. package/blz-rds/commands/datetimes/week.js +0 -10
  496. package/blz-rds/commands/datetimes/year.js +0 -10
  497. package/blz-rds/commands/math/abs.js +0 -10
  498. package/blz-rds/commands/math/acos.js +0 -10
  499. package/blz-rds/commands/math/asin.js +0 -10
  500. package/blz-rds/commands/math/atan.js +0 -10
  501. package/blz-rds/commands/math/atan2.js +0 -11
  502. package/blz-rds/commands/math/ceil.js +0 -10
  503. package/blz-rds/commands/math/cos.js +0 -10
  504. package/blz-rds/commands/math/cosh.js +0 -10
  505. package/blz-rds/commands/math/exp.js +0 -10
  506. package/blz-rds/commands/math/floor.js +0 -10
  507. package/blz-rds/commands/math/log.js +0 -18
  508. package/blz-rds/commands/math/log10.js +0 -10
  509. package/blz-rds/commands/math/pow.js +0 -11
  510. package/blz-rds/commands/math/random.js +0 -9
  511. package/blz-rds/commands/math/round.js +0 -18
  512. package/blz-rds/commands/math/sign.js +0 -10
  513. package/blz-rds/commands/math/sin.js +0 -10
  514. package/blz-rds/commands/math/sinh.js +0 -10
  515. package/blz-rds/commands/math/sqrt.js +0 -10
  516. package/blz-rds/commands/math/tan.js +0 -10
  517. package/blz-rds/commands/math/tanh.js +0 -10
  518. package/blz-rds/commands/math/trunc.js +0 -18
  519. package/blz-rds/commands/strings/concat.js +0 -20
  520. package/blz-rds/commands/strings/contains.js +0 -12
  521. package/blz-rds/commands/strings/ends-with.js +0 -12
  522. package/blz-rds/commands/strings/index-of.js +0 -11
  523. package/blz-rds/commands/strings/is-null-or-empty.js +0 -11
  524. package/blz-rds/commands/strings/is-null-or-white-space.js +0 -11
  525. package/blz-rds/commands/strings/join.js +0 -22
  526. package/blz-rds/commands/strings/last-index-of.js +0 -11
  527. package/blz-rds/commands/strings/length.js +0 -10
  528. package/blz-rds/commands/strings/pad-left.js +0 -20
  529. package/blz-rds/commands/strings/pad-right.js +0 -20
  530. package/blz-rds/commands/strings/replace.js +0 -12
  531. package/blz-rds/commands/strings/starts-with.js +0 -12
  532. package/blz-rds/commands/strings/substring.js +0 -12
  533. package/blz-rds/commands/strings/to-lower.js +0 -10
  534. package/blz-rds/commands/strings/to-upper.js +0 -10
  535. package/blz-rds/commands/strings/trim-end.js +0 -10
  536. package/blz-rds/commands/strings/trim-start.js +0 -10
  537. package/blz-rds/commands/strings/trim.js +0 -10
  538. package/blz-rds/index.js +0 -744
  539. package/blz-rds-mysql/base.js +0 -857
  540. package/blz-rds-mysql/connection-manager.js +0 -129
  541. package/blz-rds-mysql/execute-bulk-insert.js +0 -35
  542. package/blz-rds-mysql/execute-bulk-merge.js +0 -45
  543. package/blz-rds-mysql/execute-non-query.js +0 -34
  544. package/blz-rds-mysql/execute-query.js +0 -50
  545. package/blz-rds-mysql/index.js +0 -41
  546. package/blz-rds-mysql/stored-procedure.js +0 -207
  547. package/blz-rds-mysqlx/base.js +0 -846
  548. package/blz-rds-mysqlx/connection-manager.js +0 -141
  549. package/blz-rds-mysqlx/execute-bulk-insert.js +0 -35
  550. package/blz-rds-mysqlx/execute-bulk-merge.js +0 -45
  551. package/blz-rds-mysqlx/execute-non-query.js +0 -29
  552. package/blz-rds-mysqlx/execute-query.js +0 -39
  553. package/blz-rds-mysqlx/index.js +0 -41
  554. package/blz-rds-mysqlx/stored-procedure.js +0 -179
  555. package/blz-rds-oracle/index.js +0 -539
  556. package/blz-rds-postgres/base.js +0 -861
  557. package/blz-rds-postgres/connection-manager.js +0 -225
  558. package/blz-rds-postgres/execute-bulk-insert.js +0 -81
  559. package/blz-rds-postgres/execute-bulk-merge.js +0 -93
  560. package/blz-rds-postgres/execute-non-query.js +0 -23
  561. package/blz-rds-postgres/execute-query.js +0 -37
  562. package/blz-rds-postgres/index.js +0 -41
  563. package/blz-rds-postgres/result-set.js +0 -51
  564. package/blz-rds-postgres/stored-procedure.js +0 -116
  565. package/blz-redis/index.js +0 -217
  566. package/blz-redis/lib/redisCache.js +0 -265
  567. package/blz-regex/index.js +0 -25
  568. package/blz-security/.eslintrc.js +0 -15
  569. package/blz-security/__test__/AuthorizationKpn.yaml +0 -1149
  570. package/blz-security/__test__/FinancingSetting.yaml +0 -177
  571. package/blz-security/__test__/KpnConfigPortal.yaml +0 -330
  572. package/blz-security/__test__/OrderManagement.yaml +0 -5190
  573. package/blz-security/__test__/Security.yaml +0 -128
  574. package/blz-security/__test__/autorization.test.js +0 -105
  575. package/blz-security/__test__/autorizationKpn.test.js +0 -42
  576. package/blz-security/__test__/orderManagement.test.js +0 -26
  577. package/blz-security/__test__/secureUrl.test.js +0 -79
  578. package/blz-security/__test__/solveMergeRule.test.js +0 -109
  579. package/blz-security/__test__/sqlInjectionGuard.test.js +0 -203
  580. package/blz-security/__test__/xssGuard.test.js +0 -204
  581. package/blz-security/authorizationService.js +0 -537
  582. package/blz-security/config/global.js +0 -8
  583. package/blz-security/config/welcome +0 -8
  584. package/blz-security/doc/README.md +0 -75
  585. package/blz-security/filescanner/index.js +0 -46
  586. package/blz-security/helpers/consts.js +0 -229
  587. package/blz-security/helpers/utils.js +0 -267
  588. package/blz-security/implementations/cache.js +0 -90
  589. package/blz-security/implementations/oidc.js +0 -404
  590. package/blz-security/implementations/pkceCacheStore.js +0 -23
  591. package/blz-security/implementations/saml.js +0 -10
  592. package/blz-security/implementations/uma.js +0 -63
  593. package/blz-security/implementations/webAuthn.js +0 -9
  594. package/blz-security/implementations/wstg.js +0 -72
  595. package/blz-security/index.js +0 -77
  596. package/blz-security/lab/index.js +0 -43
  597. package/blz-security/middleware/HapiServerAzureAd.js +0 -681
  598. package/blz-security/middleware/HapiServerKeycloak.js +0 -876
  599. package/blz-security/middleware/HapiServerSimToken.js +0 -286
  600. package/blz-security/middleware/hapi.js +0 -555
  601. package/blz-security/middleware/hapiServer.js +0 -1008
  602. package/blz-security/navigationMemoryRepository.js +0 -15
  603. package/blz-security/navigationMongoDbRepository.js +0 -73
  604. package/blz-security/secureUrlService.js +0 -47
  605. package/blz-security/securityService.js +0 -413
  606. package/blz-security/sqlInjectionGuard.js +0 -162
  607. package/blz-security/templates/forbidden.html +0 -0
  608. package/blz-security/templates/session-iframe-azure-ad.html +0 -7
  609. package/blz-security/templates/session-iframe.html +0 -73
  610. package/blz-security/templates/unauthorized.html +0 -1
  611. package/blz-security/xssGuard.js +0 -87
  612. package/blz-strings/index.js +0 -167
  613. package/blz-uuid/index.js +0 -7
  614. package/blz-yaml/index.js +0 -19
  615. package/index.js +0 -84
  616. package/process-managers/index.js +0 -422
  617. /package/{blz-rds-mysql → dist/blz-rds-mysql}/syntaxis.json +0 -0
  618. /package/{blz-rds-mysqlx → dist/blz-rds-mysqlx}/syntaxis.json +0 -0
  619. /package/{blz-rds-oracle → dist/blz-rds-oracle}/syntaxis.json +0 -0
  620. /package/{blz-rds-postgres → dist/blz-rds-postgres}/syntaxis.json +0 -0
  621. /package/{blz-security → dist/blz-security}/lab/ConfigurationAdmin.agent.json +0 -0
  622. /package/{blz-security → dist/blz-security}/lab/frontend.json +0 -0
  623. /package/{blz-security → dist/blz-security}/lab/result.json +0 -0
  624. /package/{blz-security → dist/blz-security}/lab/resultOnWeb.json +0 -0
  625. /package/{blz-security → dist/blz-security}/lab/rules.json +0 -0
  626. /package/{blz-security → dist/blz-security}/lab/securityRules.json +0 -0
@@ -1,537 +0,0 @@
1
- #!/usr/bin/env node
2
- module.exports = class AuthorizationService {
3
- constructor (utils, logger) {
4
- this.utils = utils
5
- this.logger = logger
6
- this.config = { roles: [], permissions: [] }
7
- this.WIDGET_SEPARATOR = '|'
8
- this.WIDGET_SEPARATOR_REPLACE = new RegExp(this.WIDGET_SEPARATOR + '.*$')
9
- }
10
-
11
- extendConfig (config) {
12
- // extend permissions
13
- for (const permission of config.permissions) {
14
- if (permission.extends && !permission._completed) {
15
- this.extendPermission(config, permission)
16
- }
17
- }
18
- // extend roles
19
- for (const role of config.roles) {
20
- if (role.extends && !role._completed) {
21
- this.extendRole(config, role)
22
- }
23
- }
24
- // remove flags
25
- for (const permission of config.permissions) {
26
- delete permission._completed
27
- }
28
- for (const role of config.roles) {
29
- delete role._completed
30
- }
31
- }
32
-
33
- extendPermission (config, permission) {
34
- for (const extend of permission.extends) {
35
- const base = config.permissions.find(p => p.name === extend)
36
- if (!base) {
37
- throw new Error(`Permission ${permission.name} extends ${extend} but not exists`)
38
- }
39
- if (base.extends && base.extends.includes(base.name)) {
40
- throw new Error(`Permission ${permission.name} extends ${base.name} but it is a circular reference`)
41
- }
42
- if (base.extends && !base._completed) {
43
- this.extendPermission(config, base)
44
- }
45
- // Agrega las reglas que existen en el permiso base y no en el actual
46
- for (const rule of base.rules) {
47
- const exists = permission.rules.find(p => p.path === rule.path && p.actions === rule.actions)
48
- if (!exists) {
49
- permission.rules.push(rule)
50
- }
51
- }
52
- }
53
- permission._completed = true
54
- }
55
-
56
- extendRole (config, role) {
57
- for (const extend of role.extends) {
58
- const base = config.roles.find(p => p.name === extend)
59
- if (!base) {
60
- throw new Error(`Role ${role.name} extends ${extend} but not exists`)
61
- }
62
- if (base.extends && base.extends.includes(base.name)) {
63
- throw new Error(`Rome ${role.name} extends ${base.name} but it is a circular reference`)
64
- }
65
- if (base.extends && !base._completed) {
66
- this.extendRole(config, base)
67
- }
68
- // Agrega los permisos que existen en el role base y no en el actual
69
- for (const permission of base.permissions) {
70
- if (!role.permissions.includes(permission)) {
71
- role.permissions.push(permission)
72
- }
73
- }
74
- }
75
- role._completed = true
76
- }
77
-
78
-
79
- importSecurityConfig (config) {
80
- this._solveRoleId(config)
81
- this._validateAndNormalizeConfig(config)
82
- this.extendConfig(config)
83
- this._solveRulesByRole(config)
84
- this._solveMergeRulesByRole(config)
85
- this.config = config
86
- let defaultUserRole = process.env.blz_defaultUserRole;
87
- if (defaultUserRole)
88
- this.config.defaultUserRole = defaultUserRole;
89
- return this.config
90
- }
91
-
92
- getFrontendSecurityRules (roles, domains) {
93
- const _roles = this._getRoles(roles)
94
- const frontendRules = []
95
- for (const role of _roles) {
96
- const rules = this._getSecurityRulesByRole(role, 'frontend', domains)
97
- for (const rule of rules) {
98
- const previousRule = frontendRules.find(p => p.path === rule.path && p.actions === rule.actions)
99
- if (!previousRule) {
100
- frontendRules.push(rule)
101
- } else if (!previousRule.enable && rule.enable) {
102
- previousRule.enable = rule.enable
103
- }
104
- }
105
- }
106
- const arr = []
107
- // Resuelve las reglas por acciones
108
- for (const rule of frontendRules) {
109
- if (rule.actions && rule.actions.trim() !== '') {
110
- const actions = rule.actions.split(',')
111
- for (const action of actions) {
112
- arr.push({ path: rule.path.trim() + '|' + action.trim(), enable: rule.enable })
113
- }
114
- }
115
- }
116
- // Resuelve las reglas sin acciones a nivel de path
117
- for (const rule of frontendRules) {
118
- if (!rule.actions || rule.actions.trim() === '') {
119
- const enableRule = arr.some(p => p.path.split('|')[0] === rule.path && p.enable)
120
- const previousRule = arr.find(p => p.path === rule.path && (!p.actions || p.actions.trim() === ''))
121
- if (!previousRule) {
122
- // Si no existe una regla previa, se agrega
123
- arr.push({ path: rule.path.trim(), enable: enableRule || rule.enable })
124
- } else if (previousRule && !previousRule.enable && enableRule) {
125
- // Si existe una regla previa que habilita el path, se habilita
126
- previousRule.enable = true
127
- }
128
- }
129
- }
130
-
131
- const map = new Map();
132
- arr.forEach(item => {
133
- // Si no existe el path en el mapa, lo agregamos.
134
- if (!map.has(item.path)) {
135
- map.set(item.path, item);
136
- } else {
137
- // Si ya existe, verificamos el flag enable.
138
- const existing = map.get(item.path);
139
- // Si el existente es false y el nuevo es true, reemplazamos.
140
- if (!existing.enable && item.enable) {
141
- map.set(item.path, item);
142
- }
143
- // En caso contrario, dejamos el existente.
144
- }
145
- });
146
- // Convertimos el mapa a un array.
147
- const result = Array.from(map.values());
148
- return result
149
- }
150
-
151
- getSecurityRules (roles, side, domains) {
152
- const rules = []
153
- for (const role of roles) {
154
- const rulesByRole = this._getSecurityRulesByRole(role, side, domains)
155
- for (const rule of rulesByRole) {
156
- if (!rules.map(p => p.path).includes(rule.path)) {
157
- rules.push(rule)
158
- }
159
- }
160
- }
161
- return rules
162
- }
163
-
164
- getPermissions () {
165
- if (!this.config || !this.config.permissions || this.config.permissions.length === 0) {
166
- return []
167
- }
168
- return this.config.permissions.filter(p => p.visible || p.visible === null || p.visible === undefined ).map(p => p.name).sort()
169
- }
170
-
171
- authorized (path, action, roles, domains) {
172
- if (this.config.defaultUserRole)
173
- roles.push(this.config.defaultUserRole);
174
- if (path.startsWith('/api')) {
175
- return this._checkApi(path, action, roles, domains)
176
- } else {
177
- if (!action || action.trim() === '') {
178
- return this._checkPath(path, roles, domains)
179
- } else {
180
- return this._checkWidget(path, action, roles, domains)
181
- }
182
- }
183
- }
184
-
185
- checkAuthorize (path, action, roles, domains) {
186
- const result = this.authorized(path, action, roles, domains)
187
- if (result === null || result === undefined) {
188
- return true
189
- }
190
- return result
191
- }
192
-
193
- // Private methods //////////////////////////////////////////////////////////////////////////////////////////////
194
-
195
- _getSecurityRulesByRole (roleId, side, domains) {
196
- const role = this.config.roles.find(p => p.externalId === roleId)
197
- if (!role || !role.rules) {
198
- return []
199
- }
200
- const securityRules = role.rules[side]
201
- if (!securityRules) {
202
- return []
203
- }
204
- if (!domains || domains.length === 0) {
205
- return securityRules
206
- }
207
- return securityRules.filter(p => domains.includes(p.domain))
208
- }
209
-
210
-
211
- _solveRulesByRole (config) {
212
- for (const role of config.roles) {
213
- role.rules = { backend: [], frontend: [] }
214
- for (const permissionName of role.permissions) {
215
- const permission = config.permissions.find(p => p.name === permissionName)
216
- if (!permission) {
217
- continue
218
- }
219
- for (const rule of permission.rules) {
220
- const domain = permission.domain || 'default'
221
- if (rule.path.startsWith('/api')) {
222
- const exists = role.rules.backend.find(p => p.path === rule.path && p.actions === rule.actions && p.enable === rule.enable && p.domain === domain)
223
- if (!exists) {
224
- rule.domain = domain
225
- role.rules.backend.push(rule)
226
- }
227
- } else {
228
- const exists = role.rules.frontend.find(p => p.path === rule.path && p.actions === rule.actions && p.enable === rule.enable && p.domain === domain)
229
- if (!exists) {
230
- rule.domain = domain
231
- role.rules.frontend.push(rule)
232
- }
233
- }
234
- }
235
- }
236
- }
237
- }
238
-
239
- _solveMergeRulesByRole (config) {
240
- for (const role of config.roles) {
241
- for (const rule of role.rules.frontend) {
242
- role.rules.frontend = this._solveMergeRule(role.rules.frontend, rule)
243
- }
244
- for (const rule of role.rules.backend) {
245
- role.rules.backend = this._solveMergeRule(role.rules.backend, rule)
246
- }
247
- }
248
- }
249
-
250
- _solveRoleId (config) {
251
- for (const role of config.roles) {
252
- if (!role.externalId) {
253
- role.externalId = role.name
254
- }
255
- }
256
- }
257
-
258
- _getRoles (roles) {
259
- // If you do not have roles assigned, the default roles are assigned.
260
- const _roles = !roles || roles.length === 0 ? this.config.roles.filter(p => p.default).map(p => p.name) : roles
261
- // If there are roles that apply to all, they are added
262
- const applyToAll = this.config.roles.filter(p => p.applyToAll)
263
- if (applyToAll && applyToAll.length > 0) {
264
- for (const roleToAdd of applyToAll) {
265
- if (!_roles.includes(roleToAdd.name)) {
266
- _roles.push(roleToAdd.name)
267
- }
268
- }
269
- }
270
- return _roles
271
- }
272
-
273
- _getBackendSecurityRules (roles, action, domains) {
274
- let rules = []
275
- const _roles = this._getRoles(roles)
276
- for (const role of _roles) {
277
- const securityRules = this._getSecurityRulesByRole(role, 'backend', domains)
278
- const _rules = securityRules.filter(p => p.actions.includes('*') || p.actions.includes(action))
279
- for (const rule of _rules) {
280
- rules = this._solveMergeRule(rules, rule)
281
- }
282
- }
283
- return rules.sort((a, b) => (a.path > b.path) ? 1 : -1)
284
- }
285
-
286
- _solveMergeRule (rules, rule) {
287
- let _rules = JSON.parse(JSON.stringify(rules))
288
- const previousRules = _rules.filter(p => p.path === rule.path)
289
- if (previousRules.length == 0) {
290
- _rules.push(rule)
291
- } else {
292
- if (previousRules.some(p => p.actions.includes('*') && p.enable)) {
293
- // If a rule already exists that enables all paths
294
- return _rules
295
- } else if (rule.actions.includes('*') && rule.enable) {
296
- // remove rules with the same path and add rule with all actions
297
- _rules = _rules.filter(p => p.path !== rule.path)
298
- _rules.push(rule)
299
- } else if (rule.actions.includes('*') && !rule.enable) {
300
- // If the rule denies all permissions, it replaces the previous rules that it overrides with this one.
301
- _rules = _rules.filter(p => !(p.path === rule.path && p.enable === rule.enable))
302
- _rules.push(rule)
303
- } else if (!rule.enable && previousRules.some(p => p.actions.includes('*') && !p.enable)) {
304
- // If the rule disables and a disabling rule already exists, it does not exclude the rule
305
- return _rules
306
- } else {
307
- for (const action of rule.actions.split(',')) {
308
- const previousRules = _rules.filter(p => p.path === rule.path)
309
- if (previousRules.some(p => (p.actions.includes('*') || p.actions.includes(action)) && (p.enable || (p.enable === rule.enable)))) {
310
- // If the action already exists in the previous rule with the same enable state, it is not added
311
- // If the action exists in the previous rule and is enabled
312
- continue
313
- } else if (previousRules.some(p => (p.actions.includes(action) && !p.enable && rule.enable))) {
314
- // If the action is included but with a disable status and the new rule is enabled, it must be extracted from the previous one and added to the new rule
315
- const ruleToRemoveAction = previousRules.find(p => (p.actions.includes(action) && !p.enable))
316
- const newActions = ruleToRemoveAction.actions.split(',').filter(p => p !== action)
317
- if (newActions.length === 0) {
318
- // Remove the previous rule
319
- _rules = _rules.filter(p => !(p.path === rule.path && p.actions === action && !p.enable))
320
- } else {
321
- ruleToRemoveAction.actions = newActions.join(',')
322
- }
323
- // Search if there is a rule with the same path and enable state
324
- const previousEnableRule = previousRules.find(p => p.enable === rule.enable)
325
- if (previousEnableRule) {
326
- // If it exists, the action is added
327
- previousEnableRule.actions = previousEnableRule.actions + ',' + action
328
- } else {
329
- // If it does not exist, the rule is added
330
- _rules.push({ path: rule.path, actions: action, enable: rule.enable })
331
- }
332
- } else if (previousRules.some(p => (!p.actions.includes(action) && p.enable === rule.enable))) {
333
- // If the action is not included and the enable state is the same, the action will be added
334
- const previousRule = previousRules.find(p => p.enable === rule.enable)
335
- previousRule.actions = previousRule.actions + ',' + action
336
- } else {
337
- // Search if there is a rule with the same path and enable state
338
- const previousEnableRule = previousRules.find(p => p.enable === rule.enable)
339
- if (previousEnableRule) {
340
- // If it exists, the action is added
341
- previousEnableRule.actions = previousEnableRule.actions + ',' + action
342
- } else {
343
- // If it does not exist, the rule is added
344
- _rules.push({ path: rule.path, actions: action, enable: rule.enable })
345
- }
346
- }
347
- }
348
- }
349
- }
350
- return _rules
351
- }
352
-
353
- _cleanPath (fullUrl) {
354
- const indexOfQuestionMark = fullUrl.indexOf('?')
355
- return indexOfQuestionMark !== -1 ? fullUrl.substring(0, indexOfQuestionMark) : fullUrl
356
- }
357
-
358
- _cretaeExpression (route) {
359
- if (this.utils.isRegExp(route)) {
360
- return route
361
- }
362
-
363
- // Verifica si la ruta termina con "/**"
364
- if (route.endsWith('/**')) {
365
- const baseRoute = route
366
- .replace(/\|.*$/gm, '') // Remueve los parámetros
367
- .replace(/\/\*\*$/, ''); // Elimina el "/**" del final
368
-
369
- // Crea la expresión regular que incluye la ruta base y cualquier subruta
370
- return new RegExp(`^${baseRoute}(\/.*)?$`);
371
- }
372
-
373
- const expression = (
374
- route
375
- /**
376
- * Remueve todos los parámetros (si es que existen) que se pasan a la URL:
377
- * "/customers|add" -> "/customers"
378
- * "/customers|*" -> "/customers"
379
- * "/customers|" -> "/customers"
380
- * "/customers" -> "/customers"
381
- */
382
- .replace(/\|.*$/gm, '')
383
- /**
384
- * Remueve todos los "/" que tiene al final la URL
385
- * "/customers////" -> "/customers"
386
- * "/customers/" -> "/customers"
387
- * "/customers" -> "/customers"
388
- */
389
- .replace(/\/+$/, '')
390
- /**
391
- * Remueve todos los "/" que tiene al principio la URL y lo lo reemplaza por
392
- * '^/':
393
- * "/customers////" -> "/customers"
394
- * "/customers/" -> "/customers"
395
- * "/customers" -> "/customers"
396
- */
397
- .replace(/^\/+/, '^/')
398
- )
399
- return expression
400
- }
401
-
402
- _replaceDynamicURLParts (route) {
403
- let regexp = null
404
- if (this.utils.isRegExp(route)) {
405
- regexp = route
406
- } else {
407
- regexp = new RegExp(
408
- route
409
- .replace(/\*\*/gm, '.*')
410
- .replace(/\*/gm, function (match, offset, string) {
411
- if (string[offset - 1] === '.') {
412
- return '*'
413
- }
414
- return '[^/]*'
415
- }) + '$',
416
- ''
417
- )
418
- }
419
- return { regexp }
420
- }
421
-
422
- _findMatchedRoutes (url, routes = []) {
423
- const cleanUrl = url.replace(/^\/+/, '/')
424
- return routes
425
- .map((route) => {
426
- const pathExpression = this._cretaeExpression(route.path)
427
- const { regexp } = this._replaceDynamicURLParts(pathExpression)
428
- const match = regexp.test(cleanUrl)
429
- return match ? route : false
430
- })
431
- .filter((route) => route)
432
- }
433
-
434
- _checkApi (path, action, roles, domains) {
435
- const cleanedPath = this._cleanPath(path)
436
- const _action = action.toUpperCase()
437
- const securityRules = this._getBackendSecurityRules(roles, _action, domains)
438
- const matchedRoutes = this._findMatchedRoutes(cleanedPath, securityRules)
439
- const list = this.utils
440
- .chain(matchedRoutes)
441
- .filter(p => p.actions.includes('*') || p.actions.includes(_action))
442
- .value()
443
- const enabled = list.some(p => p.enable)
444
- const disabled = list.some(p => !p.enable)
445
- if (enabled || (!enabled && !disabled)) {
446
- return true
447
- }
448
- if (disabled) {
449
- this.logger.error(`can't access to ${action} ${path}`)
450
- return false
451
- }
452
- return null
453
- }
454
-
455
- _checkPath (path, roles, domains) {
456
- const securityRules = this.getFrontendSecurityRules(roles, domains)
457
- const list = this.utils
458
- .chain(this._findMatchedRoutes(path, securityRules))
459
- .value()
460
- const enabled = list.some(p => p.enable)
461
- const disabled = list.some(p => !p.enable)
462
- if (enabled || (!enabled && !disabled)) {
463
- return true
464
- }
465
- if (disabled) {
466
- return false
467
- }
468
- return null
469
- }
470
-
471
- _checkWidget (path, securityOption, roles, domains) {
472
- const _securityOption = securityOption.toUpperCase()
473
- const securityRules = this.getFrontendSecurityRules(roles, domains)
474
- const rules = this.utils
475
- .chain(this._findMatchedRoutes(path, securityRules))
476
- .filter(({ path }) => path.includes(this.WIDGET_SEPARATOR))
477
- .filter(({ path }) => {
478
- const expression = path.substring(path.indexOf(this.WIDGET_SEPARATOR) + 1).replace(/\*\*/gm, '.*')
479
- return new RegExp(`^${expression}$`, 'gm').test(_securityOption)
480
- })
481
- .value()
482
- const allActions = rules.find(p => p.path === path + '|**' && p.enable)
483
- if (allActions) {
484
- return true
485
- }
486
- const exactlyAction = rules.find(p => p.path === path + '|' + _securityOption)
487
- if (exactlyAction) {
488
- return exactlyAction.enable
489
- }
490
- const last = this.utils.chain(rules).reverse().first().value()
491
- if (last) {
492
- return last.enable
493
- }
494
- return null
495
- }
496
-
497
- _validateAndNormalizeConfig (config) {
498
- if (!config) {
499
- throw new Error('config is undefined')
500
- }
501
- if (config.roles === undefined || config.roles === null || config.roles.length === 0) {
502
- throw new Error('config.roles is undefined')
503
- }
504
- if (config.permissions === undefined || config.permissions === null || config.permissions.length === 0) {
505
- throw new Error('config.permissions is undefined')
506
- }
507
- // Validation and normalization of permissions
508
- for (const permission of config.permissions) {
509
- if (!permission.name) {
510
- throw new Error('Permission has not name')
511
- }
512
- if (!permission.rules) {
513
- permission.rules = []
514
- }
515
- if (!permission.visible) {
516
- permission.visible = true
517
- }
518
- for (const rule of permission.rules) {
519
- if (rule.enable === undefined || rule.enable === null) {
520
- rule.enable = true
521
- }
522
- if (rule.actions === undefined || rule.actions === null) {
523
- rule.actions = rule.path.startsWith('/api') ? '*' : ''
524
- } else {
525
- rule.actions = rule.actions.toUpperCase()
526
- }
527
- if (!rule.path) {
528
- throw new Error(`Rule in permission ${permission.name} has not path`)
529
- }
530
- }
531
- }
532
- // initialize permissions in roles
533
- for (const role of config.roles) {
534
- if (!role.permissions)role.permissions = []
535
- }
536
- }
537
- }
@@ -1,8 +0,0 @@
1
- module.exports = {
2
- startupBoxOptions: {
3
- padding: 1,
4
- margin: 1,
5
- borderStyle: 'round',
6
- borderColor: 'yellow'
7
- }
8
- }
@@ -1,8 +0,0 @@
1
-
2
- ██████╗ ██╗ █████╗ ███████╗███████╗██████╗ ██████╗ █████╗ ████████╗██╗ ██╗
3
- ██╔══██╗██║ ██╔══██╗╚══███╔╝██╔════╝██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝██║ ██║
4
- ██████╔╝██║ ███████║ ███╔╝ █████╗ ██║ ██║██████╔╝███████║ ██║ ███████║
5
- ██╔══██╗██║ ██╔══██║ ███╔╝ ██╔══╝ ██║ ██║██╔═══╝ ██╔══██║ ██║ ██╔══██║
6
- ██████╔╝███████╗██║ ██║███████╗███████╗██████╔╝██║ ██║ ██║ ██║ ██║ ██║
7
- ╚═════╝ ╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
8
-
@@ -1,75 +0,0 @@
1
- # Security
2
-
3
- ## Actual solution
4
-
5
- - Se establece un conjunto de permisos de acuerdo a security rules.
6
- - Estos security rules permiten habilitar o denegar el acceso vinculado a un path.
7
- - este path incluye la ruta del web-component y una security option.
8
- - esa security option puede estar asociado a un widget, una action o una parte de ese widget.
9
-
10
- ### Detected problems
11
-
12
- - La configuración de seguridad como su resolución están del lado del cliente, por lo cual es vulnerable a ataques.
13
- - El widget al que se aplica seguridad siempre debe tener definido un path.
14
- - No se puede definir seguridad en sub-componentes, los cuales no tienen una ruta asociada y pueden ser incluidos en otros componentes.
15
- - No hay un mecanismo de configuración masivo de seguridad.
16
- - En IPLAN se estableció una estrategia agregando la configuración en archivos de recursos
17
-
18
- ## Proposal
19
-
20
- ### Requirements
21
-
22
- - Establecer un conjunto de permisos de acuerdo a un role.
23
- - Establecer diferentes estrategias de como obtener los roles asociados a un usuario.
24
- - Una de estas estrategias sera a traves de jwt.
25
- - Establecer diferentes estrategias de como obtener la configuración de seguridad.
26
- - A traves de un archivo de recursos (Del lado del servidor)
27
- - A traves de consumir un servicio rest.
28
-
29
- - Permitir definir seguridad en sub-componentes.
30
- - Permitir definir seguridad en componentes que no tienen una ruta asociada.
31
-
32
- - Establecer funcionalidad de importar y exportar configuración de seguridad
33
- - Agregar UI para administrar la configuración de seguridad.
34
- - Lo mas probable es que esta UI este en un paquete aparte.
35
-
36
- ## Se modifica comando para que se pueda consumir desde el backend
37
-
38
- - Se modifica la definición del comando para que se pueda consumir desde el backend
39
- - path: ~/blazedapth/blz/blz-suite/frontend/suite/javascripts/descriptors/commands/set-security-rule.js
40
- - path: ~/blazedapth/blz/blz-suite/frontend/suite/javascripts/descriptors/commands/reset-security-rules.js
41
- - Se Renombra SecurityClient por BlzSecurity
42
- - path: ~/blazedapth/blz/blz-builder/burners/web-frontend/sources/startup/index.js
43
- - path: ~/blazedapth/blz/blz-suite/backend/servers/web-frontend/index.js
44
- - Se modifica Blz.setSecurityRule por BlzSecurity.setSecurityRule
45
- - path: ~/blazedapth/blz/blz-commons/js-generator/commands/set-security-rule.js
46
- - Se modifica Blz.clearSecurityRules por BlzSecurity.clearSecurityRules
47
- - path: ~/blazedapth/blz/blz-commons/js-generator/commands/reset-security-rules.js
48
- - Se agrega BlzSecurity en Blz_controls_RouteResolver
49
- - path: ~/blazedapth/blz/blz-ui/assets/js/blz-wrappers/Blz_controls_RouteResolver.js
50
-
51
- ## Agregar archivo de seguridad para importación masiva
52
-
53
- ## Update blzUi
54
-
55
- Build Dev:
56
-
57
- ```sh
58
- cd blz-ui/
59
- grunt prod-dev
60
- ```
61
-
62
- Build Prod:
63
-
64
- ```sh
65
- cd blz-ui/
66
- grunt prod-prod
67
- ```
68
-
69
- ## References
70
-
71
- - Documentation
72
- - [security rules and options](https://docs-blz.bsn-dev.beesion.team/#/doc/security-rules-and-options)
73
- - Demo
74
- - [DemoAuth](~/blazedapth/blz/blz-commons/essentials/solutions/DemoAuth)
75
-
@@ -1,46 +0,0 @@
1
- const clamav = require('clamav.js');
2
- const path = require('path');
3
-
4
- /**
5
- * Scans a readable stream for viruses using ClamAV over TCP.
6
- *
7
- * @param {ReadableStream} stream - A Node.js readable stream to scan.
8
- * @param {Object} [options]
9
- * @param {number} [options.port=3310] - TCP port where clamd is listening.
10
- * @param {string} [options.host='127.0.0.1'] - Clamd host.
11
- * @param {number} [options.timeout=60000] - Timeout in milliseconds.
12
- * @returns {Promise<{ clean: boolean, name: string }>} - Scan result.
13
- */
14
- async function scanStream(stream, options = {}) {
15
- const port = options.port || 3310;
16
- const host = options.host || '127.0.0.1';
17
- const timeout = options.timeout || 60000;
18
-
19
- const scanner = clamav.createScanner(port, host, timeout);
20
-
21
- return new Promise((resolve, reject) => {
22
- scanner.scan(stream, (err, name, isInfected) => {
23
- if (err) return reject(err);
24
- resolve({
25
- clean: !isInfected,
26
- name,
27
- });
28
- });
29
- });
30
- }
31
-
32
- /**
33
- * Checks if a file extension is allowed.
34
- * @param {string} filename - Name of the file to check.
35
- * @returns {boolean}
36
- */
37
- function fileExtensionAllowed(filename) {
38
- const ext = path.extname(filename).toLowerCase();
39
- const allowed = process.env.blz_fileScannerAllowedExtension;
40
- return allowed ? allowed.split(',').includes(ext) : true;
41
- }
42
-
43
- module.exports = {
44
- scanStream,
45
- fileExtensionAllowed,
46
- };