@voxgig/sdkgen 4.32.1 → 4.34.0

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 (442) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/action/copies.d.ts +21 -0
  3. package/dist/action/copies.js +146 -0
  4. package/dist/action/copies.js.map +1 -0
  5. package/dist/action/doctor.d.ts +15 -2
  6. package/dist/action/doctor.js +169 -23
  7. package/dist/action/doctor.js.map +1 -1
  8. package/dist/action/edition.js +6 -2
  9. package/dist/action/edition.js.map +1 -1
  10. package/dist/action/feature.js +6 -2
  11. package/dist/action/feature.js.map +1 -1
  12. package/dist/action/package.js +28 -10
  13. package/dist/action/package.js.map +1 -1
  14. package/dist/action/remove.js +2 -0
  15. package/dist/action/remove.js.map +1 -1
  16. package/dist/action/resolve.d.ts +1 -0
  17. package/dist/action/resolve.js +10 -2
  18. package/dist/action/resolve.js.map +1 -1
  19. package/dist/action/target.js +6 -2
  20. package/dist/action/target.js.map +1 -1
  21. package/dist/helpers/naming.js +1 -1
  22. package/dist/helpers/naming.js.map +1 -1
  23. package/dist/sdkgen.d.ts +2 -1
  24. package/dist/sdkgen.js +36 -3
  25. package/dist/sdkgen.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/model/sdkgen.aontu +7 -1
  28. package/package.json +1 -1
  29. package/project/.sdk/model/feature/debug.aontu +3 -1
  30. package/project/.sdk/src/cmp/c/PrepareAuth_c.ts +8 -28
  31. package/project/.sdk/src/cmp/c/TestClean_c.ts +774 -0
  32. package/project/.sdk/src/cmp/c/Test_c.ts +3 -0
  33. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +16 -5
  34. package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -1
  35. package/project/.sdk/src/cmp/clojure/PrepareAuth_clojure.ts +3 -0
  36. package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +473 -0
  37. package/project/.sdk/src/cmp/clojure/Test_clojure.ts +6 -0
  38. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -8
  39. package/project/.sdk/src/cmp/cpp/PrepareAuth_cpp.ts +3 -0
  40. package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +782 -0
  41. package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +1 -1
  42. package/project/.sdk/src/cmp/cpp/Test_cpp.ts +2 -0
  43. package/project/.sdk/src/cmp/csharp/PrepareAuth_csharp.ts +3 -0
  44. package/project/.sdk/src/cmp/csharp/TestClean_csharp.ts +887 -0
  45. package/project/.sdk/src/cmp/csharp/Test_csharp.ts +2 -0
  46. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +68 -4
  47. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +8 -2
  48. package/project/.sdk/src/cmp/csharp/fragment/SdkError.fragment.cs +49 -0
  49. package/project/.sdk/src/cmp/elixir/PrepareAuth_elixir.ts +3 -0
  50. package/project/.sdk/src/cmp/elixir/Schema_elixir.ts +20 -10
  51. package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +666 -0
  52. package/project/.sdk/src/cmp/elixir/Test_elixir.ts +4 -0
  53. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +1 -1
  54. package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +14 -2
  55. package/project/.sdk/src/cmp/go/PrepareAuth_go.ts +3 -0
  56. package/project/.sdk/src/cmp/go/TestClean_go.ts +804 -0
  57. package/project/.sdk/src/cmp/go/Test_go.ts +3 -0
  58. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +54 -4
  59. package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +27 -2
  60. package/project/.sdk/src/cmp/java/PrepareAuth_java.ts +3 -0
  61. package/project/.sdk/src/cmp/java/TestClean_java.ts +884 -0
  62. package/project/.sdk/src/cmp/java/Test_java.ts +2 -0
  63. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +56 -11
  64. package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +36 -3
  65. package/project/.sdk/src/cmp/js/PrepareAuth_js.ts +3 -0
  66. package/project/.sdk/src/cmp/js/TestClean_js.ts +458 -0
  67. package/project/.sdk/src/cmp/js/Test_js.ts +2 -0
  68. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +5 -4
  69. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +7 -1
  70. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +7 -1
  71. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +7 -1
  72. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +7 -1
  73. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +7 -1
  74. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +11 -2
  75. package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +17 -1
  76. package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +5 -0
  77. package/project/.sdk/src/cmp/kotlin/PrepareAuth_kotlin.ts +3 -0
  78. package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +654 -0
  79. package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +3 -0
  80. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +44 -11
  81. package/project/.sdk/src/cmp/kotlin/fragment/SdkError.fragment.kt +31 -0
  82. package/project/.sdk/src/cmp/lua/PrepareAuth_lua.ts +3 -0
  83. package/project/.sdk/src/cmp/lua/TestClean_lua.ts +769 -0
  84. package/project/.sdk/src/cmp/lua/Test_lua.ts +3 -0
  85. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +77 -1
  86. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +49 -2
  87. package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +3 -2
  88. package/project/.sdk/src/cmp/ocaml/PrepareAuth_ocaml.ts +4 -25
  89. package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +538 -0
  90. package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +5 -0
  91. package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +16 -4
  92. package/project/.sdk/src/cmp/perl/PrepareAuth_perl.ts +3 -0
  93. package/project/.sdk/src/cmp/perl/TestClean_perl.ts +619 -0
  94. package/project/.sdk/src/cmp/perl/Test_perl.ts +3 -0
  95. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +67 -5
  96. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +13 -1
  97. package/project/.sdk/src/cmp/php/PrepareAuth_php.ts +3 -0
  98. package/project/.sdk/src/cmp/php/TestClean_php.ts +809 -0
  99. package/project/.sdk/src/cmp/php/Test_php.ts +2 -0
  100. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +96 -55
  101. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +15 -2
  102. package/project/.sdk/src/cmp/py/PrepareAuth_py.ts +3 -0
  103. package/project/.sdk/src/cmp/py/TestClean_py.ts +549 -0
  104. package/project/.sdk/src/cmp/py/Test_py.ts +3 -0
  105. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +83 -55
  106. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +19 -3
  107. package/project/.sdk/src/cmp/rb/PrepareAuth_rb.ts +3 -0
  108. package/project/.sdk/src/cmp/rb/TestClean_rb.ts +535 -0
  109. package/project/.sdk/src/cmp/rb/Test_rb.ts +3 -0
  110. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +108 -46
  111. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +12 -1
  112. package/project/.sdk/src/cmp/rust/PrepareAuth_rust.ts +9 -45
  113. package/project/.sdk/src/cmp/rust/TestClean_rust.ts +881 -0
  114. package/project/.sdk/src/cmp/rust/Test_rust.ts +3 -0
  115. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +14 -6
  116. package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +17 -1
  117. package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +34 -2
  118. package/project/.sdk/src/cmp/scala/PrepareAuth_scala.ts +3 -0
  119. package/project/.sdk/src/cmp/scala/TestClean_scala.ts +608 -0
  120. package/project/.sdk/src/cmp/scala/Test_scala.ts +3 -0
  121. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +58 -6
  122. package/project/.sdk/src/cmp/swift/PrepareAuth_swift.ts +3 -0
  123. package/project/.sdk/src/cmp/swift/TestClean_swift.ts +671 -0
  124. package/project/.sdk/src/cmp/swift/Test_swift.ts +3 -0
  125. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +10 -0
  126. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +16 -2
  127. package/project/.sdk/src/cmp/swift/fragment/SdkError.fragment.swift +47 -3
  128. package/project/.sdk/src/cmp/ts/PrepareAuth_ts.ts +3 -0
  129. package/project/.sdk/src/cmp/ts/TestClean_ts.ts +465 -0
  130. package/project/.sdk/src/cmp/ts/Test_ts.ts +2 -0
  131. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +5 -4
  132. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +7 -1
  133. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +7 -1
  134. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +7 -1
  135. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +7 -1
  136. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +7 -1
  137. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +8 -2
  138. package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +20 -2
  139. package/project/.sdk/src/cmp/zig/PrepareAuth_zig.ts +3 -0
  140. package/project/.sdk/src/cmp/zig/TestClean_zig.ts +791 -0
  141. package/project/.sdk/src/cmp/zig/Test_zig.ts +5 -0
  142. package/project/.sdk/src/cmp/zig/fragment/Build.fragment.zig +19 -0
  143. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +14 -5
  144. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +1 -1
  145. package/project/.sdk/tm/c/core/context.c +25 -0
  146. package/project/.sdk/tm/c/core/error.c +16 -0
  147. package/project/.sdk/tm/c/core/sdk.h +22 -0
  148. package/project/.sdk/tm/c/feature/audit.c +2 -0
  149. package/project/.sdk/tm/c/feature/cost.c +1 -0
  150. package/project/.sdk/tm/c/feature/debug.c +19 -29
  151. package/project/.sdk/tm/c/feature/log.c +21 -2
  152. package/project/.sdk/tm/c/feature/proxy.c +55 -3
  153. package/project/.sdk/tm/c/feature/secrets.c +7 -0
  154. package/project/.sdk/tm/c/feature/telemetry.c +2 -0
  155. package/project/.sdk/tm/c/tests/feature_test.c +2 -2
  156. package/project/.sdk/tm/c/utility/clean.c +530 -8
  157. package/project/.sdk/tm/c/utility/done.c +28 -12
  158. package/project/.sdk/tm/c/utility/make_error.c +4 -3
  159. package/project/.sdk/tm/c/utility/make_options.c +71 -45
  160. package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +15 -0
  161. package/project/.sdk/tm/clojure/src/sdk/client.clj +20 -4
  162. package/project/.sdk/tm/clojure/src/sdk/core.clj +319 -35
  163. package/project/.sdk/tm/clojure/src/sdk/features.clj +68 -30
  164. package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +4 -2
  165. package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +47 -20
  166. package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +4 -0
  167. package/project/.sdk/tm/cpp/core/types.hpp +93 -3
  168. package/project/.sdk/tm/cpp/feature/audit.hpp +1 -0
  169. package/project/.sdk/tm/cpp/feature/cost.hpp +1 -0
  170. package/project/.sdk/tm/cpp/feature/debug.hpp +20 -12
  171. package/project/.sdk/tm/cpp/feature/log.hpp +31 -9
  172. package/project/.sdk/tm/cpp/feature/proxy.hpp +52 -6
  173. package/project/.sdk/tm/cpp/feature/secrets.hpp +13 -0
  174. package/project/.sdk/tm/cpp/feature/telemetry.hpp +4 -2
  175. package/project/.sdk/tm/cpp/test/feature_test.cpp +2 -2
  176. package/project/.sdk/tm/cpp/utility/pipeline.hpp +426 -51
  177. package/project/.sdk/tm/csharp/core/Context.cs +32 -0
  178. package/project/.sdk/tm/csharp/core/Utility.cs +2 -0
  179. package/project/.sdk/tm/csharp/feature/AuditFeature.cs +1 -0
  180. package/project/.sdk/tm/csharp/feature/CostFeature.cs +7 -5
  181. package/project/.sdk/tm/csharp/feature/DebugFeature.cs +19 -16
  182. package/project/.sdk/tm/csharp/feature/FeatureOptions.cs +16 -0
  183. package/project/.sdk/tm/csharp/feature/LogFeature.cs +4 -1
  184. package/project/.sdk/tm/csharp/feature/ProxyFeature.cs +26 -5
  185. package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +16 -0
  186. package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +4 -2
  187. package/project/.sdk/tm/csharp/test/FeatureTest.cs +2 -2
  188. package/project/.sdk/tm/csharp/utility/Clean.cs +440 -2
  189. package/project/.sdk/tm/csharp/utility/Done.cs +27 -11
  190. package/project/.sdk/tm/csharp/utility/MakeError.cs +19 -8
  191. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +119 -29
  192. package/project/.sdk/tm/csharp/utility/MakeResponse.cs +21 -11
  193. package/project/.sdk/tm/csharp/utility/Register.cs +1 -0
  194. package/project/.sdk/tm/elixir/lib/projectname/context.ex +19 -0
  195. package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +22 -1
  196. package/project/.sdk/tm/elixir/lib/projectname/error.ex +24 -0
  197. package/project/.sdk/tm/elixir/lib/projectname/feature/audit.ex +2 -2
  198. package/project/.sdk/tm/elixir/lib/projectname/feature/cost.ex +2 -2
  199. package/project/.sdk/tm/elixir/lib/projectname/feature/debug.ex +13 -13
  200. package/project/.sdk/tm/elixir/lib/projectname/feature/log.ex +18 -5
  201. package/project/.sdk/tm/elixir/lib/projectname/feature/proxy.ex +19 -1
  202. package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +15 -0
  203. package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +4 -2
  204. package/project/.sdk/tm/elixir/lib/projectname/feature.ex +22 -0
  205. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +464 -41
  206. package/project/.sdk/tm/elixir/test/feature_test.exs +3 -2
  207. package/project/.sdk/tm/go/core/context.go +42 -0
  208. package/project/.sdk/tm/go/core/error.go +30 -10
  209. package/project/.sdk/tm/go/core/utility_type.go +2 -0
  210. package/project/.sdk/tm/go/feature/audit_feature.go +1 -0
  211. package/project/.sdk/tm/go/feature/base_feature.go +12 -0
  212. package/project/.sdk/tm/go/feature/cost_feature.go +2 -2
  213. package/project/.sdk/tm/go/feature/debug_feature.go +14 -12
  214. package/project/.sdk/tm/go/feature/log_feature.go +13 -8
  215. package/project/.sdk/tm/go/feature/proxy_feature.go +26 -6
  216. package/project/.sdk/tm/go/feature/secrets_feature.go +19 -0
  217. package/project/.sdk/tm/go/feature/telemetry_feature.go +4 -2
  218. package/project/.sdk/tm/go/test/feature_test.go +2 -2
  219. package/project/.sdk/tm/go/utility/clean.go +585 -2
  220. package/project/.sdk/tm/go/utility/done.go +29 -9
  221. package/project/.sdk/tm/go/utility/make_error.go +51 -16
  222. package/project/.sdk/tm/go/utility/make_options.go +77 -36
  223. package/project/.sdk/tm/go/utility/register.go +12 -0
  224. package/project/.sdk/tm/java/core/Context.java +29 -0
  225. package/project/.sdk/tm/java/core/SdkClient.java +4 -2
  226. package/project/.sdk/tm/java/core/Utility.java +7 -0
  227. package/project/.sdk/tm/java/feature/AuditFeature.java +6 -0
  228. package/project/.sdk/tm/java/feature/CostFeature.java +5 -0
  229. package/project/.sdk/tm/java/feature/DebugFeature.java +25 -14
  230. package/project/.sdk/tm/java/feature/LogFeature.java +11 -4
  231. package/project/.sdk/tm/java/feature/ProxyFeature.java +41 -6
  232. package/project/.sdk/tm/java/feature/SecretsFeature.java +18 -0
  233. package/project/.sdk/tm/java/feature/TelemetryFeature.java +8 -2
  234. package/project/.sdk/tm/java/test/FeatureTest.java +2 -2
  235. package/project/.sdk/tm/java/utility/Clean.java +519 -1
  236. package/project/.sdk/tm/java/utility/Done.java +1 -1
  237. package/project/.sdk/tm/java/utility/MakeError.java +5 -1
  238. package/project/.sdk/tm/java/utility/MakeOptions.java +55 -31
  239. package/project/.sdk/tm/java/utility/Register.java +4 -0
  240. package/project/.sdk/tm/js/src/Context.js +5 -1
  241. package/project/.sdk/tm/js/src/feature/audit/AuditFeature.js +2 -2
  242. package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +2 -2
  243. package/project/.sdk/tm/js/src/feature/debug/DebugFeature.js +13 -7
  244. package/project/.sdk/tm/js/src/feature/log/LogFeature.js +9 -5
  245. package/project/.sdk/tm/js/src/feature/proxy/ProxyFeature.js +19 -1
  246. package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +14 -0
  247. package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +4 -2
  248. package/project/.sdk/tm/js/src/utility/CleanUtility.js +294 -21
  249. package/project/.sdk/tm/js/src/utility/DoneUtility.js +17 -5
  250. package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +18 -2
  251. package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +39 -15
  252. package/project/.sdk/tm/js/src/utility/Utility.js +4 -2
  253. package/project/.sdk/tm/js/test/feature/harness.js +11 -1
  254. package/project/.sdk/tm/js/test/feature.test.js +9 -2
  255. package/project/.sdk/tm/kotlin/core/Context.kt +19 -0
  256. package/project/.sdk/tm/kotlin/core/SdkClient.kt +9 -2
  257. package/project/.sdk/tm/kotlin/core/Utility.kt +2 -0
  258. package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +11 -9
  259. package/project/.sdk/tm/kotlin/feature/CostFeature.kt +8 -5
  260. package/project/.sdk/tm/kotlin/feature/DebugFeature.kt +15 -22
  261. package/project/.sdk/tm/kotlin/feature/LogFeature.kt +8 -4
  262. package/project/.sdk/tm/kotlin/feature/ProxyFeature.kt +26 -2
  263. package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +11 -0
  264. package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +4 -2
  265. package/project/.sdk/tm/kotlin/test/FeatureTest.kt +2 -2
  266. package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +447 -11
  267. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +38 -31
  268. package/project/.sdk/tm/kotlin/utility/Register.kt +1 -0
  269. package/project/.sdk/tm/lua/core/context.lua +43 -0
  270. package/project/.sdk/tm/lua/core/error.lua +36 -1
  271. package/project/.sdk/tm/lua/core/utility_type.lua +4 -0
  272. package/project/.sdk/tm/lua/feature/audit_feature.lua +2 -2
  273. package/project/.sdk/tm/lua/feature/cost_feature.lua +2 -2
  274. package/project/.sdk/tm/lua/feature/debug_feature.lua +21 -17
  275. package/project/.sdk/tm/lua/feature/log_feature.lua +2 -1
  276. package/project/.sdk/tm/lua/feature/proxy_feature.lua +23 -1
  277. package/project/.sdk/tm/lua/feature/secrets_feature.lua +18 -0
  278. package/project/.sdk/tm/lua/feature/telemetry_feature.lua +4 -2
  279. package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +3 -2
  280. package/project/.sdk/tm/lua/test/feature_test.lua +10 -3
  281. package/project/.sdk/tm/lua/utility/clean.lua +426 -2
  282. package/project/.sdk/tm/lua/utility/clean_explain.lua +34 -0
  283. package/project/.sdk/tm/lua/utility/done.lua +1 -7
  284. package/project/.sdk/tm/lua/utility/make_error.lua +3 -1
  285. package/project/.sdk/tm/lua/utility/make_options.lua +76 -30
  286. package/project/.sdk/tm/lua/utility/register.lua +4 -1
  287. package/project/.sdk/tm/ocaml/Makefile +5 -1
  288. package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +12 -1
  289. package/project/.sdk/tm/ocaml/sdk_features.ml +78 -18
  290. package/project/.sdk/tm/ocaml/sdk_helpers.ml +27 -0
  291. package/project/.sdk/tm/ocaml/sdk_runtime.ml +304 -26
  292. package/project/.sdk/tm/ocaml/sdk_types.ml +1 -0
  293. package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +3 -1
  294. package/project/.sdk/tm/ocaml/test/t_feature.ml +2 -2
  295. package/project/.sdk/tm/perl/core/context.pm +27 -0
  296. package/project/.sdk/tm/perl/core/error.pm +52 -5
  297. package/project/.sdk/tm/perl/feature/audit_feature.pm +2 -2
  298. package/project/.sdk/tm/perl/feature/cost_feature.pm +2 -2
  299. package/project/.sdk/tm/perl/feature/debug_feature.pm +17 -13
  300. package/project/.sdk/tm/perl/feature/log_feature.pm +3 -1
  301. package/project/.sdk/tm/perl/feature/proxy_feature.pm +21 -1
  302. package/project/.sdk/tm/perl/feature/secrets_feature.pm +20 -1
  303. package/project/.sdk/tm/perl/feature/telemetry_feature.pm +4 -2
  304. package/project/.sdk/tm/perl/t/feature.t +4 -2
  305. package/project/.sdk/tm/perl/utility/clean.pm +345 -1
  306. package/project/.sdk/tm/perl/utility/done.pm +24 -6
  307. package/project/.sdk/tm/perl/utility/make_error.pm +17 -4
  308. package/project/.sdk/tm/perl/utility/make_options.pm +33 -14
  309. package/project/.sdk/tm/php/core/Context.php +24 -1
  310. package/project/.sdk/tm/php/core/Error.php +34 -3
  311. package/project/.sdk/tm/php/core/UtilityType.php +4 -0
  312. package/project/.sdk/tm/php/feature/AuditFeature.php +2 -2
  313. package/project/.sdk/tm/php/feature/CostFeature.php +2 -2
  314. package/project/.sdk/tm/php/feature/DebugFeature.php +18 -9
  315. package/project/.sdk/tm/php/feature/LogFeature.php +5 -2
  316. package/project/.sdk/tm/php/feature/ProxyFeature.php +20 -1
  317. package/project/.sdk/tm/php/feature/SecretsFeature.php +18 -0
  318. package/project/.sdk/tm/php/feature/TelemetryFeature.php +4 -2
  319. package/project/.sdk/tm/php/test/FeatureTest.php +2 -2
  320. package/project/.sdk/tm/php/utility/Clean.php +438 -2
  321. package/project/.sdk/tm/php/utility/Done.php +14 -7
  322. package/project/.sdk/tm/php/utility/MakeError.php +9 -7
  323. package/project/.sdk/tm/php/utility/MakeOptions.php +62 -38
  324. package/project/.sdk/tm/php/utility/Register.php +2 -0
  325. package/project/.sdk/tm/py/pkg/core/context.py +17 -0
  326. package/project/.sdk/tm/py/pkg/core/error.py +42 -1
  327. package/project/.sdk/tm/py/pkg/core/utility_type.py +4 -0
  328. package/project/.sdk/tm/py/pkg/feature/audit_feature.py +2 -2
  329. package/project/.sdk/tm/py/pkg/feature/cost_feature.py +2 -2
  330. package/project/.sdk/tm/py/pkg/feature/debug_feature.py +17 -12
  331. package/project/.sdk/tm/py/pkg/feature/log_feature.py +2 -1
  332. package/project/.sdk/tm/py/pkg/feature/proxy_feature.py +18 -1
  333. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +12 -0
  334. package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +4 -2
  335. package/project/.sdk/tm/py/pkg/utility/clean.py +311 -1
  336. package/project/.sdk/tm/py/pkg/utility/done.py +18 -5
  337. package/project/.sdk/tm/py/pkg/utility/make_error.py +9 -6
  338. package/project/.sdk/tm/py/pkg/utility/make_options.py +64 -25
  339. package/project/.sdk/tm/py/pkg/utility/make_response.py +19 -13
  340. package/project/.sdk/tm/py/pkg/utility/register.py +4 -2
  341. package/project/.sdk/tm/py/test/feature_harness.py +4 -0
  342. package/project/.sdk/tm/py/test/test_feature.py +2 -2
  343. package/project/.sdk/tm/py/test/test_primary_utility.py +1 -0
  344. package/project/.sdk/tm/rb/core/context.rb +28 -0
  345. package/project/.sdk/tm/rb/core/error.rb +30 -0
  346. package/project/.sdk/tm/rb/core/utility_type.rb +1 -1
  347. package/project/.sdk/tm/rb/feature/audit_feature.rb +2 -2
  348. package/project/.sdk/tm/rb/feature/cost_feature.rb +2 -2
  349. package/project/.sdk/tm/rb/feature/debug_feature.rb +15 -12
  350. package/project/.sdk/tm/rb/feature/log_feature.rb +3 -1
  351. package/project/.sdk/tm/rb/feature/proxy_feature.rb +25 -1
  352. package/project/.sdk/tm/rb/feature/secrets_feature.rb +17 -0
  353. package/project/.sdk/tm/rb/feature/telemetry_feature.rb +4 -2
  354. package/project/.sdk/tm/rb/test/feature_test.rb +4 -2
  355. package/project/.sdk/tm/rb/utility/clean.rb +312 -1
  356. package/project/.sdk/tm/rb/utility/done.rb +15 -5
  357. package/project/.sdk/tm/rb/utility/make_error.rb +13 -4
  358. package/project/.sdk/tm/rb/utility/make_options.rb +31 -12
  359. package/project/.sdk/tm/rb/utility/register.rb +2 -0
  360. package/project/.sdk/tm/rust/core/context.rs +55 -0
  361. package/project/.sdk/tm/rust/core/utility_type.rs +17 -0
  362. package/project/.sdk/tm/rust/feature/audit.rs +2 -0
  363. package/project/.sdk/tm/rust/feature/cost.rs +3 -2
  364. package/project/.sdk/tm/rust/feature/debug.rs +16 -16
  365. package/project/.sdk/tm/rust/feature/log.rs +42 -7
  366. package/project/.sdk/tm/rust/feature/proxy.rs +48 -2
  367. package/project/.sdk/tm/rust/feature/secrets.rs +12 -0
  368. package/project/.sdk/tm/rust/feature/telemetry.rs +2 -0
  369. package/project/.sdk/tm/rust/tests/feature_test.rs +2 -2
  370. package/project/.sdk/tm/rust/utility/clean.rs +446 -5
  371. package/project/.sdk/tm/rust/utility/done.rs +22 -12
  372. package/project/.sdk/tm/rust/utility/make_error.rs +4 -1
  373. package/project/.sdk/tm/rust/utility/make_options.rs +73 -19
  374. package/project/.sdk/tm/scala/Makefile +3 -1
  375. package/project/.sdk/tm/scala/core/Context.scala +16 -0
  376. package/project/.sdk/tm/scala/core/SdkClient.scala +14 -4
  377. package/project/.sdk/tm/scala/core/SdkError.scala +28 -0
  378. package/project/.sdk/tm/scala/core/Types.scala +3 -0
  379. package/project/.sdk/tm/scala/core/Utility.scala +2 -0
  380. package/project/.sdk/tm/scala/feature/AuditFeature.scala +16 -10
  381. package/project/.sdk/tm/scala/feature/CostFeature.scala +10 -5
  382. package/project/.sdk/tm/scala/feature/DebugFeature.scala +24 -21
  383. package/project/.sdk/tm/scala/feature/LogFeature.scala +9 -4
  384. package/project/.sdk/tm/scala/feature/ProxyFeature.scala +23 -2
  385. package/project/.sdk/tm/scala/feature/SecretsFeature.scala +14 -0
  386. package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +9 -2
  387. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +2 -2
  388. package/project/.sdk/tm/scala/utility/Make.scala +63 -20
  389. package/project/.sdk/tm/scala/utility/Misc.scala +358 -5
  390. package/project/.sdk/tm/scala/utility/Register.scala +1 -0
  391. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +29 -0
  392. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Utility.swift +2 -0
  393. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +10 -9
  394. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CostFeature.swift +7 -5
  395. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/DebugFeature.swift +19 -15
  396. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/FeatureOptions.swift +16 -0
  397. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/LogFeature.swift +4 -1
  398. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ProxyFeature.swift +20 -5
  399. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +13 -0
  400. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +4 -2
  401. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeError.swift +15 -5
  402. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +58 -19
  403. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Register.swift +1 -0
  404. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +391 -4
  405. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +2 -2
  406. package/project/.sdk/tm/ts/src/Context.ts +5 -1
  407. package/project/.sdk/tm/ts/src/feature/audit/AuditFeature.ts +2 -2
  408. package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +2 -2
  409. package/project/.sdk/tm/ts/src/feature/debug/DebugFeature.ts +13 -7
  410. package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +9 -5
  411. package/project/.sdk/tm/ts/src/feature/proxy/ProxyFeature.ts +19 -1
  412. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +12 -0
  413. package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +4 -2
  414. package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +287 -9
  415. package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +18 -5
  416. package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +18 -8
  417. package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +38 -16
  418. package/project/.sdk/tm/ts/src/utility/Utility.ts +4 -2
  419. package/project/.sdk/tm/ts/test/feature/harness.ts +11 -1
  420. package/project/.sdk/tm/ts/test/feature.test.ts +9 -2
  421. package/project/.sdk/tm/zig/core/context.zig +34 -0
  422. package/project/.sdk/tm/zig/core/error.zig +22 -1
  423. package/project/.sdk/tm/zig/core/utility.zig +403 -39
  424. package/project/.sdk/tm/zig/feature/audit.zig +4 -2
  425. package/project/.sdk/tm/zig/feature/cost.zig +3 -2
  426. package/project/.sdk/tm/zig/feature/debug.zig +20 -25
  427. package/project/.sdk/tm/zig/feature/log.zig +3 -1
  428. package/project/.sdk/tm/zig/feature/proxy.zig +47 -6
  429. package/project/.sdk/tm/zig/feature/secrets.zig +7 -0
  430. package/project/.sdk/tm/zig/feature/telemetry.zig +4 -2
  431. package/project/.sdk/tm/zig/test/feature_test.zig +2 -2
  432. package/project/sdkgen-package.json +1 -1
  433. package/src/action/copies.ts +219 -0
  434. package/src/action/doctor.ts +247 -21
  435. package/src/action/edition.ts +10 -2
  436. package/src/action/feature.ts +11 -2
  437. package/src/action/package.ts +31 -10
  438. package/src/action/remove.ts +4 -0
  439. package/src/action/resolve.ts +16 -3
  440. package/src/action/target.ts +10 -2
  441. package/src/helpers/naming.ts +1 -1
  442. package/src/sdkgen.ts +45 -5
@@ -134,13 +134,19 @@
134
134
  ;; error map under ::sdk-error.
135
135
  ;; ---------------------------------------------------------------------------
136
136
 
137
+ ;; The context rides in the map's METADATA, not as a key: the error is data
138
+ ;; and `pr-str`/`ex-data` print every key, and the context holds the live
139
+ ;; spec and options. Reachable through `err-ctx` for a debugger, invisible to
140
+ ;; every printer.
137
141
  (defn make-error-obj
138
142
  ([code msg] (make-error-obj code msg nil))
139
143
  ([code msg ctx]
140
- {:sdk-error true :sdk SDK-NAME :code (or code "") :msg (or msg "")
141
- :ctx ctx :result nil :spec nil}))
144
+ (with-meta {:sdk-error true :sdk SDK-NAME :code (or code "") :msg (or msg "")
145
+ :result nil :spec nil}
146
+ {:ctx ctx})))
142
147
 
143
148
  (defn sdk-error? [x] (and (map? x) (true? (:sdk-error x))))
149
+ (defn err-ctx [e] (when (sdk-error? e) (:ctx (meta e))))
144
150
  (defn err-msg [e]
145
151
  (cond
146
152
  (sdk-error? e) (:msg e)
@@ -332,6 +338,9 @@
332
338
  result (let [r (cprop "result")] (if (some? r) r (bget :result)))
333
339
  response (let [r (cprop "response")] (if (some? r) r (bget :response)))
334
340
  opname (or (cprop "opname") "")
341
+ ;; `:type` metadata routes print-method to the cleaned record (see
342
+ ;; ctx->data): a bare atom prints its whole value, spec and options
343
+ ;; included.
335
344
  ctx (atom {:id (str "C" (+ 10000000 (rand-int 89999999)))
336
345
  :out (atom (vs/jm))
337
346
  :client client :utility utility :ctrl ctrl :meta meta
@@ -340,7 +349,8 @@
340
349
  :data (dmap "data") :reqdata (dmap "reqdata")
341
350
  :match (dmap "match") :reqmatch (dmap "reqmatch")
342
351
  :point point :spec spec :result result :response response
343
- :op nil})]
352
+ :op nil}
353
+ :meta {:type ::context})]
344
354
  (oset! ctx :op (resolve-op ctx opname))
345
355
  ctx))
346
356
 
@@ -430,7 +440,247 @@
430
440
 
431
441
  (def METHOD-MAP {"create" "POST" "update" "PUT" "load" "GET" "list" "GET" "remove" "DELETE" "patch" "PATCH"})
432
442
 
433
- (defn u-clean [_ctx val] val)
443
+ ;; ---------------------------------------------------------------------------
444
+ ;; clean. Everything that leaves the pipeline passes through it; inside, data
445
+ ;; stays raw so a hook can still read the header it must add to. See
446
+ ;; docs/explanation/secret-redaction.md.
447
+ ;; ---------------------------------------------------------------------------
448
+
449
+ (def ^:private CLEAN-MAXDEPTH 32)
450
+ (def ^:private CLEAN-CIRCULAR "[circular]")
451
+ (def ^:private DROP (Object.))
452
+
453
+ (defn- keyname [k] (cond (nil? k) "" (keyword? k) (name k) :else (str k)))
454
+
455
+ (defn- normkey [k] (str/replace (str/lower-case (keyname k)) #"[-_]" ""))
456
+
457
+ (defn- splitkeys [keys]
458
+ (->> (str/split (str (or keys "")) #"\s*,\s*") (map normkey) (remove empty?) vec))
459
+
460
+ (defn splitvalues [values]
461
+ (if (or (vs/islist values) (sequential? values))
462
+ (filterv string? (vec values))
463
+ (->> (str/split (str (or values "")) #"\s*,\s*") (remove empty?) vec)))
464
+
465
+ (defn- count-opt [v dflt]
466
+ (let [n (try (long (Math/floor (Double/parseDouble (str v)))) (catch Exception _ nil))]
467
+ (if (and n (<= 0 n)) n dflt)))
468
+
469
+ ;; The derived clean block: a struct map so it lives in options.__derived__
470
+ ;; and its `values` list stays MUTABLE after make-options - features register
471
+ ;; what they resolve later.
472
+ (defn make-clean-config [cleanopts]
473
+ (let [o (fn [k] (mget cleanopts k))
474
+ keys (vs/jt)]
475
+ (doseq [k (splitkeys (o "keys"))] (.add ^java.util.List keys k))
476
+ (vs/jm "active" (not= false (o "active"))
477
+ "keys" keys
478
+ "values" (vs/jt)
479
+ "mask" (let [m (o "mask")] (if (string? m) m "[redacted]"))
480
+ "hint" (count-opt (o "hint") 0)
481
+ "min" (max 1 (count-opt (o "min") 4)))))
482
+
483
+ ;; A context without options (make-error accepts a bare one) still masks by
484
+ ;; the schema defaults.
485
+ (defn- clean-config [ctx]
486
+ (let [options (when (instance? clojure.lang.IDeref ctx) (oget ctx :options))
487
+ derived (when (vs/ismap options) (vs/getpath options "__derived__.clean"))]
488
+ (if (vs/ismap derived) derived (make-clean-config (vs/getprop @optspec-parsed "clean")))))
489
+
490
+ ;; The encoded forms a value travels in.
491
+ (defn- clean-forms [^String value]
492
+ (let [out (java.util.ArrayList.)
493
+ add (fn [s] (when (and (string? s) (not= "" s) (not (.contains out s))) (.add out s)))]
494
+ (add value)
495
+ (try (add (.encodeToString (java.util.Base64/getEncoder) (.getBytes value "UTF-8"))) (catch Throwable _ nil))
496
+ (try (add (vs/escurl value)) (catch Throwable _ nil))
497
+ (try (let [j (vs/jsonify value)] (add (subs j 1 (dec (count j))))) (catch Throwable _ nil))
498
+ (vec out)))
499
+
500
+ (defn u-clean-add [ctx value]
501
+ (let [cfg (clean-config ctx)
502
+ minlen (long (or (mget cfg "min") 4))
503
+ values (mget cfg "values")]
504
+ (when (and (string? value) (>= (count value) minlen) (instance? java.util.List values))
505
+ (let [changed (atom false)]
506
+ (doseq [form (clean-forms value)]
507
+ (when (and (>= (count form) minlen) (not (.contains ^java.util.List values form)))
508
+ (.add ^java.util.List values form)
509
+ (reset! changed true)))
510
+ ;; Longest first, so a value is never masked by a substring of itself.
511
+ (when @changed
512
+ (let [sorted (sort-by (fn [^String s] (- (count s))) (vec values))]
513
+ (.clear ^java.util.List values)
514
+ (doseq [s sorted] (.add ^java.util.List values s))))))
515
+ nil))
516
+
517
+ (defn- mask-value [cfg ^String value]
518
+ (let [hint (long (or (mget cfg "hint") 0))
519
+ mask (str (mget cfg "mask"))]
520
+ (if (and (pos? hint) (> (count value) (* 2 hint)))
521
+ (str mask (subs value (- (count value) hint)))
522
+ mask)))
523
+
524
+ (defn- clean-string [cfg ^String text]
525
+ (reduce (fn [^String out ^String value]
526
+ (if (.contains out value) (str/replace out value (mask-value cfg value)) out))
527
+ text
528
+ (vec (or (mget cfg "values") []))))
529
+
530
+ (defn- sensitive-key? [cfg key]
531
+ (if (or (nil? key) (number? key))
532
+ false
533
+ (let [^String nk (normkey key)]
534
+ (boolean (some (fn [^String k] (.contains nk k)) (vec (or (mget cfg "keys") [])))))))
535
+
536
+ (defn- number-text [n]
537
+ (if (and (float? n) (== (double n) (Math/floor (double n))) (< (Math/abs (double n)) 9.0E15))
538
+ (str (long n))
539
+ (str n)))
540
+
541
+ ;; Every scalar under a sensitive name, at any depth and of any shape: a
542
+ ;; credential mistyped as a map or a number is still a credential, and the
543
+ ;; validation error that rejects it quotes it.
544
+ (defn u-clean-add-sensitive
545
+ ([ctx val] (u-clean-add-sensitive ctx (clean-config ctx) val false 0 []))
546
+ ([ctx cfg val under depth seen]
547
+ (cond
548
+ (or (nil? val) (<= CLEAN-MAXDEPTH depth)) nil
549
+ (string? val) (when under (u-clean-add ctx val))
550
+ (number? val) (when under (u-clean-add ctx (number-text val)))
551
+ (some #(identical? % val) seen) nil
552
+ (instance? java.util.Map val)
553
+ (let [seen (conj seen val)]
554
+ (doseq [^java.util.Map$Entry e (vec (.entrySet ^java.util.Map val))]
555
+ (u-clean-add-sensitive ctx cfg (.getValue e)
556
+ (or under (sensitive-key? cfg (.getKey e))) (inc depth) seen)))
557
+ (or (instance? java.util.Collection val) (sequential? val))
558
+ (let [seen (conj seen val)]
559
+ (doseq [v (seq val)]
560
+ (u-clean-add-sensitive ctx cfg v under (inc depth) seen)))
561
+ :else nil)))
562
+
563
+ (defn- entity-instance? [v]
564
+ (and (map? v) (instance? clojure.lang.IAtom (:_data v)) (fn? (:get-name v))))
565
+
566
+ ;; A registered value used as a property name is masked like any other
567
+ ;; string; names that mask alike take a counter, so none is lost.
568
+ (defn- clean-name [cfg has? k]
569
+ (let [key (keyname k)
570
+ n (clean-string cfg key)]
571
+ (if (or (= n key) (not (has? n)))
572
+ n
573
+ (loop [i 1]
574
+ (let [c (str n "#" i)]
575
+ (if (has? c) (recur (inc i)) c))))))
576
+
577
+ ;; A masked plain-data COPY (string-keyed struct nodes): an entity serialises
578
+ ;; as its record, an atom-object as its map, functions are dropped, cycles
579
+ ;; cut, and nothing is shared with the live value, whose spec must stay raw.
580
+ (defn- clean-snapshot [cfg val key depth seen]
581
+ (cond
582
+ (nil? val) nil
583
+ (string? val) (if (sensitive-key? cfg key) (mask-value cfg val) (clean-string cfg val))
584
+ (fn? val) DROP
585
+ (or (number? val) (boolean? val) (keyword? val) (symbol? val) (char? val))
586
+ (if (sensitive-key? cfg key) (mget cfg "mask") val)
587
+ (or (<= CLEAN-MAXDEPTH depth) (some #(identical? % val) seen)) CLEAN-CIRCULAR
588
+ (sensitive-key? cfg key) (mget cfg "mask")
589
+ :else
590
+ (let [seen (conj seen val)]
591
+ (cond
592
+ (entity-instance? val) (clean-snapshot cfg (deref (:_data val)) key (inc depth) seen)
593
+ (instance? clojure.lang.IAtom val) (clean-snapshot cfg (deref val) key (inc depth) seen)
594
+ (instance? Throwable val)
595
+ (let [out (vs/jm "message" (clean-string cfg (str (.getMessage ^Throwable val))))]
596
+ (when (instance? clojure.lang.IExceptionInfo val)
597
+ (let [d (clean-snapshot cfg (ex-data val) "data" (inc depth) seen)]
598
+ (when-not (identical? DROP d) (.put ^java.util.Map out "data" d))))
599
+ out)
600
+ (instance? java.util.Map val)
601
+ (let [out (vs/jm)]
602
+ (doseq [^java.util.Map$Entry e (.entrySet ^java.util.Map val)]
603
+ (let [k (.getKey e)
604
+ v (clean-snapshot cfg (.getValue e) k (inc depth) seen)]
605
+ (when-not (identical? DROP v)
606
+ (.put ^java.util.Map out
607
+ (clean-name cfg #(.containsKey ^java.util.Map out %) k) v))))
608
+ out)
609
+ (or (instance? java.util.Collection val) (sequential? val))
610
+ (let [out (vs/jt)]
611
+ (doseq [[i v] (map-indexed vector (seq val))]
612
+ (let [c (clean-snapshot cfg v i (inc depth) seen)]
613
+ (.add ^java.util.List out (if (identical? DROP c) nil c))))
614
+ out)
615
+ :else (clean-string cfg (str val))))))
616
+
617
+ ;; An error map is immutable, so "in place" is a cleaned copy carrying the
618
+ ;; same metadata (the context stays reachable through err-ctx).
619
+ (defn- clean-error [cfg err]
620
+ (with-meta
621
+ (reduce (fn [out [k v]]
622
+ (let [c (clean-snapshot cfg v k 1 [])
623
+ n (clean-name cfg #(contains? out %) k)]
624
+ (assoc out (if (= n (keyname k)) k n) (if (identical? DROP c) nil c))))
625
+ {} err)
626
+ (meta err)))
627
+
628
+ (defn u-clean [ctx val]
629
+ (let [cfg (clean-config ctx)]
630
+ (cond
631
+ (= false (mget cfg "active")) val
632
+ (string? val) (clean-string cfg val)
633
+ (sdk-error? val) (clean-error cfg val)
634
+ :else (let [out (clean-snapshot cfg val nil 0 [])] (if (identical? DROP out) nil out)))))
635
+
636
+ ;; A Throwable is immutable, so one that never passed through make-error (a
637
+ ;; hook's, a fetcher's) leaves as a cleaned copy with the original's trace.
638
+ ;; One carrying the SDK error keeps it, cleaned, under the same key.
639
+ (defn clean-throwable [ctx ^Throwable t]
640
+ (let [cfg (clean-config ctx)]
641
+ (if (= false (mget cfg "active"))
642
+ t
643
+ (let [sdkerr (ex->sdk t)
644
+ out (if (sdk-error? sdkerr)
645
+ (let [e (clean-error cfg sdkerr)]
646
+ (ex-info (err-msg e) {::sdk-error e}))
647
+ (let [data (when (instance? clojure.lang.IExceptionInfo t)
648
+ (clean-snapshot cfg (ex-data t) nil 0 []))]
649
+ (ex-info (clean-string cfg (str (.getMessage t)))
650
+ (if (instance? java.util.Map data) (into {} data) {}))))]
651
+ (.setStackTrace ^Throwable out (.getStackTrace t))
652
+ out))))
653
+
654
+ ;; The error as string-keyed data: jsonify reads a java.util.Map's keys as
655
+ ;; strings, so a keyword-keyed map would serialise as nulls.
656
+ (defn err->data [e]
657
+ (when (sdk-error? e)
658
+ (u-clean (err-ctx e) (into {} (map (fn [[k v]] [(keyname k) v]) e)))))
659
+
660
+ ;; The serialised context leaves the pipeline (a logger, an error dump), so
661
+ ;; it is the cleaned record; the live fields stay raw for the pipeline's use.
662
+ (defn ctx->data [ctx]
663
+ (let [m (deref ctx)
664
+ u (:utility m)
665
+ clean (or (when (instance? clojure.lang.IDeref u) (:clean (deref u))) u-clean)
666
+ entity (:entity m)]
667
+ (clean ctx (vs/jm "id" (:id m) "op" (:op m) "spec" (:spec m)
668
+ "entity" (when (map? entity) (entity-get-name entity))
669
+ "result" (:result m) "response" (:response m) "meta" (:meta m)))))
670
+
671
+ (defmethod print-method ::context [ctx ^java.io.Writer w]
672
+ (.write w (str "#sdk/context " (vs/jsonify (ctx->data ctx) (vs/jm "indent" 0)))))
673
+
674
+ ;; The explain map is the CALLER's, so it is cleaned in place: what they hold
675
+ ;; after the call is the cleaned record. With clean off its result is the live
676
+ ;; result atom, which the prune leaves alone.
677
+ (defn clean-explain! [ctx]
678
+ (when-let [ex (oget (oget ctx :ctrl) :explain)]
679
+ (let [cleaned (ucall ctx :clean ex)]
680
+ (when (and (vs/ismap ex) (vs/ismap cleaned) (not (identical? cleaned ex)))
681
+ (.clear ^java.util.Map ex)
682
+ (.putAll ^java.util.Map ex ^java.util.Map cleaned))
683
+ (let [er (mget ex "result")] (when (vs/ismap er) (vs/delprop er "err"))))))
434
684
 
435
685
  ;; The API definition is authoritative: a POST-only or PATCH-based API
436
686
  ;; exposes `update` as POST or PATCH, not the PUT the op name implies.
@@ -978,16 +1228,22 @@
978
1228
  :else
979
1229
  (do
980
1230
  (oset! spec :step "response")
981
- (ucall ctx :result-basic)
982
- (ucall ctx :result-headers)
983
- (ucall ctx :result-body)
984
- ;; GraphQL reports failures as a top-level `errors` array under
985
- ;; HTTP 200, so result-basic's status check never sees them. Lift
986
- ;; them here, before the response transform tries to unwrap data
987
- ;; that is not there.
988
- (ucall ctx :graphql-errors)
989
- (ucall ctx :transform-response)
990
- (when (nil? (oget result :err)) (oset! result :ok true))
1231
+ ;; A body reader that throws (a non-JSON body) fails the result,
1232
+ ;; as in ts; it must not escape the pipeline with the raw spec
1233
+ ;; still on the explain record.
1234
+ (try
1235
+ (ucall ctx :result-basic)
1236
+ (ucall ctx :result-headers)
1237
+ (ucall ctx :result-body)
1238
+ ;; GraphQL reports failures as a top-level `errors` array under
1239
+ ;; HTTP 200, so result-basic's status check never sees them. Lift
1240
+ ;; them here, before the response transform tries to unwrap data
1241
+ ;; that is not there.
1242
+ (ucall ctx :graphql-errors)
1243
+ (ucall ctx :transform-response)
1244
+ (when (nil? (oget result :err)) (oset! result :ok true))
1245
+ (catch Throwable e
1246
+ (oset! result :err e)))
991
1247
  (when-let [ex (oget (oget ctx :ctrl) :explain)] (.put ^java.util.Map ex "result" result))
992
1248
  [response nil])))))
993
1249
 
@@ -1028,11 +1284,13 @@
1028
1284
  msg (ucall ctx :clean msg0)
1029
1285
  spec (oget ctx :spec)]
1030
1286
  (oset! result :err nil)
1287
+ (clean-explain! ctx)
1031
1288
  (when-let [ex (oget (oget ctx :ctrl) :explain)] (.put ^java.util.Map ex "err" (vs/jm "message" msg)))
1032
- (let [sdk-err (assoc (make-error-obj "" msg ctx)
1289
+ ;; Cleaned COPIES of the result and spec, never the live objects.
1290
+ (let [code (when (sdk-error? err) (ucall ctx :clean (:code err)))
1291
+ sdk-err (assoc (make-error-obj code msg ctx)
1033
1292
  :result (ucall ctx :clean result)
1034
- :spec (ucall ctx :clean spec)
1035
- :code (if (sdk-error? err) (:code err) ""))]
1293
+ :spec (ucall ctx :clean spec))]
1036
1294
  (oset! (oget ctx :ctrl) :err sdk-err)
1037
1295
  ;; Fire PreUnexpected so observability features (metrics, telemetry,
1038
1296
  ;; audit, debug) close/record error paths that never reach PreDone
@@ -1046,15 +1304,11 @@
1046
1304
  (sdk-throw sdk-err))))))
1047
1305
 
1048
1306
  (defn u-done [ctx]
1049
- (let [ctrl (oget ctx :ctrl)]
1050
- (when-let [ex (oget ctrl :explain)]
1051
- (let [cleaned (ucall ctx :clean ex)]
1052
- (oset! ctrl :explain cleaned)
1053
- (let [er (mget cleaned "result")] (when (vs/ismap er) (vs/delprop er "err")))))
1054
- (let [result (oget ctx :result)]
1055
- (if (and result (oget result :ok))
1056
- (oget result :resdata)
1057
- (ucall ctx :make-error nil)))))
1307
+ (clean-explain! ctx)
1308
+ (let [result (oget ctx :result)]
1309
+ (if (and result (oget result :ok))
1310
+ (oget result :resdata)
1311
+ (ucall ctx :make-error nil))))
1058
1312
 
1059
1313
  ;; Public camelCase option key -> the kebab-case keyword naming a utility
1060
1314
  ;; member, or nil when the key is not a public name.
@@ -1073,6 +1327,19 @@
1073
1327
  (fn [[_ c]]
1074
1328
  (clojure.core/str "-" (str/lower-case c))))))))
1075
1329
 
1330
+ ;; A feature's name is not a field name: only the sensitive names inside its
1331
+ ;; settings count, so `secrets` does not make every setting a secret. Entity
1332
+ ;; blocks hold entity settings and seeded records, never a credential.
1333
+ (defn- clean-add-options [ctx opts]
1334
+ (let [noent #(omit-keys % ["entity"])
1335
+ top (dissoc (into {} opts) "feature" "entity")
1336
+ feature (vs/getprop opts "feature")]
1337
+ (u-clean-add-sensitive ctx (cond-> top (contains? top "test") (update "test" noent)))
1338
+ (doseq [fopts (cond (vs/ismap feature) (map #(vs/getprop feature %) (vs/keysof feature))
1339
+ (vs/islist feature) (vec feature)
1340
+ :else [feature])]
1341
+ (u-clean-add-sensitive ctx (noent fopts)))))
1342
+
1076
1343
  (defn u-make-options [ctx]
1077
1344
  (let [options (or (oget ctx :options) (vs/jm))
1078
1345
  custom-utils (vs/getprop options "utility")]
@@ -1137,9 +1404,28 @@
1137
1404
  ;; one of twenty hand-maintained copies of a schema nothing
1138
1405
  ;; cross-checked — so add it to the model instead.
1139
1406
  optspec @optspec-parsed
1407
+ ;; The secret registry exists BEFORE validation, fed from the raw
1408
+ ;; input, so the constructor's own rejection of a mistyped
1409
+ ;; credential is clean too. A shallow merge over the schema
1410
+ ;; defaults: the clean block is flat.
1411
+ cleancfg (make-clean-config
1412
+ (let [out (vs/jm)]
1413
+ (doseq [src [(vs/getprop optspec "clean") (vs/getprop cfgopts "clean")
1414
+ (vs/getprop opts0 "clean")]]
1415
+ (when (vs/ismap src)
1416
+ (doseq [k (vs/keysof src)] (.put ^java.util.Map out k (vs/getprop src k)))))
1417
+ out))
1418
+ cleanctx (atom {:options (vs/jm "__derived__" (vs/jm "clean" cleancfg))})
1419
+ _ (clean-add-options cleanctx (omit-keys opts0 ["clean"]))
1420
+ _ (doseq [raw (concat (splitvalues (vs/getpath cfgopts "clean.values"))
1421
+ (splitvalues (vs/getpath opts0 "clean.values")))]
1422
+ (u-clean-add cleanctx raw))
1140
1423
  sys-fetch (vs/getpath opts0 "system.fetch")
1141
- merged (vs/merge (vs/jt (vs/jm) cfgopts opts0))
1142
- validated (vs/validate merged optspec)
1424
+ ;; Cloned: merge writes through the nested maps of what it reads.
1425
+ merged (vs/merge (vs/jt (vs/jm) (vs/clone cfgopts) opts0))
1426
+ validated (try (vs/validate merged optspec)
1427
+ (catch RuntimeException e
1428
+ (throw (RuntimeException. ^String (u-clean cleanctx (str (.getMessage e)))))))
1143
1429
  opts (if (vs/ismap validated) validated (vs/jm))
1144
1430
  ;; Restore the suppression the optspec default would otherwise erase.
1145
1431
  _ (when auth-suppressed (.put ^java.util.Map opts "auth" nil))
@@ -1179,10 +1465,7 @@
1179
1465
  (when sys-fetch
1180
1466
  (when (not (vs/ismap (vs/getprop opts "system"))) (.put ^java.util.Map opts "system" (vs/jm)))
1181
1467
  (.put ^java.util.Map (vs/getprop opts "system") "fetch" sys-fetch))
1182
- (let [clean-keys (let [k (vs/getpath opts "clean.keys")] (if (string? k) k "key,token,id"))
1183
- parts (->> (str/split clean-keys #",") (map str/trim) (remove empty?) (map vs/escre))
1184
- keyre (str/join "|" parts)
1185
- ;; Resolve the feature add-order: an explicit array order (above)
1468
+ (let [;; Resolve the feature add-order: an explicit array order (above)
1186
1469
  ;; wins; otherwise order the map test-first, then the remaining
1187
1470
  ;; names sorted, so the outcome is deterministic and `test` is
1188
1471
  ;; always the base transport.
@@ -1195,9 +1478,10 @@
1195
1478
  (when (some #(= % "test") names) (.add ^java.util.List order "test"))
1196
1479
  (doseq [n names] (when (not= n "test") (.add ^java.util.List order n)))
1197
1480
  order))
1198
- derived (vs/jm "clean" (if (empty? keyre) (vs/jm) (vs/jm "keyre" keyre))
1199
- "featureorder" feature-order)]
1481
+ derived (vs/jm "clean" cleancfg "featureorder" feature-order)]
1200
1482
  (.put ^java.util.Map opts "__derived__" derived)
1483
+ ;; Again over the merged result: the config's own defaults can carry one.
1484
+ (clean-add-options (atom {:options opts}) (omit-keys opts ["clean" "__derived__"]))
1201
1485
  opts))))
1202
1486
 
1203
1487
  ;; ---------------------------------------------------------------------------
@@ -1258,7 +1542,7 @@
1258
1542
  ;; ---------------------------------------------------------------------------
1259
1543
 
1260
1544
  (defn base-utility-map []
1261
- {:clean u-clean :done u-done :make-error u-make-error
1545
+ {:clean u-clean :clean-add u-clean-add :done u-done :make-error u-make-error
1262
1546
  :feature-add feature-add :feature-hook feature-hook :feature-init feature-init
1263
1547
  :fetcher u-fetcher :make-fetch-def u-make-fetch-def :make-context (fn [cm bc] (make-context cm bc))
1264
1548
  :make-options u-make-options :make-request u-make-request :make-response u-make-response
@@ -69,11 +69,24 @@
69
69
 
70
70
  (defn log-feature []
71
71
  (let [fa (new-feature "log" true "0.0.1")
72
+ ;; A log line leaves the pipeline, so it carries the cleaned record:
73
+ ;; the spec after auth holds the credential, and a logger serialises
74
+ ;; whatever it is handed. `logger` is a fn of the record, a map with
75
+ ;; an "info" fn, or anything else for the stderr default.
72
76
  loghook (fn [ctx hook]
73
- (when (:logger @fa)
74
- (let [opname (if (core/oget ctx :op) (core/op-name (core/oget ctx :op)) "")]
75
- (binding [*out* *err*]
76
- (println (str "[INFO] hook=" hook " op=" opname))))))]
77
+ (when-let [logger (:logger @fa)]
78
+ (let [opname (if (core/oget ctx :op) (core/op-name (core/oget ctx :op)) "")
79
+ record (core/ucall ctx :clean
80
+ (vs/jm "hook" hook "op" opname
81
+ "spec" (core/oget ctx :spec)
82
+ "ctx" (core/ctx->data ctx)))]
83
+ (cond
84
+ (fn? logger) (logger record)
85
+ (and (vs/ismap logger) (fn? (mget logger "info"))) ((mget logger "info") record)
86
+ :else
87
+ (binding [*out* *err*]
88
+ (println (str "[INFO] hook=" hook " op=" opname " "
89
+ (vs/jsonify record (vs/jm "indent" 0)))))))))]
77
90
  (swap! fa assoc
78
91
  "init" (fn [ctx options]
79
92
  (swap! fa assoc :client (core/oget ctx :client) :options options
@@ -779,10 +792,13 @@
779
792
  (bump-bucket! (mget rec "ops") (str entity "." opname) amount)
780
793
  (bump-bucket! (mget rec "actors") (str actor) amount)
781
794
  (swap! fa update :seq (fnil inc 0))
782
- (.put ^java.util.Map rec "last"
783
- (vs/jm "seq" (:seq @fa) "entity" entity "op" opname "actor" (str actor)
784
- "amount" amount "currency" (mget rec "currency")
785
- "source" source "attempts" (mget p "attempts")))))
795
+ (let [last (core/ucall ctx :clean
796
+ (vs/jm "seq" (:seq @fa) "entity" entity "op" opname "actor" (str actor)
797
+ "amount" amount "currency" (mget rec "currency")
798
+ "source" source "attempts" (mget p "attempts")))]
799
+ (.put ^java.util.Map rec "last" last)
800
+ (let [sink (opt fa "sink")]
801
+ (when (fn? sink) (try (sink last) (catch Throwable _ nil)))))))
786
802
  finish! (fn [ctx done]
787
803
  (when (active? fa)
788
804
  (let [id (core/oget ctx :id) p (get (:pending @fa) id)]
@@ -910,9 +926,22 @@
910
926
  (let [made (agent (:url @fa) url)]
911
927
  (.put ^java.util.Map out "dispatcher" made)
912
928
  (.put ^java.util.Map out "agent" made))))
913
- (let [t (track-ensure! fa "_proxy" (vs/jm "routed" 0 "url" (:url @fa)))]
929
+ (let [t (track-ensure! fa "_proxy" (vs/jm "routed" 0 "url" (:clean-url @fa)))]
914
930
  (.put ^java.util.Map t "routed" (inc (long (mget t "routed")))))
915
- out)))]
931
+ out)))
932
+ ;; A proxy URL may carry credentials as userinfo, from the option or
933
+ ;; the environment, and neither is under a sensitive key name.
934
+ register-userinfo! (fn [ctx url]
935
+ (when (string? url)
936
+ (try
937
+ (let [ui (.getRawUserInfo (java.net.URI. ^String url))]
938
+ (when (and ui (seq ui))
939
+ (doseq [part (str/split ui #":" 2)]
940
+ (when (seq part)
941
+ (core/ucall ctx :clean-add part)
942
+ (try (core/ucall ctx :clean-add (java.net.URLDecoder/decode ^String part "UTF-8"))
943
+ (catch Throwable _ nil))))))
944
+ (catch Throwable _ nil))))]
916
945
  (swap! fa assoc
917
946
  "init" (fn [ctx options]
918
947
  (swap! fa assoc :client (core/oget ctx :client)
@@ -928,7 +957,9 @@
928
957
  (vs/islist no-proxy1) (vec no-proxy1)
929
958
  :else [])
930
959
  (remove (fn [s] (or (nil? s) (= s "")))))]
931
- (swap! fa assoc :url url :no-proxy (vec no-proxy)))
960
+ (register-userinfo! ctx url)
961
+ (swap! fa assoc :url url :no-proxy (vec no-proxy)
962
+ :clean-url (if (string? url) (core/ucall ctx :clean url) url)))
932
963
  (wrap-fetcher! ctx (fn [fctx url fd inner] (inner fctx url (route url fd)))))))
933
964
  fa))
934
965
 
@@ -954,11 +985,12 @@
954
985
  (.put ^java.util.Map span "end" (now-ms fa))
955
986
  (.put ^java.util.Map span "durationMs" (max 0 (- (mget span "end") (mget span "start"))))
956
987
  (.put ^java.util.Map span "ok" ok)
957
- (when-let [t (telem)]
958
- (.put ^java.util.Map t "active" (dec (long (mget t "active"))))
959
- (.add ^java.util.List (mget t "spans") span))
960
- (let [exporter (opt fa "exporter")]
961
- (when (fn? exporter) (try (exporter span) (catch Throwable _ nil)))))))]
988
+ (let [out (core/ucall ctx :clean span)]
989
+ (when-let [t (telem)]
990
+ (.put ^java.util.Map t "active" (dec (long (mget t "active"))))
991
+ (.add ^java.util.List (mget t "spans") out))
992
+ (let [exporter (opt fa "exporter")]
993
+ (when (fn? exporter) (try (exporter out) (catch Throwable _ nil))))))))]
962
994
  (swap! fa assoc :spans {} :seq 0)
963
995
  (swap! fa assoc
964
996
  "init" (fn [ctx options]
@@ -1043,19 +1075,18 @@
1043
1075
  ;; debug
1044
1076
  ;; ---------------------------------------------------------------------------
1045
1077
 
1046
- (def REDACT-DEFAULT ["authorization" "cookie" "set-cookie" "api-key" "apikey" "x-api-key" "idempotency-key"])
1047
-
1048
1078
  (defn debug-feature []
1049
1079
  (let [fa (new-feature "debug" false "0.0.1")
1050
- redact (fn [headers]
1080
+ ;; The core clean rules apply (clean.keys, every registered value);
1081
+ ;; the feature's own `redact` list ADDS header names on top of them.
1082
+ redact (fn [ctx headers]
1051
1083
  (if (nil? headers) (vs/jm)
1052
- (let [patterns (or (opt fa "redact") REDACT-DEFAULT)
1053
- pset (into #{} (map str (vec patterns)))
1084
+ (let [pset (into #{} (map (fn [p] (str/lower-case (str p))) (vec (or (opt fa "redact") []))))
1054
1085
  out (vs/jm)]
1055
1086
  (doseq [item (or (vs/items headers) [])]
1056
1087
  (let [k (vs/getprop item 0) v (vs/getprop item 1)]
1057
- (.put ^java.util.Map out k (if (contains? pset (str/lower-case (str k))) "<redacted>" v))))
1058
- out)))
1088
+ (.put ^java.util.Map out k (if (contains? pset (str/lower-case (str k))) "[redacted]" v))))
1089
+ (core/ucall ctx :clean out))))
1059
1090
  finish (fn [ctx ok]
1060
1091
  (let [entry (get (:entries @fa) ctx)]
1061
1092
  (when entry
@@ -1065,12 +1096,18 @@
1065
1096
  (.put ^java.util.Map entry "durationMs" (max 0 (- (now-ms fa) (mget entry "start"))))
1066
1097
  (when (and (nil? (mget entry "status")) result)
1067
1098
  (.put ^java.util.Map entry "status" (core/oget result :status)))
1068
- (let [track (track-ensure! fa "_debug" (vs/jm "entries" (vs/jt)))
1099
+ ;; The whole entry leaves through the buffer and the
1100
+ ;; callback: the url and the error message can carry a
1101
+ ;; query credential the header mask above never saw.
1102
+ (let [entry (core/ucall ctx :clean entry)
1103
+ track (track-ensure! fa "_debug" (vs/jm "entries" (vs/jt)))
1069
1104
  buf (mget track "entries")
1070
1105
  max (opt fa "max" 100)]
1071
1106
  (.add ^java.util.List buf entry)
1072
1107
  (while (> (.size ^java.util.List buf) max) (.remove ^java.util.List buf 0))
1073
- (let [on-entry (opt fa "on_entry")]
1108
+ ;; `onEntry` is the option spec's spelling; the
1109
+ ;; older `on_entry` is kept for callers that used it.
1110
+ (let [on-entry (or (opt fa "onEntry") (opt fa "on_entry"))]
1074
1111
  (when (fn? on-entry) (try (on-entry entry) (catch Throwable _ nil)))))))))]
1075
1112
  (swap! fa assoc :entries {})
1076
1113
  (swap! fa assoc
@@ -1088,7 +1125,7 @@
1088
1125
  method (when spec (core/oget spec :method))
1089
1126
  headers (when spec (core/oget spec :headers))
1090
1127
  entry (vs/jm "op" (str (if op (core/op-entity op) "_") "." (if op (core/op-name op) "_"))
1091
- "method" method "url" url "headers" (redact headers) "start" (now-ms fa)
1128
+ "method" method "url" url "headers" (redact ctx headers) "start" (now-ms fa)
1092
1129
  "status" nil "ok" nil "durationMs" nil "error" nil)]
1093
1130
  (swap! fa update :entries assoc ctx entry))))
1094
1131
  "PreResponse"
@@ -1125,10 +1162,11 @@
1125
1162
  (swap! fa update :seq inc)
1126
1163
  (let [op (core/oget ctx :op)
1127
1164
  result (core/oget ctx :result)
1128
- record (vs/jm "seq" (:seq @fa) "ts" (now-ms fa) "actor" (actor ctx)
1129
- "entity" (if op (core/op-entity op) "_") "op" (if op (core/op-name op) "_")
1130
- "outcome" outcome "status" (when result (core/oget result :status))
1131
- "correlationId" (core/oget ctx :id))
1165
+ record (core/ucall ctx :clean
1166
+ (vs/jm "seq" (:seq @fa) "ts" (now-ms fa) "actor" (actor ctx)
1167
+ "entity" (if op (core/op-entity op) "_") "op" (if op (core/op-name op) "_")
1168
+ "outcome" outcome "status" (when result (core/oget result :status))
1169
+ "correlationId" (core/oget ctx :id)))
1132
1170
  track (track-ensure! fa "_audit" (vs/jm "records" (vs/jt)))
1133
1171
  recs (mget track "records")
1134
1172
  max (opt fa "max" 1000)]
@@ -435,7 +435,9 @@
435
435
  (let [entries (mget (h-track h "_debug") "entries")]
436
436
  (t/is-eq (vs/size entries) 1 "capped")
437
437
  (t/is-eq (count @seen) 2 "2 seen")
438
- (t/is-eq (mget (mget (nth @seen 0) "headers") "authorization") "<redacted>" "redacted")))))
438
+ ;; Masked by the core clean rule (clean.keys), not a
439
+ ;; feature list of its own.
440
+ (t/is-eq (mget (mget (nth @seen 0) "headers") "authorization") "[redacted]" "redacted")))))
439
441
  (check "debug-captures-failures" "debug"
440
442
  (fn [] (when (feature-present? "netsim")
441
443
  (let [h (make-harness [(fspec "netsim" "failTimes" 1 "failStatus" 500) (fspec "debug")])]
@@ -447,7 +449,7 @@
447
449
  (fn [] (let [h (make-harness [(fspec "debug" "now" (fn [] 7) "redact" (vs/jt "x-secret"))])]
448
450
  (h-op h :headers (vs/jm "x-secret" "hide" "x-ok" "show"))
449
451
  (let [entry (vs/getelem (mget (h-track h "_debug") "entries") 0)]
450
- (t/is-eq (mget (mget entry "headers") "x-secret") "<redacted>" "redacted")
452
+ (t/is-eq (mget (mget entry "headers") "x-secret") "[redacted]" "redacted")
451
453
  (t/is-eq (mget (mget entry "headers") "x-ok") "show" "shown")))))
452
454
 
453
455
  ;; ---- audit ----