@voxgig/sdkgen 4.50.0 → 4.52.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 (400) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/dist/cmp/ReadmeExplanation.js +5 -2
  3. package/dist/cmp/ReadmeExplanation.js.map +1 -1
  4. package/dist/cmp/ReadmeFeatures.js +20 -6
  5. package/dist/cmp/ReadmeFeatures.js.map +1 -1
  6. package/dist/helpers/optspec.js +2 -2
  7. package/dist/helpers/optspec.js.map +1 -1
  8. package/dist/tsconfig.tsbuildinfo +1 -1
  9. package/model/sdkgen.aontu +1 -1
  10. package/package.json +1 -1
  11. package/project/.sdk/model/feature/audit.aontu +1 -1
  12. package/project/.sdk/model/feature/cache.aontu +7 -5
  13. package/project/.sdk/model/feature/clienttrack.aontu +1 -1
  14. package/project/.sdk/model/feature/cost.aontu +1 -1
  15. package/project/.sdk/model/feature/debug.aontu +1 -1
  16. package/project/.sdk/model/feature/idempotency.aontu +1 -1
  17. package/project/.sdk/model/feature/log.aontu +1 -1
  18. package/project/.sdk/model/feature/metrics.aontu +3 -1
  19. package/project/.sdk/model/feature/netsim.aontu +1 -1
  20. package/project/.sdk/model/feature/paging.aontu +4 -1
  21. package/project/.sdk/model/feature/proxy.aontu +1 -1
  22. package/project/.sdk/model/feature/ratelimit.aontu +3 -3
  23. package/project/.sdk/model/feature/rbac.aontu +1 -1
  24. package/project/.sdk/model/feature/retry.aontu +1 -1
  25. package/project/.sdk/model/feature/secrets.aontu +1 -1
  26. package/project/.sdk/model/feature/streaming.aontu +1 -1
  27. package/project/.sdk/model/feature/telemetry.aontu +2 -2
  28. package/project/.sdk/model/feature/test.aontu +1 -1
  29. package/project/.sdk/model/feature/timeout.aontu +1 -1
  30. package/project/.sdk/model/feature/validate.aontu +1 -1
  31. package/project/.sdk/model/target/lua.aontu +6 -0
  32. package/project/.sdk/src/cmp/c/Config_c.ts +3 -134
  33. package/project/.sdk/src/cmp/c/TestClean_c.ts +26 -11
  34. package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +17 -10
  35. package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +10 -5
  36. package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -1
  37. package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +15 -1
  38. package/project/.sdk/src/cmp/csharp/TestClean_csharp.ts +9 -0
  39. package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +30 -2
  40. package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +31 -12
  41. package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +13 -4
  42. package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +51 -15
  43. package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +17 -0
  44. package/project/.sdk/src/cmp/go/TestClean_go.ts +39 -3
  45. package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +42 -2
  46. package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +42 -14
  47. package/project/.sdk/src/cmp/java/TestClean_java.ts +17 -4
  48. package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +21 -0
  49. package/project/.sdk/src/cmp/js/ReadmeHowto_js.ts +13 -8
  50. package/project/.sdk/src/cmp/js/TestClean_js.ts +13 -5
  51. package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +26 -2
  52. package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +8 -0
  53. package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +8 -0
  54. package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +8 -0
  55. package/project/.sdk/src/cmp/js/fragment/EntityPatchOp.fragment.js +8 -0
  56. package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +8 -0
  57. package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +8 -0
  58. package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +12 -5
  59. package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +31 -4
  60. package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +19 -0
  61. package/project/.sdk/src/cmp/lua/TestClean_lua.ts +14 -4
  62. package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +42 -5
  63. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +44 -10
  64. package/project/.sdk/src/cmp/lua/utility_lua.ts +2 -1
  65. package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +20 -5
  66. package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +36 -21
  67. package/project/.sdk/src/cmp/perl/TestClean_perl.ts +13 -4
  68. package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +21 -0
  69. package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +31 -12
  70. package/project/.sdk/src/cmp/php/TestClean_php.ts +10 -3
  71. package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +33 -4
  72. package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +13 -6
  73. package/project/.sdk/src/cmp/py/TestClean_py.ts +10 -3
  74. package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +25 -2
  75. package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +26 -12
  76. package/project/.sdk/src/cmp/rb/TestClean_rb.ts +11 -4
  77. package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +23 -2
  78. package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +27 -11
  79. package/project/.sdk/src/cmp/rust/TestClean_rust.ts +24 -17
  80. package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +22 -2
  81. package/project/.sdk/src/cmp/scala/TestClean_scala.ts +45 -11
  82. package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +14 -0
  83. package/project/.sdk/src/cmp/swift/TestClean_swift.ts +31 -21
  84. package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +9 -0
  85. package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +24 -10
  86. package/project/.sdk/src/cmp/ts/ReadmeHowto_ts.ts +13 -8
  87. package/project/.sdk/src/cmp/ts/TestClean_ts.ts +13 -5
  88. package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +26 -2
  89. package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +8 -0
  90. package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +8 -0
  91. package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +8 -0
  92. package/project/.sdk/src/cmp/ts/fragment/EntityPatchOp.fragment.ts +8 -0
  93. package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +8 -0
  94. package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +8 -0
  95. package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +12 -5
  96. package/project/.sdk/src/cmp/zig/TestClean_zig.ts +23 -11
  97. package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +17 -10
  98. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +41 -6
  99. package/project/.sdk/tm/c/core/context.c +1 -0
  100. package/project/.sdk/tm/c/core/sdk.h +7 -4
  101. package/project/.sdk/tm/c/feature/cache.c +243 -13
  102. package/project/.sdk/tm/c/feature/metrics.c +7 -0
  103. package/project/.sdk/tm/c/feature/paging.c +231 -2
  104. package/project/.sdk/tm/c/feature/ratelimit.c +5 -9
  105. package/project/.sdk/tm/c/feature/retry.c +51 -4
  106. package/project/.sdk/tm/c/feature/secrets.c +27 -38
  107. package/project/.sdk/tm/c/feature/streaming.c +2 -1
  108. package/project/.sdk/tm/c/feature/telemetry.c +19 -18
  109. package/project/.sdk/tm/c/feature/test.c +78 -54
  110. package/project/.sdk/tm/c/tests/feature_test.c +288 -0
  111. package/project/.sdk/tm/c/tests/primary_utility_test.c +2 -0
  112. package/project/.sdk/tm/c/utility/clean.c +26 -33
  113. package/project/.sdk/tm/c/utility/make_options.c +89 -17
  114. package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +14 -11
  115. package/project/.sdk/tm/clojure/src/sdk/client.clj +3 -1
  116. package/project/.sdk/tm/clojure/src/sdk/core.clj +50 -22
  117. package/project/.sdk/tm/clojure/src/sdk/features.clj +279 -80
  118. package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +103 -1
  119. package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +1 -0
  120. package/project/.sdk/tm/cpp/Makefile +5 -0
  121. package/project/.sdk/tm/cpp/core/types.hpp +148 -72
  122. package/project/.sdk/tm/cpp/feature/audit.hpp +12 -8
  123. package/project/.sdk/tm/cpp/feature/cache.hpp +188 -9
  124. package/project/.sdk/tm/cpp/feature/metrics.hpp +19 -0
  125. package/project/.sdk/tm/cpp/feature/paging.hpp +160 -2
  126. package/project/.sdk/tm/cpp/feature/ratelimit.hpp +18 -14
  127. package/project/.sdk/tm/cpp/feature/retry.hpp +46 -5
  128. package/project/.sdk/tm/cpp/feature/secrets.hpp +12 -0
  129. package/project/.sdk/tm/cpp/feature/streaming.hpp +2 -1
  130. package/project/.sdk/tm/cpp/feature/telemetry.hpp +17 -10
  131. package/project/.sdk/tm/cpp/feature/test.hpp +63 -53
  132. package/project/.sdk/tm/cpp/test/feature_test.cpp +236 -0
  133. package/project/.sdk/tm/cpp/utility/pipeline.hpp +44 -12
  134. package/project/.sdk/tm/csharp/core/Context.cs +4 -0
  135. package/project/.sdk/tm/csharp/feature/AuditFeature.cs +8 -1
  136. package/project/.sdk/tm/csharp/feature/CacheFeature.cs +126 -12
  137. package/project/.sdk/tm/csharp/feature/MetricsFeature.cs +23 -0
  138. package/project/.sdk/tm/csharp/feature/PagingFeature.cs +130 -3
  139. package/project/.sdk/tm/csharp/feature/RatelimitFeature.cs +26 -19
  140. package/project/.sdk/tm/csharp/feature/RetryFeature.cs +41 -7
  141. package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +9 -27
  142. package/project/.sdk/tm/csharp/feature/StreamingFeature.cs +2 -1
  143. package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +11 -9
  144. package/project/.sdk/tm/csharp/feature/TestFeature.cs +55 -67
  145. package/project/.sdk/tm/csharp/test/FeatureTest.cs +238 -0
  146. package/project/.sdk/tm/csharp/utility/Clean.cs +5 -10
  147. package/project/.sdk/tm/csharp/utility/Fetcher.cs +7 -1
  148. package/project/.sdk/tm/csharp/utility/MakeOptions.cs +94 -24
  149. package/project/.sdk/tm/elixir/lib/projectname/context.ex +2 -0
  150. package/project/.sdk/tm/elixir/lib/projectname/feature/cache.ex +146 -30
  151. package/project/.sdk/tm/elixir/lib/projectname/feature/metrics.ex +13 -0
  152. package/project/.sdk/tm/elixir/lib/projectname/feature/paging.ex +110 -5
  153. package/project/.sdk/tm/elixir/lib/projectname/feature/ratelimit.ex +6 -12
  154. package/project/.sdk/tm/elixir/lib/projectname/feature/retry.ex +33 -9
  155. package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +10 -56
  156. package/project/.sdk/tm/elixir/lib/projectname/feature/streaming.ex +2 -1
  157. package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +7 -7
  158. package/project/.sdk/tm/elixir/lib/projectname/feature/test.ex +52 -48
  159. package/project/.sdk/tm/elixir/lib/projectname/utility.ex +77 -47
  160. package/project/.sdk/tm/elixir/test/feature_test.exs +198 -0
  161. package/project/.sdk/tm/go/core/context.go +6 -0
  162. package/project/.sdk/tm/go/feature/audit_feature.go +1 -3
  163. package/project/.sdk/tm/go/feature/base_feature.go +11 -0
  164. package/project/.sdk/tm/go/feature/cache_feature.go +131 -4
  165. package/project/.sdk/tm/go/feature/metrics_feature.go +14 -0
  166. package/project/.sdk/tm/go/feature/paging_feature.go +108 -2
  167. package/project/.sdk/tm/go/feature/ratelimit_feature.go +19 -17
  168. package/project/.sdk/tm/go/feature/retry_feature.go +81 -9
  169. package/project/.sdk/tm/go/feature/secrets_feature.go +17 -71
  170. package/project/.sdk/tm/go/feature/streaming_feature.go +2 -1
  171. package/project/.sdk/tm/go/feature/telemetry_feature.go +18 -11
  172. package/project/.sdk/tm/go/feature/test_feature.go +65 -55
  173. package/project/.sdk/tm/go/test/feature_corpus_test.go +357 -28
  174. package/project/.sdk/tm/go/test/feature_test.go +93 -0
  175. package/project/.sdk/tm/go/utility/clean.go +5 -7
  176. package/project/.sdk/tm/go/utility/fetcher.go +11 -0
  177. package/project/.sdk/tm/go/utility/make_options.go +116 -13
  178. package/project/.sdk/tm/java/core/Context.java +9 -0
  179. package/project/.sdk/tm/java/core/SdkClient.java +43 -14
  180. package/project/.sdk/tm/java/feature/AuditFeature.java +5 -1
  181. package/project/.sdk/tm/java/feature/CacheFeature.java +123 -17
  182. package/project/.sdk/tm/java/feature/MetricsFeature.java +31 -0
  183. package/project/.sdk/tm/java/feature/PagingFeature.java +156 -2
  184. package/project/.sdk/tm/java/feature/RatelimitFeature.java +15 -13
  185. package/project/.sdk/tm/java/feature/RetryFeature.java +33 -6
  186. package/project/.sdk/tm/java/feature/SecretsFeature.java +9 -92
  187. package/project/.sdk/tm/java/feature/StreamingFeature.java +2 -1
  188. package/project/.sdk/tm/java/feature/TelemetryFeature.java +17 -9
  189. package/project/.sdk/tm/java/feature/TestFeature.java +50 -63
  190. package/project/.sdk/tm/java/test/FeatureCorpusTest.java +309 -17
  191. package/project/.sdk/tm/java/test/FeatureTest.java +60 -0
  192. package/project/.sdk/tm/java/utility/Clean.java +6 -10
  193. package/project/.sdk/tm/java/utility/Fetcher.java +5 -1
  194. package/project/.sdk/tm/java/utility/MakeOptions.java +131 -15
  195. package/project/.sdk/tm/js/src/Context.js +4 -0
  196. package/project/.sdk/tm/js/src/feature/cache/CacheFeature.js +118 -11
  197. package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +3 -2
  198. package/project/.sdk/tm/js/src/feature/metrics/MetricsFeature.js +9 -4
  199. package/project/.sdk/tm/js/src/feature/paging/PagingFeature.js +103 -5
  200. package/project/.sdk/tm/js/src/feature/ratelimit/RatelimitFeature.js +5 -9
  201. package/project/.sdk/tm/js/src/feature/rbac/RbacFeature.js +4 -4
  202. package/project/.sdk/tm/js/src/feature/retry/RetryFeature.js +25 -3
  203. package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +16 -6
  204. package/project/.sdk/tm/js/src/feature/streaming/StreamingFeature.js +2 -1
  205. package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +11 -6
  206. package/project/.sdk/tm/js/src/feature/test/TestFeature.js +38 -1
  207. package/project/.sdk/tm/js/src/feature/validate/ValidateFeature.js +2 -1
  208. package/project/.sdk/tm/js/src/utility/CleanUtility.js +1 -1
  209. package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +61 -12
  210. package/project/.sdk/tm/js/test/feature/Corpus.test.js +191 -23
  211. package/project/.sdk/tm/js/test/feature/harness.js +3 -3
  212. package/project/.sdk/tm/js/test/feature.test.js +14 -1
  213. package/project/.sdk/tm/js/test/pipeline.test.js +1 -1
  214. package/project/.sdk/tm/kotlin/core/Context.kt +3 -0
  215. package/project/.sdk/tm/kotlin/core/SdkClient.kt +23 -10
  216. package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +5 -1
  217. package/project/.sdk/tm/kotlin/feature/CacheFeature.kt +102 -7
  218. package/project/.sdk/tm/kotlin/feature/MetricsFeature.kt +22 -0
  219. package/project/.sdk/tm/kotlin/feature/PagingFeature.kt +125 -2
  220. package/project/.sdk/tm/kotlin/feature/RatelimitFeature.kt +16 -13
  221. package/project/.sdk/tm/kotlin/feature/RetryFeature.kt +36 -14
  222. package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +10 -20
  223. package/project/.sdk/tm/kotlin/feature/StreamingFeature.kt +4 -0
  224. package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +12 -10
  225. package/project/.sdk/tm/kotlin/feature/TestFeature.kt +45 -48
  226. package/project/.sdk/tm/kotlin/test/FeatureTest.kt +173 -0
  227. package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +5 -5
  228. package/project/.sdk/tm/kotlin/utility/Fetcher.kt +4 -0
  229. package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +86 -15
  230. package/project/.sdk/tm/lua/core/context.lua +6 -0
  231. package/project/.sdk/tm/lua/feature/cache_feature.lua +212 -15
  232. package/project/.sdk/tm/lua/feature/debug_feature.lua +2 -3
  233. package/project/.sdk/tm/lua/feature/metrics_feature.lua +5 -0
  234. package/project/.sdk/tm/lua/feature/paging_feature.lua +143 -2
  235. package/project/.sdk/tm/lua/feature/ratelimit_feature.lua +5 -9
  236. package/project/.sdk/tm/lua/feature/retry_feature.lua +43 -5
  237. package/project/.sdk/tm/lua/feature/secrets_feature.lua +15 -80
  238. package/project/.sdk/tm/lua/feature/streaming_feature.lua +2 -1
  239. package/project/.sdk/tm/lua/feature/telemetry_feature.lua +18 -7
  240. package/project/.sdk/tm/lua/feature/test_feature.lua +60 -62
  241. package/project/.sdk/tm/lua/test/feature_test.lua +181 -3
  242. package/project/.sdk/tm/lua/utility/clean.lua +6 -9
  243. package/project/.sdk/tm/lua/utility/fetcher.lua +9 -0
  244. package/project/.sdk/tm/lua/utility/make_options.lua +60 -18
  245. package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +21 -6
  246. package/project/.sdk/tm/ocaml/sdk_features.ml +392 -68
  247. package/project/.sdk/tm/ocaml/sdk_runtime.ml +47 -21
  248. package/project/.sdk/tm/ocaml/sdk_types.ml +2 -0
  249. package/project/.sdk/tm/ocaml/test/t_feature.ml +107 -2
  250. package/project/.sdk/tm/perl/core/context.pm +3 -0
  251. package/project/.sdk/tm/perl/feature/audit_feature.pm +4 -7
  252. package/project/.sdk/tm/perl/feature/cache_feature.pm +111 -15
  253. package/project/.sdk/tm/perl/feature/debug_feature.pm +2 -2
  254. package/project/.sdk/tm/perl/feature/metrics_feature.pm +5 -0
  255. package/project/.sdk/tm/perl/feature/paging_feature.pm +139 -2
  256. package/project/.sdk/tm/perl/feature/ratelimit_feature.pm +5 -11
  257. package/project/.sdk/tm/perl/feature/retry_feature.pm +22 -4
  258. package/project/.sdk/tm/perl/feature/secrets_feature.pm +13 -18
  259. package/project/.sdk/tm/perl/feature/streaming_feature.pm +2 -0
  260. package/project/.sdk/tm/perl/feature/telemetry_feature.pm +17 -8
  261. package/project/.sdk/tm/perl/feature/test_feature.pm +45 -50
  262. package/project/.sdk/tm/perl/t/feature.t +68 -2
  263. package/project/.sdk/tm/perl/t/feature_corpus.t +204 -25
  264. package/project/.sdk/tm/perl/utility/clean.pm +6 -8
  265. package/project/.sdk/tm/perl/utility/fetcher.pm +4 -0
  266. package/project/.sdk/tm/perl/utility/make_options.pm +38 -15
  267. package/project/.sdk/tm/php/core/Context.php +4 -0
  268. package/project/.sdk/tm/php/feature/CacheFeature.php +98 -13
  269. package/project/.sdk/tm/php/feature/MetricsFeature.php +8 -0
  270. package/project/.sdk/tm/php/feature/PagingFeature.php +128 -1
  271. package/project/.sdk/tm/php/feature/RatelimitFeature.php +5 -9
  272. package/project/.sdk/tm/php/feature/RetryFeature.php +27 -3
  273. package/project/.sdk/tm/php/feature/SecretsFeature.php +18 -15
  274. package/project/.sdk/tm/php/feature/StreamingFeature.php +2 -1
  275. package/project/.sdk/tm/php/feature/TelemetryFeature.php +10 -7
  276. package/project/.sdk/tm/php/feature/TestFeature.php +55 -47
  277. package/project/.sdk/tm/php/test/FeatureCorpusTest.php +262 -17
  278. package/project/.sdk/tm/php/test/FeatureTest.php +68 -0
  279. package/project/.sdk/tm/php/utility/Clean.php +3 -10
  280. package/project/.sdk/tm/php/utility/Fetcher.php +8 -3
  281. package/project/.sdk/tm/php/utility/MakeOptions.php +45 -20
  282. package/project/.sdk/tm/py/pkg/core/context.py +4 -0
  283. package/project/.sdk/tm/py/pkg/feature/cache_feature.py +79 -13
  284. package/project/.sdk/tm/py/pkg/feature/metrics_feature.py +7 -0
  285. package/project/.sdk/tm/py/pkg/feature/paging_feature.py +86 -1
  286. package/project/.sdk/tm/py/pkg/feature/ratelimit_feature.py +13 -16
  287. package/project/.sdk/tm/py/pkg/feature/retry_feature.py +31 -6
  288. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +15 -66
  289. package/project/.sdk/tm/py/pkg/feature/streaming_feature.py +2 -1
  290. package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +10 -6
  291. package/project/.sdk/tm/py/pkg/feature/test_feature.py +56 -53
  292. package/project/.sdk/tm/py/pkg/utility/clean.py +4 -10
  293. package/project/.sdk/tm/py/pkg/utility/make_options.py +77 -30
  294. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +23 -9
  295. package/project/.sdk/tm/py/test/test_feature.py +61 -1
  296. package/project/.sdk/tm/py/test/test_feature_corpus.py +197 -17
  297. package/project/.sdk/tm/py-data/pkg/fetch.py +6 -3
  298. package/project/.sdk/tm/py-data/test/test_fetch.py +7 -4
  299. package/project/.sdk/tm/rb/core/context.rb +4 -1
  300. package/project/.sdk/tm/rb/feature/audit_feature.rb +6 -5
  301. package/project/.sdk/tm/rb/feature/cache_feature.rb +75 -11
  302. package/project/.sdk/tm/rb/feature/debug_feature.rb +2 -2
  303. package/project/.sdk/tm/rb/feature/metrics_feature.rb +8 -0
  304. package/project/.sdk/tm/rb/feature/paging_feature.rb +87 -1
  305. package/project/.sdk/tm/rb/feature/ratelimit_feature.rb +12 -16
  306. package/project/.sdk/tm/rb/feature/retry_feature.rb +19 -3
  307. package/project/.sdk/tm/rb/feature/secrets_feature.rb +9 -64
  308. package/project/.sdk/tm/rb/feature/streaming_feature.rb +2 -1
  309. package/project/.sdk/tm/rb/feature/telemetry_feature.rb +11 -6
  310. package/project/.sdk/tm/rb/feature/test_feature.rb +42 -49
  311. package/project/.sdk/tm/rb/test/feature_corpus_test.rb +191 -25
  312. package/project/.sdk/tm/rb/test/feature_test.rb +75 -1
  313. package/project/.sdk/tm/rb/utility/clean.rb +6 -7
  314. package/project/.sdk/tm/rb/utility/fetcher.rb +6 -0
  315. package/project/.sdk/tm/rb/utility/make_options.rb +37 -16
  316. package/project/.sdk/tm/rust/core/context.rs +8 -0
  317. package/project/.sdk/tm/rust/feature/audit.rs +2 -2
  318. package/project/.sdk/tm/rust/feature/cache.rs +120 -3
  319. package/project/.sdk/tm/rust/feature/metrics.rs +24 -1
  320. package/project/.sdk/tm/rust/feature/paging.rs +189 -3
  321. package/project/.sdk/tm/rust/feature/ratelimit.rs +5 -10
  322. package/project/.sdk/tm/rust/feature/retry.rs +59 -6
  323. package/project/.sdk/tm/rust/feature/secrets.rs +36 -98
  324. package/project/.sdk/tm/rust/feature/streaming.rs +3 -2
  325. package/project/.sdk/tm/rust/feature/support.rs +4 -0
  326. package/project/.sdk/tm/rust/feature/telemetry.rs +22 -11
  327. package/project/.sdk/tm/rust/feature/test.rs +63 -57
  328. package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +3 -3
  329. package/project/.sdk/tm/rust/tests/feature_test.rs +274 -0
  330. package/project/.sdk/tm/rust/tests/primary_utility_test.rs +1 -0
  331. package/project/.sdk/tm/rust/utility/clean.rs +35 -43
  332. package/project/.sdk/tm/rust/utility/fetcher.rs +6 -0
  333. package/project/.sdk/tm/rust/utility/make_options.rs +130 -38
  334. package/project/.sdk/tm/scala/core/Context.scala +4 -0
  335. package/project/.sdk/tm/scala/core/SdkClient.scala +45 -11
  336. package/project/.sdk/tm/scala/feature/AuditFeature.scala +6 -1
  337. package/project/.sdk/tm/scala/feature/CacheFeature.scala +117 -11
  338. package/project/.sdk/tm/scala/feature/MetricsFeature.scala +31 -1
  339. package/project/.sdk/tm/scala/feature/PagingFeature.scala +122 -2
  340. package/project/.sdk/tm/scala/feature/RatelimitFeature.scala +14 -11
  341. package/project/.sdk/tm/scala/feature/RetryFeature.scala +29 -7
  342. package/project/.sdk/tm/scala/feature/SecretsFeature.scala +11 -24
  343. package/project/.sdk/tm/scala/feature/StreamingFeature.scala +2 -1
  344. package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +12 -10
  345. package/project/.sdk/tm/scala/feature/TestFeature.scala +44 -44
  346. package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +69 -0
  347. package/project/.sdk/tm/scala/utility/Fetcher.scala +5 -0
  348. package/project/.sdk/tm/scala/utility/Make.scala +99 -14
  349. package/project/.sdk/tm/scala/utility/Misc.scala +5 -8
  350. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +3 -0
  351. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +3 -2
  352. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CacheFeature.swift +122 -11
  353. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/MetricsFeature.swift +20 -0
  354. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/PagingFeature.swift +102 -2
  355. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RatelimitFeature.swift +19 -13
  356. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/RetryFeature.swift +40 -5
  357. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +9 -13
  358. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/StreamingFeature.swift +2 -1
  359. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +11 -9
  360. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TestFeature.swift +55 -49
  361. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Fetcher.swift +4 -0
  362. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +56 -17
  363. package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +4 -5
  364. package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +166 -0
  365. package/project/.sdk/tm/ts/src/Context.ts +4 -0
  366. package/project/.sdk/tm/ts/src/feature/cache/CacheFeature.ts +115 -4
  367. package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +3 -2
  368. package/project/.sdk/tm/ts/src/feature/metrics/MetricsFeature.ts +6 -1
  369. package/project/.sdk/tm/ts/src/feature/paging/PagingFeature.ts +103 -5
  370. package/project/.sdk/tm/ts/src/feature/ratelimit/RatelimitFeature.ts +5 -9
  371. package/project/.sdk/tm/ts/src/feature/rbac/RbacFeature.ts +4 -4
  372. package/project/.sdk/tm/ts/src/feature/retry/RetryFeature.ts +25 -3
  373. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +14 -2
  374. package/project/.sdk/tm/ts/src/feature/streaming/StreamingFeature.ts +2 -1
  375. package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +11 -6
  376. package/project/.sdk/tm/ts/src/feature/test/TestFeature.ts +8 -7
  377. package/project/.sdk/tm/ts/src/feature/validate/ValidateFeature.ts +2 -1
  378. package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +1 -1
  379. package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +63 -12
  380. package/project/.sdk/tm/ts/test/feature/Corpus.test.ts +192 -23
  381. package/project/.sdk/tm/ts/test/feature/harness.ts +3 -3
  382. package/project/.sdk/tm/ts/test/feature.test.ts +14 -1
  383. package/project/.sdk/tm/ts/test/pipeline.test.ts +1 -1
  384. package/project/.sdk/tm/zig/core/context.zig +5 -0
  385. package/project/.sdk/tm/zig/core/utility.zig +118 -17
  386. package/project/.sdk/tm/zig/feature/cache.zig +144 -13
  387. package/project/.sdk/tm/zig/feature/metrics.zig +19 -0
  388. package/project/.sdk/tm/zig/feature/paging.zig +172 -4
  389. package/project/.sdk/tm/zig/feature/ratelimit.zig +5 -11
  390. package/project/.sdk/tm/zig/feature/retry.zig +41 -3
  391. package/project/.sdk/tm/zig/feature/secrets.zig +6 -1
  392. package/project/.sdk/tm/zig/feature/streaming.zig +2 -0
  393. package/project/.sdk/tm/zig/feature/telemetry.zig +15 -9
  394. package/project/.sdk/tm/zig/feature/test.zig +56 -40
  395. package/project/.sdk/tm/zig/test/feature_test.zig +174 -0
  396. package/project/.sdk/tm/zig/test/primary_utility_test.zig +2 -0
  397. package/project/sdkgen-package.json +1 -1
  398. package/src/cmp/ReadmeExplanation.ts +5 -2
  399. package/src/cmp/ReadmeFeatures.ts +21 -6
  400. package/src/helpers/optspec.ts +2 -2
@@ -211,7 +211,7 @@ main: kit: feature: &: {
211
211
 
212
212
  config: {
213
213
  optspec: &: top
214
- strict: *false | boolean
214
+ strict: *true | boolean
215
215
  }
216
216
 
217
217
  plugin: &: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxgig/sdkgen",
3
- "version": "4.50.0",
3
+ "version": "4.52.0",
4
4
  "main": "dist/sdkgen.js",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -11,7 +11,7 @@ main: kit: feature: audit: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  actor: 'anonymous'
16
16
  # maximum retained records
17
17
  max: 1000
@@ -3,7 +3,7 @@ main: kit: feature: cache: {
3
3
 
4
4
  name: key()
5
5
  title: "Response cache"
6
- description: "Response caching for safe read requests"
6
+ description: "Per-client response caching for safe read requests"
7
7
  version: '0.0.1'
8
8
  active: true
9
9
  base: 'BASE'
@@ -11,17 +11,19 @@ main: kit: feature: cache: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
15
- # time-to-live in milliseconds
14
+ active: *false | boolean
15
+ # time-to-live in milliseconds; a response's Cache-Control max-age caps it
16
16
  ttl: 5000
17
- # maximum cached entries (oldest evicted)
17
+ # maximum cached entries in this client's store (oldest evicted)
18
18
  max: 256
19
- # cacheable request methods
19
+ # cacheable request methods; any other but GET and HEAD is a write, which
20
+ # drops its own path, everything under it and its parent path's entry
20
21
  methods: ['GET']
21
22
  }
22
23
  }
23
24
 
24
25
  # Cache wraps the transport in init(); it dispatches no pipeline hooks.
26
+ # The key is the method, the URL and a keyed digest of the request headers.
25
27
  hook: {}
26
28
  }
27
29
 
@@ -11,7 +11,7 @@ main: kit: feature: clienttrack: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  clientVersion: '0.0.1'
16
16
  }
17
17
  }
@@ -15,7 +15,7 @@ main: kit: feature: cost: {
15
15
 
16
16
  config: {
17
17
  options: {
18
- active: false
18
+ active: *false | boolean
19
19
  currency: 'USD'
20
20
  unit: 0
21
21
  rates: {}
@@ -11,7 +11,7 @@ main: kit: feature: debug: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  # maximum retained entries
16
16
  max: 100
17
17
  # header names masked in captured traces IN ADDITION to the SDK's own
@@ -11,7 +11,7 @@ main: kit: feature: idempotency: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  header: 'Idempotency-Key'
16
16
  methods: ['POST', 'PUT', 'PATCH', 'DELETE']
17
17
  ops: ['create', 'update', 'remove']
@@ -11,7 +11,7 @@ main: kit: feature: log: {
11
11
 
12
12
 
13
13
  config: {
14
- options: active: true
14
+ options: active: *false | boolean
15
15
  }
16
16
 
17
17
  hook: {
@@ -11,7 +11,7 @@ main: kit: feature: metrics: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  }
16
16
  }
17
17
 
@@ -26,4 +26,6 @@ main: kit: feature: metrics: {
26
26
  main: kit: feature: metrics: config: optspec: {
27
27
  # injected clock, for deterministic durations
28
28
  now: '`$FUNCTION`'
29
+ # receives a copy of the counters after each operation
30
+ sink: '`$FUNCTION`'
29
31
  }
@@ -11,7 +11,7 @@ main: kit: feature: netsim: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  latency: 0
16
16
  failTimes: 0
17
17
  failStatus: 503
@@ -11,12 +11,15 @@ main: kit: feature: paging: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  pageParam: 'page'
16
16
  limitParam: 'limit'
17
17
  cursorParam: 'cursor'
18
18
  startPage: 1
19
19
 
20
+ # how a body `next` is read: 'auto', 'cursor' or 'url'
21
+ next: 'auto'
22
+
20
23
  # GraphQL (relay) list ops paginate through operation variables
21
24
  # rather than query parameters. These name the variables to bind;
22
25
  # the cursor/hasMore response paths come from the model's per-op
@@ -11,7 +11,7 @@ main: kit: feature: proxy: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  # proxy URL, e.g. 'http://proxy.internal:8080' ('' = use env when fromEnv)
16
16
  url: ''
17
17
  # read HTTPS_PROXY / HTTP_PROXY / NO_PROXY from the environment
@@ -11,11 +11,9 @@ main: kit: feature: ratelimit: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  # tokens per second
16
16
  rate: 5
17
- # bucket capacity (defaults to `rate` when unset)
18
- burst: 5
19
17
  }
20
18
  }
21
19
 
@@ -25,6 +23,8 @@ main: kit: feature: ratelimit: {
25
23
 
26
24
 
27
25
  main: kit: feature: ratelimit: config: optspec: {
26
+ # bucket capacity; `rate` when unset
27
+ burst: '`$NUMBER`'
28
28
  # injected clock
29
29
  now: '`$FUNCTION`'
30
30
  # injected delay, so a test need not really wait
@@ -11,7 +11,7 @@ main: kit: feature: rbac: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  # permissions the client holds ('*' grants everything)
16
16
  permissions: []
17
17
  # required permission keyed by '<entity>.<op>', '<op>', or '*'
@@ -12,7 +12,7 @@ main: kit: feature: retry: {
12
12
  config: {
13
13
  # Opt-in: enable per SDK via options.feature.retry.active = true
14
14
  options: {
15
- active: false
15
+ active: *false | boolean
16
16
  retries: 2
17
17
  minDelay: 50
18
18
  maxDelay: 2000
@@ -907,7 +907,7 @@ main: kit: feature: secrets: {
907
907
 
908
908
  config: {
909
909
  options: {
910
- active: false
910
+ active: *false | boolean
911
911
 
912
912
  # The sekreto provider chain, in first-hit order. Each entry is a
913
913
  # sekreto ProviderSpec ({ kind, name, ... }) or a provider object.
@@ -11,7 +11,7 @@ main: kit: feature: streaming: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  # simulate paced delivery (ms between chunks) — mainly for tests
16
16
  chunkDelay: 0
17
17
  # group items into batches of this size (0 = one item per step)
@@ -11,7 +11,7 @@ main: kit: feature: telemetry: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  }
16
16
  }
17
17
 
@@ -29,7 +29,7 @@ main: kit: feature: telemetry: config: optspec: {
29
29
  exporter: '`$FUNCTION`'
30
30
  # extra headers merged into the propagated context
31
31
  headers: '`$MAP`'
32
- # supplies trace and span ids
32
+ # supplies trace and span ids in place of random W3C ones
33
33
  idgen: '`$FUNCTION`'
34
34
  # injected clock
35
35
  now: '`$FUNCTION`'
@@ -11,7 +11,7 @@ main: kit: feature: test: {
11
11
 
12
12
  config: {
13
13
  # Test mode is off until a client activates it
14
- options: active: false
14
+ options: active: *false | boolean
15
15
  }
16
16
 
17
17
  hook: {
@@ -11,7 +11,7 @@ main: kit: feature: timeout: {
11
11
 
12
12
  config: {
13
13
  options: {
14
- active: false
14
+ active: *false | boolean
15
15
  ms: 30000
16
16
  }
17
17
  }
@@ -13,7 +13,7 @@ main: kit: feature: validate: {
13
13
 
14
14
  config: {
15
15
  options: {
16
- active: false
16
+ active: *false | boolean
17
17
 
18
18
  request: true
19
19
 
@@ -34,6 +34,12 @@ main: kit: feature: &: target: lua: deps: &: {
34
34
  }
35
35
 
36
36
 
37
+ main: kit: target: lua: feature: {
38
+ trim: true
39
+ fullset: ['test/feature_test.lua']
40
+ }
41
+
42
+
37
43
  main: kit: target: lua: publish: {
38
44
  registry: {
39
45
  name: 'luarocks'
@@ -92,11 +92,10 @@ FEATURE_TEST_SRCS += $(wildcard tests/feature/${fname}/*.c)
92
92
  Content(`
93
93
  # A plugin group is active: the selected kinds and the five shared helpers
94
94
  # they call (the socket HTTP client and its OpenSSL binding, the encoders,
95
- # the clock and the child-process launcher), with the two external
96
- # libraries they bring - OpenSSL for the vault kinds' TLS, libcurl for the
97
- # token-exchange transport of last resort in kinds.c.
95
+ # the clock and the child-process launcher), with the external library they
96
+ # bring - OpenSSL for the vault kinds' TLS.
98
97
  FEATURE_SRCS += $(wildcard feature/${fname}/plugins/*.c)
99
- LDLIBS += -lssl -lcrypto -lcurl
98
+ LDLIBS += -lssl -lcrypto
100
99
  `)
101
100
  }
102
101
  })
@@ -138,136 +137,6 @@ ${syms.map((sym: string, i: number) => ` ${fname.toUpperCase()}_KINDS[${i}] = $
138
137
  return ${fname.toUpperCase()}_KINDS;
139
138
  }
140
139
  `}`)
141
-
142
- if ('secrets' !== fname) return
143
-
144
- if (0 === groups) {
145
- Content(`
146
- // THE EXCHANGE TRANSPORT OF LAST RESORT, when no plugin group is active: the
147
- // SDK's own client (utility/http.c), called directly rather than through
148
- // the transport this feature wraps, which the token request must never pass
149
- // back through. Reached only by an exchange whose caller supplied no
150
- // system.fetch; a chain that resolves a static credential never comes here.
151
- voxgig_value* secrets_rawfetch(Context* ctx, const char* url,
152
- voxgig_value* fetchdef, PNError** err) {
153
- return http_fetch(ctx, url, fetchdef, err);
154
- }
155
- `)
156
- return
157
- }
158
-
159
- Content(`
160
- // THE EXCHANGE TRANSPORT OF LAST RESORT (go's rawExchangeFetch): plain
161
- // libcurl, answering the same transport-shaped map the system.fetch seam
162
- // promises ({status, statusText, headers, json(), body}). It exists so an
163
- // exchange works with ordinary SDK options - requiring a custom transport
164
- // for the COMMON case would refuse every live token purchase before a
165
- // request was made. Deliberately NOT the SDK transport: that is what the
166
- // secrets feature wraps, and sending the token request back through it
167
- // would recurse on the first expiry.
168
- //
169
- // libcurl is linked because a plugin group is active in this model; the
170
- // Makefile adds -lcurl on exactly that condition.
171
-
172
- #include <curl/curl.h>
173
-
174
- typedef struct {
175
- char* data;
176
- size_t len;
177
- } SecretsBuf;
178
-
179
- static size_t secrets_curl_write(char* ptr, size_t size, size_t nmemb, void* ud) {
180
- SecretsBuf* b = (SecretsBuf*)ud;
181
- size_t add = size * nmemb;
182
- char* grown = (char*)realloc(b->data, b->len + add + 1);
183
- if (NULL == grown) return 0;
184
- b->data = grown;
185
- memcpy(b->data + b->len, ptr, add);
186
- b->len += add;
187
- b->data[b->len] = '\\0';
188
- return add;
189
- }
190
-
191
- voxgig_value* secrets_rawfetch(Context* ctx, const char* url,
192
- voxgig_value* fetchdef, PNError** err) {
193
- static bool inited = false;
194
- *err = NULL;
195
- if (!inited) {
196
- curl_global_init(CURL_GLOBAL_DEFAULT);
197
- inited = true;
198
- }
199
-
200
- CURL* curl = curl_easy_init();
201
- if (NULL == curl) {
202
- *err = context_make_error(ctx, "secrets_transport", "secrets: curl_easy_init failed");
203
- return NULL;
204
- }
205
-
206
- const char* method = get_str(fetchdef, "method");
207
- if (NULL == method || '\\0' == method[0]) method = "POST";
208
-
209
- struct curl_slist* hdrs = NULL;
210
- voxgig_value* headers = getp(fetchdef, "headers");
211
- if (voxgig_is_map(headers)) {
212
- voxgig_map* hm = voxgig_as_map(headers);
213
- for (size_t i = 0; i < hm->len; i++) {
214
- if (!voxgig_is_string(hm->entries[i].value)) continue;
215
- size_t klen = strlen(hm->entries[i].key);
216
- const char* v = voxgig_as_string(hm->entries[i].value);
217
- char* line = (char*)malloc(klen + 2 + strlen(v) + 1);
218
- sprintf(line, "%s: %s", hm->entries[i].key, v);
219
- hdrs = curl_slist_append(hdrs, line);
220
- free(line);
221
- }
222
- }
223
-
224
- SecretsBuf body = {NULL, 0};
225
- curl_easy_setopt(curl, CURLOPT_URL, url);
226
- curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, method);
227
- curl_easy_setopt(curl, CURLOPT_HTTPHEADER, hdrs);
228
- curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
229
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 0L);
230
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, secrets_curl_write);
231
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
232
- const char* reqbody = get_str(fetchdef, "body");
233
- if (NULL != reqbody) {
234
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, reqbody);
235
- }
236
-
237
- CURLcode rc = curl_easy_perform(curl);
238
- long status = 0;
239
- // Where a redirect points, resolved by curl, which follows none.
240
- voxgig_value* rheaders = v_map();
241
- if (CURLE_OK == rc) {
242
- char* location = NULL;
243
- curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &status);
244
- curl_easy_getinfo(curl, CURLINFO_REDIRECT_URL, &location);
245
- if (NULL != location) setp(rheaders, "location", v_str(location));
246
- }
247
- curl_slist_free_all(hdrs);
248
- curl_easy_cleanup(curl);
249
-
250
- if (CURLE_OK != rc) {
251
- char msg[512];
252
- snprintf(msg, sizeof(msg), "secrets: token exchange transport failed: %s (URL was: \\"%s\\")",
253
- curl_easy_strerror(rc), url);
254
- free(body.data);
255
- *err = context_make_error(ctx, "secrets_transport", msg);
256
- return NULL;
257
- }
258
-
259
- const char* text = body.data ? body.data : "";
260
- voxgig_value* parsed = json_parse(text);
261
- voxgig_value* out = cmap(5,
262
- "status", v_num((double)status),
263
- "statusText", v_str(status >= 400 ? "ERR" : "OK"),
264
- "headers", rheaders,
265
- "json", json_thunk(parsed),
266
- "body", v_str(text));
267
- free(body.data);
268
- return out;
269
- }
270
- `)
271
140
  })
272
141
  })
273
142
  }
@@ -839,18 +839,16 @@ int main(void) {
839
839
  // out whichever name prepare_auth placed.
840
840
  drive(make_sdk_with(SC_OK, NULL, NULL, cmap(1, "name", v_str("zzcred"))), op, NULL);
841
841
 
842
- // A credential mistyped as a map. The C validator defaults rather than
843
- // rejects, so what the constructor produced is swept instead: a string
844
- // quoting the value, cleaned the way a validation message is.
845
- ${Name}SDK* mistyped = ${ident}_sdk_new(offline(cmap(2,
842
+ // A credential mistyped as a map is rejected by validation, whose message
843
+ // quotes the value it rejected.
844
+ PNError* rejected = NULL;
845
+ ${Name}SDK* refused = ${ident}_sdk_new(offline(cmap(2,
846
846
  "apikey", cmap(1, "value", v_str(CANARY_APIKEY)),
847
+ "clean", cmap(1, "values", v_str(CANARY_VALUE)))), &rejected);
848
+ CHECK(NULL == refused && NULL != rejected, "a credential mistyped as a map should be rejected");
849
+ if (rejected) push_error("rejected", rejected);
850
+ ${Name}SDK* mistyped = ${ident}_sdk_new(offline(cmap(1,
847
851
  "clean", cmap(1, "values", v_str(CANARY_VALUE)))), NULL);
848
- {
849
- char quoted[256];
850
- snprintf(quoted, sizeof(quoted), "apikey: expected string, got {\\"value\\":\\"%s\\"}",
851
- CANARY_APIKEY);
852
- push("mistyped:quoted", clean_str(sdk_get_root_ctx(mistyped), quoted));
853
- }
854
852
 
855
853
  // An error a feature hook raises, quoting the request, with explain on.
856
854
  Feature* thrower = (Feature*)calloc(1, sizeof(CaptureFeature));
@@ -910,6 +908,20 @@ int main(void) {
910
908
  "a transport failure should fail direct()");
911
909
  push_value("direct", direct);
912
910
 
911
+ // The clean registry holds every credential in plain form, and is no option.
912
+ {
913
+ voxgig_value* held = sdk_options_map(${ident}_sdk_new(offline(cmap(1,
914
+ "apikey", v_str(CANARY_APIKEY))), NULL));
915
+ char* heldjson = voxgig_jsonify(held, NULL);
916
+ CHECK_STR_EQ(header(held, "apikey"), CANARY_APIKEY, "options_map keeps the caller's apikey");
917
+ char* at = strstr(heldjson, CANARY_APIKEY);
918
+ if (at) memmove(at, at + strlen(CANARY_APIKEY), strlen(at + strlen(CANARY_APIKEY)) + 1);
919
+ char heldfound[4096];
920
+ CHECK(0 == leaks(heldjson, heldfound, sizeof(heldfound)),
921
+ "options_map carries a credential beyond the option the caller set");
922
+ if (heldfound[0]) fprintf(stderr, "options_map: [%s]\\n", heldfound);
923
+ }
924
+
913
925
  size_t nleaks = 0;
914
926
  char found[4096];
915
927
  for (size_t i = 0; i < NSINKS; i++) {
@@ -1033,13 +1045,16 @@ int main(void) {
1033
1045
  // name and id, is not read at all, and nor are rbac's rules, keyed by entity
1034
1046
  // and operation names.
1035
1047
  {
1048
+ voxgig_value* providers = v_list();
1049
+ voxgig_list_push(voxgig_as_list(providers),
1050
+ cmap(2, "name", v_str("static"), "token", v_str("ZZTOKEN-feat456")));
1036
1051
  ${Name}SDK* featured = ${ident}_sdk_new(offline(cmap(3,
1037
1052
  "apikey", v_str(CANARY_APIKEY),
1038
1053
  "feature", cmap(3,
1039
1054
  "secrets", cmap(3,
1040
1055
  "active", v_bool(false),
1041
1056
  "name", v_str("ZZNAME-feat123"),
1042
- "token", v_str("ZZTOKEN-feat456")),
1057
+ "providers", providers),
1043
1058
  "rbac", cmap(2,
1044
1059
  "active", v_bool(false),
1045
1060
  "rules", cmap(1, "zztoken.load", v_str("PLAINRULE-k7j5h3g1"))),
@@ -72,6 +72,13 @@ Entity* entyvar_entity_new(ProjectNameSDK* client, voxgig_value* entopts) {
72
72
  return (Entity*)self;
73
73
  }
74
74
 
75
+ // A failed step leaves through make_error, then PreDone, which it skipped.
76
+ static voxgig_value* entyvar_failed(Context* ctx, PNError* e, PNError** err) {
77
+ voxgig_value* out = make_error_util(ctx, e, err);
78
+ feature_hook_util(ctx, "PreDone");
79
+ return out;
80
+ }
81
+
75
82
  // Pipeline: make_point -> make_spec -> make_request -> make_response ->
76
83
  // make_result -> post_done -> done. Feature hooks fire between stages.
77
84
  static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
@@ -83,31 +90,31 @@ static voxgig_value* entyvar_run_op(entyvar_entity* self, Context* ctx,
83
90
  // #PrePoint-Hook
84
91
 
85
92
  voxgig_value* point = make_point_util(ctx, &e);
86
- if (e) return make_error_util(ctx, e, err);
93
+ if (e) return entyvar_failed(ctx, e, err);
87
94
  ctx_out_set_point_val(ctx, point);
88
95
 
89
96
  // #PreSpec-Hook
90
97
 
91
98
  Spec* spec = make_spec_util(ctx, &e);
92
- if (e) return make_error_util(ctx, e, err);
99
+ if (e) return entyvar_failed(ctx, e, err);
93
100
  ctx->out_spec = spec;
94
101
 
95
102
  // #PreRequest-Hook
96
103
 
97
104
  Response* resp = make_request_util(ctx, &e);
98
- if (e) return make_error_util(ctx, e, err);
105
+ if (e) return entyvar_failed(ctx, e, err);
99
106
  ctx->out_request = resp;
100
107
 
101
108
  // #PreResponse-Hook
102
109
 
103
110
  Response* resp2 = make_response_util(ctx, &e);
104
- if (e) return make_error_util(ctx, e, err);
111
+ if (e) return entyvar_failed(ctx, e, err);
105
112
  ctx->out_response = resp2;
106
113
 
107
114
  // #PreResult-Hook
108
115
 
109
116
  SdkResult* result = make_result_util(ctx, &e);
110
- if (e) return make_error_util(ctx, e, err);
117
+ if (e) return entyvar_failed(ctx, e, err);
111
118
  ctx->out_result = result;
112
119
 
113
120
  // #PreDone-Hook
@@ -176,27 +183,27 @@ voxgig_value* entyvar_stream(Entity* e, const char* action, voxgig_value* args,
176
183
 
177
184
  feature_hook_util(ctx, "PrePoint");
178
185
  voxgig_value* point = make_point_util(ctx, &pe);
179
- if (pe) return entyvar_stream_items(make_error_util(ctx, pe, err), err);
186
+ if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
180
187
  ctx_out_set_point_val(ctx, point);
181
188
 
182
189
  feature_hook_util(ctx, "PreSpec");
183
190
  Spec* spec = make_spec_util(ctx, &pe);
184
- if (pe) return entyvar_stream_items(make_error_util(ctx, pe, err), err);
191
+ if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
185
192
  ctx->out_spec = spec;
186
193
 
187
194
  feature_hook_util(ctx, "PreRequest");
188
195
  Response* resp = make_request_util(ctx, &pe);
189
- if (pe) return entyvar_stream_items(make_error_util(ctx, pe, err), err);
196
+ if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
190
197
  ctx->out_request = resp;
191
198
 
192
199
  feature_hook_util(ctx, "PreResponse");
193
200
  Response* resp2 = make_response_util(ctx, &pe);
194
- if (pe) return entyvar_stream_items(make_error_util(ctx, pe, err), err);
201
+ if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
195
202
  ctx->out_response = resp2;
196
203
 
197
204
  feature_hook_util(ctx, "PreResult");
198
205
  SdkResult* result = make_result_util(ctx, &pe);
199
- if (pe) return entyvar_stream_items(make_error_util(ctx, pe, err), err);
206
+ if (pe) return entyvar_stream_items(entyvar_failed(ctx, pe, err), err);
200
207
  ctx->out_result = result;
201
208
 
202
209
  feature_hook_util(ctx, "PreDone");
@@ -432,9 +432,8 @@ ${candidates(entity)}
432
432
  ;; The generated config's own clean block is read beside the
433
433
  ;; caller's, and is not changed by it.
434
434
  (let [config (vs/jm "options" (vs/jm "clean" (vs/jm "keys" "zzsens" "values" (:config CANARY))))
435
- built (core/u-make-options
436
- (atom {:config config :options (vs/jm "clean" (vs/jm "values" (:value CANARY)))}))
437
- cfgctx (atom {:options built})
435
+ cfgctx (atom {:config config :options (vs/jm "clean" (vs/jm "values" (:value CANARY)))})
436
+ _ (core/oset! cfgctx :options (core/u-make-options cfgctx))
438
437
  seeded (core/u-clean cfgctx (str "config " (:config CANARY) " caller " (:value CANARY)))]
439
438
  (swap! sinks conj {:name "config-clean" :text (str seeded)})
440
439
  (t/is-eq seeded (str "config " MASK " caller " MASK) "the config's clean values are registered")
@@ -465,6 +464,12 @@ ${candidates(entity)}
465
464
  :record (core/u-clean root "record PLAINRECORD-t5r3e1w9")
466
465
  :alias (core/u-clean root "alias PLAINALIAS-m2n4b6v8")
467
466
  :rule (core/u-clean root "rule PLAINRULE-k7j5h3g1")}))
467
+ ;; The clean registry holds every credential in plain form, and is no option.
468
+ (let [held (core/client-options-map (construct (vs/jm "apikey" (:apikey CANARY))))
469
+ text (pr-str held)]
470
+ (t/is-eq (vs/getprop held "apikey") (:apikey CANARY) "options-map keeps the caller's apikey")
471
+ (t/is-eq (leaks (str/replace-first text (:apikey CANARY) "")) []
472
+ (str "options-map carries a credential beyond the option the caller set: " text)))
468
473
  (let [leaked (filterv (fn [s] (seq (leaks (:text s)))) @sinks)]
469
474
  (println (str "clean: swept " (count @sinks) " surface(s), " (count leaked) " leak(s)"))
470
475
  (t/is-eq (count leaked) 0
@@ -531,7 +536,7 @@ ${candidates(entity)}
531
536
  (t/run-check rec "clean-a-registered-value-used-as-a-property-name"
532
537
  (fn []
533
538
  (let [cfg (core/make-clean-config (vs/jm "keys" "key,secret,token"))
534
- ctx (atom {:options (vs/jm "__derived__" (vs/jm "clean" cfg))})]
539
+ ctx (atom {:cleancfg cfg})]
535
540
  (core/u-clean-add ctx "ZZVAL-abc123")
536
541
  (core/u-clean-add ctx "ZZVAL-xyz789")
537
542
  (let [out (core/u-clean ctx (vs/jm "ZZVAL-abc123" 1 "ZZVAL-xyz789" 2 "plain" 3))]
@@ -543,7 +548,7 @@ ${candidates(entity)}
543
548
  (t/run-check rec "clean-add-sensitive-registers-every-scalar-under-a-sensitive-name"
544
549
  (fn []
545
550
  (let [cfg (core/make-clean-config (vs/jm "keys" "key,secret,token"))
546
- ctx (atom {:options (vs/jm "__derived__" (vs/jm "clean" cfg))})
551
+ ctx (atom {:cleancfg cfg})
547
552
  _ (core/u-clean-add-sensitive ctx (vs/jm "apikey" (vs/jm "value" "NESTED-SECRET-1")
548
553
  "headers" (vs/jm "X-Api-Token" (vs/jt "LISTED-SECRET-2"))
549
554
  "secret" 123456789