@voxgig/sdkgen 4.10.0 → 4.11.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 (304) hide show
  1. package/bin/voxgig-sdkgen +1 -1
  2. package/package.json +1 -1
  3. package/project/.sdk/model/feature/secrets.aon +330 -0
  4. package/project/.sdk/model/target/c.aon +15 -2
  5. package/project/.sdk/model/target/cpp.aon +18 -0
  6. package/project/.sdk/model/target/lua.aon +17 -0
  7. package/project/.sdk/model/target/ocaml.aon +48 -5
  8. package/project/.sdk/model/target/zig.aon +30 -4
  9. package/project/.sdk/src/cmp/c/Config_c.ts +338 -1
  10. package/project/.sdk/src/cmp/c/Main_c.ts +57 -2
  11. package/project/.sdk/src/cmp/c/Package_c.ts +12 -2
  12. package/project/.sdk/src/cmp/cpp/Config_cpp.ts +324 -2
  13. package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +2 -0
  14. package/project/.sdk/src/cmp/cpp/Main_cpp.ts +62 -4
  15. package/project/.sdk/src/cmp/cpp/Package_cpp.ts +10 -0
  16. package/project/.sdk/src/cmp/lua/Config_lua.ts +88 -0
  17. package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +4 -0
  18. package/project/.sdk/src/cmp/lua/Main_lua.ts +93 -3
  19. package/project/.sdk/src/cmp/lua/Package_lua.ts +60 -0
  20. package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +10 -0
  21. package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +183 -5
  22. package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +160 -3
  23. package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +25 -1
  24. package/project/.sdk/src/cmp/zig/Config_zig.ts +130 -9
  25. package/project/.sdk/src/cmp/zig/Main_zig.ts +208 -4
  26. package/project/.sdk/{tm/zig/build.zig → src/cmp/zig/fragment/Build.fragment.zig} +7 -0
  27. package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +25 -0
  28. package/project/.sdk/{tm/zig/root.zig → src/cmp/zig/fragment/Root.fragment.zig} +9 -0
  29. package/project/.sdk/tm/c/Makefile +58 -9
  30. package/project/.sdk/tm/c/core/sdk.h +10 -0
  31. package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +133 -0
  32. package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +39 -0
  33. package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +83 -0
  34. package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +48 -0
  35. package/project/.sdk/tm/c/feature/secrets/plugin/config.c +413 -0
  36. package/project/.sdk/tm/c/feature/secrets/plugin/config.h +24 -0
  37. package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +264 -0
  38. package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +29 -0
  39. package/project/.sdk/tm/c/feature/secrets/plugin/env.c +220 -0
  40. package/project/.sdk/tm/c/feature/secrets/plugin/env.h +19 -0
  41. package/project/.sdk/tm/c/feature/secrets/plugin/export.c +97 -0
  42. package/project/.sdk/tm/c/feature/secrets/plugin/export.h +19 -0
  43. package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +237 -0
  44. package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +17 -0
  45. package/project/.sdk/tm/c/feature/secrets/plugin/host.c +1494 -0
  46. package/project/.sdk/tm/c/feature/secrets/plugin/host.h +135 -0
  47. package/project/.sdk/tm/c/feature/secrets/plugin/order.c +288 -0
  48. package/project/.sdk/tm/c/feature/secrets/plugin/order.h +18 -0
  49. package/project/.sdk/tm/c/feature/secrets/plugin/point.c +141 -0
  50. package/project/.sdk/tm/c/feature/secrets/plugin/point.h +80 -0
  51. package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +170 -0
  52. package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +52 -0
  53. package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +98 -0
  54. package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +18 -0
  55. package/project/.sdk/tm/c/feature/secrets/plugin/types.c +150 -0
  56. package/project/.sdk/tm/c/feature/secrets/plugin/types.h +104 -0
  57. package/project/.sdk/tm/c/feature/secrets/plugin/value.c +649 -0
  58. package/project/.sdk/tm/c/feature/secrets/plugin/value.h +135 -0
  59. package/project/.sdk/tm/c/feature/secrets/plugin/version.c +151 -0
  60. package/project/.sdk/tm/c/feature/secrets/plugin/version.h +34 -0
  61. package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +281 -0
  62. package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +207 -0
  63. package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +164 -0
  64. package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +75 -0
  65. package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +141 -0
  66. package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +144 -0
  67. package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +177 -0
  68. package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +239 -0
  69. package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +599 -0
  70. package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +165 -0
  71. package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +194 -0
  72. package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +233 -0
  73. package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +125 -0
  74. package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +125 -0
  75. package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +270 -0
  76. package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +382 -0
  77. package/project/.sdk/tm/c/feature/secrets/plugins/support.h +153 -0
  78. package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +420 -0
  79. package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +86 -0
  80. package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +721 -0
  81. package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +813 -0
  82. package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +944 -0
  83. package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +490 -0
  84. package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +442 -0
  85. package/project/.sdk/tm/c/feature/secrets.c +797 -0
  86. package/project/.sdk/tm/c/feature/secrets.h +46 -0
  87. package/project/.sdk/tm/c/src/feature/secrets/.gitkeep +0 -0
  88. package/project/.sdk/tm/c/tests/feature/secrets/secrets_test.c +802 -0
  89. package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +38 -11
  90. package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +40 -6
  91. package/project/.sdk/tm/cpp/Makefile +48 -4
  92. package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +121 -0
  93. package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +41 -0
  94. package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +60 -0
  95. package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +66 -0
  96. package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +376 -0
  97. package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +29 -0
  98. package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +230 -0
  99. package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +31 -0
  100. package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +205 -0
  101. package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +25 -0
  102. package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +84 -0
  103. package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +24 -0
  104. package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +222 -0
  105. package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +21 -0
  106. package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +1200 -0
  107. package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +250 -0
  108. package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +250 -0
  109. package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +22 -0
  110. package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +110 -0
  111. package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +79 -0
  112. package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +136 -0
  113. package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +60 -0
  114. package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +82 -0
  115. package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +25 -0
  116. package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +90 -0
  117. package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +65 -0
  118. package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +491 -0
  119. package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +120 -0
  120. package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +143 -0
  121. package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +36 -0
  122. package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +248 -0
  123. package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +30 -0
  124. package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +149 -0
  125. package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +23 -0
  126. package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +117 -0
  127. package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +27 -0
  128. package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +180 -0
  129. package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +52 -0
  130. package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +87 -0
  131. package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +23 -0
  132. package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +121 -0
  133. package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +23 -0
  134. package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +153 -0
  135. package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +23 -0
  136. package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +666 -0
  137. package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +160 -0
  138. package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +123 -0
  139. package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +23 -0
  140. package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +125 -0
  141. package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +23 -0
  142. package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +223 -0
  143. package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +47 -0
  144. package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +104 -0
  145. package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +27 -0
  146. package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +242 -0
  147. package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +58 -0
  148. package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +260 -0
  149. package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +47 -0
  150. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +476 -0
  151. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +89 -0
  152. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +312 -0
  153. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +263 -0
  154. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +354 -0
  155. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +111 -0
  156. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +613 -0
  157. package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +227 -0
  158. package/project/.sdk/tm/cpp/feature/secrets.hpp +745 -0
  159. package/project/.sdk/tm/cpp/src/feature/secrets/.gitkeep +0 -0
  160. package/project/.sdk/tm/cpp/test/feature/secrets/secrets_test.cpp +808 -0
  161. package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +34 -8
  162. package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +85 -0
  163. package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +17 -2
  164. package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +41 -0
  165. package/project/.sdk/tm/go/feature/secrets_feature.go +32 -10
  166. package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +116 -0
  167. package/project/.sdk/tm/java/feature/SecretsFeature.java +33 -8
  168. package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +64 -0
  169. package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +34 -11
  170. package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +73 -0
  171. package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +32 -7
  172. package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +69 -0
  173. package/project/.sdk/tm/lua/Makefile +15 -4
  174. package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +806 -0
  175. package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +135 -0
  176. package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +63 -0
  177. package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +361 -0
  178. package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +232 -0
  179. package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +168 -0
  180. package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +66 -0
  181. package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +194 -0
  182. package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +1190 -0
  183. package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +169 -0
  184. package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +207 -0
  185. package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +106 -0
  186. package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +115 -0
  187. package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +78 -0
  188. package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +275 -0
  189. package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +131 -0
  190. package/project/.sdk/tm/lua/feature/secrets/plugin.lua +76 -0
  191. package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +124 -0
  192. package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +47 -0
  193. package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +315 -0
  194. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +228 -0
  195. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +137 -0
  196. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +124 -0
  197. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +212 -0
  198. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +89 -0
  199. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +129 -0
  200. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +154 -0
  201. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +248 -0
  202. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +113 -0
  203. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +449 -0
  204. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +198 -0
  205. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +126 -0
  206. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +93 -0
  207. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +269 -0
  208. package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +146 -0
  209. package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +346 -0
  210. package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +479 -0
  211. package/project/.sdk/tm/lua/feature/secrets_feature.lua +690 -0
  212. package/project/.sdk/tm/lua/src/feature/secrets/.gitkeep +0 -0
  213. package/project/.sdk/tm/lua/test/extend_test.lua +105 -0
  214. package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +862 -0
  215. package/project/.sdk/tm/ocaml/Makefile +52 -8
  216. package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +106 -0
  217. package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +43 -0
  218. package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +349 -0
  219. package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +143 -0
  220. package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +217 -0
  221. package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +197 -0
  222. package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +89 -0
  223. package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +227 -0
  224. package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +1112 -0
  225. package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +202 -0
  226. package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +138 -0
  227. package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +126 -0
  228. package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +62 -0
  229. package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +97 -0
  230. package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +387 -0
  231. package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +139 -0
  232. package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +171 -0
  233. package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +116 -0
  234. package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +95 -0
  235. package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +149 -0
  236. package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +61 -0
  237. package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +93 -0
  238. package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +120 -0
  239. package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +421 -0
  240. package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +66 -0
  241. package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +85 -0
  242. package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +112 -0
  243. package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +97 -0
  244. package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +68 -0
  245. package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +259 -0
  246. package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +44 -0
  247. package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +358 -0
  248. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +376 -0
  249. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +647 -0
  250. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +299 -0
  251. package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +347 -0
  252. package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +453 -0
  253. package/project/.sdk/tm/ocaml/src/feature/secrets/.gitkeep +0 -0
  254. package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +670 -0
  255. package/project/.sdk/tm/perl/feature/secrets_feature.pm +33 -12
  256. package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +47 -0
  257. package/project/.sdk/tm/php/feature/SecretsFeature.php +30 -6
  258. package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +98 -0
  259. package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +28 -6
  260. package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +114 -0
  261. package/project/.sdk/tm/rb/feature/secrets_feature.rb +28 -6
  262. package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +93 -0
  263. package/project/.sdk/tm/rust/feature/secrets.rs +33 -10
  264. package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +96 -0
  265. package/project/.sdk/tm/scala/feature/SecretsFeature.scala +29 -7
  266. package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +71 -0
  267. package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +35 -12
  268. package/project/.sdk/tm/ts/test/feature/secrets/Secrets.test.ts +73 -0
  269. package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +137 -0
  270. package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +90 -0
  271. package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +346 -0
  272. package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +244 -0
  273. package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +201 -0
  274. package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +83 -0
  275. package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +212 -0
  276. package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +1224 -0
  277. package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +126 -0
  278. package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +228 -0
  279. package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +34 -0
  280. package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +166 -0
  281. package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +147 -0
  282. package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +74 -0
  283. package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +140 -0
  284. package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +662 -0
  285. package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +139 -0
  286. package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +294 -0
  287. package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +222 -0
  288. package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +188 -0
  289. package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +135 -0
  290. package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +170 -0
  291. package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +242 -0
  292. package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +535 -0
  293. package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +167 -0
  294. package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +202 -0
  295. package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +160 -0
  296. package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +336 -0
  297. package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +148 -0
  298. package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +259 -0
  299. package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +440 -0
  300. package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +944 -0
  301. package/project/.sdk/tm/zig/feature/secrets.zig +854 -0
  302. package/project/.sdk/tm/zig/src/feature/secrets/.gitkeep +0 -0
  303. package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +891 -0
  304. package/project/sdkgen-package.json +1 -1
@@ -0,0 +1,382 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (c/plugins/sigv4.c)
2
+ // Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ /* AWS Signature Version 4, hand-rolled.
5
+ *
6
+ * The AWS providers need exactly one thing from the AWS SDK - request
7
+ * signing - and there is no SDK to take in C anyway. SigV4 is a stable,
8
+ * published algorithm built from HMAC-SHA256, which `sha256.c` carries.
9
+ *
10
+ * IT MOVED HERE WITH THE AWS PLUGIN, and the core of no port imports a
11
+ * hash function any more. Only this file and `sha256.c` name a digest;
12
+ * the percent-encoder it needs is in `encode.c` with the transport, so
13
+ * that a store which builds URLs but signs nothing never pulls SHA-256
14
+ * into its link.
15
+ *
16
+ * `sek_sigv4` is pure: the caller passes the timestamp, so the same input
17
+ * yields the same signature everywhere. That is what lets the shared spec
18
+ * carry known-answer cases every port must reproduce bit for bit, and
19
+ * lets the integration mock recompute the signature server-side.
20
+ *
21
+ * A port of typescript/src/Sigv4.ts, which is canonical.
22
+ */
23
+
24
+ #define _POSIX_C_SOURCE 200809L
25
+
26
+ #include <string.h>
27
+
28
+ #include "support.h"
29
+
30
+ static int hexval(char ch) {
31
+ if ('0' <= ch && '9' >= ch) {
32
+ return ch - '0';
33
+ }
34
+ if ('a' <= ch && 'f' >= ch) {
35
+ return ch - 'a' + 10;
36
+ }
37
+ if ('A' <= ch && 'F' >= ch) {
38
+ return ch - 'A' + 10;
39
+ }
40
+ return -1;
41
+ }
42
+
43
+ /* Percent-decode, and nothing else: `+` stays `+`, as it is on the wire,
44
+ * and a malformed escape is kept literal. */
45
+ static char *uridecode(sek_pool *pool, const char *text) {
46
+ sek_buf out;
47
+ size_t index = 0;
48
+ size_t len = strlen(text);
49
+
50
+ sek_buf_init(&out, pool);
51
+
52
+ while (index < len) {
53
+ if ('%' == text[index] && index + 2 < len) {
54
+ int hi = hexval(text[index + 1]);
55
+ int lo = hexval(text[index + 2]);
56
+ if (0 <= hi && 0 <= lo) {
57
+ sek_buf_addch(&out, (char)((hi << 4) | lo));
58
+ index += 3;
59
+ continue;
60
+ }
61
+ }
62
+
63
+ sek_buf_addch(&out, text[index]);
64
+ index++;
65
+ }
66
+
67
+ return out.data;
68
+ }
69
+
70
+ /* The canonical query string: each pair decoded then re-escaped, sorted
71
+ * by escaped key then escaped value. `?b=2&a=1` signs as `a=1&b=2`. */
72
+ static char *canonicalquery(sek_pool *pool, const char *query) {
73
+ sek_buf out;
74
+ size_t index;
75
+ const char *at = query;
76
+
77
+ if (sek_empty(query)) {
78
+ return sek_strdup(pool, "");
79
+ }
80
+
81
+ /* Two parallel lists rather than a sek_map: a map would collapse a
82
+ * repeated key, and a signed query may legitimately repeat one. */
83
+ {
84
+ sek_list *keys = sek_list_new(pool);
85
+ sek_list *vals = sek_list_new(pool);
86
+
87
+ for (;;) {
88
+ const char *amp = strchr(at, '&');
89
+ size_t len = NULL == amp ? strlen(at) : (size_t)(amp - at);
90
+ char *pair = sek_strndup(pool, at, len);
91
+ const char *eq = strchr(pair, '=');
92
+
93
+ if (NULL == eq) {
94
+ sek_list_add(keys, sek_uriescape(pool, uridecode(pool, pair)));
95
+ sek_list_add(vals, "");
96
+ } else {
97
+ char *key = sek_strndup(pool, pair, (size_t)(eq - pair));
98
+ sek_list_add(keys, sek_uriescape(pool, uridecode(pool, key)));
99
+ sek_list_add(vals, sek_uriescape(pool, uridecode(pool, eq + 1)));
100
+ }
101
+
102
+ if (NULL == amp) {
103
+ break;
104
+ }
105
+ at = amp + 1;
106
+ }
107
+
108
+ /* An insertion sort: a signed query has a handful of pairs, and this
109
+ * keeps the comparison - key first, then value - in one place. */
110
+ for (index = 1; index < keys->len; index++) {
111
+ char *key = keys->items[index];
112
+ char *val = vals->items[index];
113
+ size_t back = index;
114
+
115
+ while (0 < back) {
116
+ int cmp = strcmp(keys->items[back - 1], key);
117
+ if (0 > cmp || (0 == cmp && 0 >= strcmp(vals->items[back - 1], val))) {
118
+ break;
119
+ }
120
+ keys->items[back] = keys->items[back - 1];
121
+ vals->items[back] = vals->items[back - 1];
122
+ back--;
123
+ }
124
+
125
+ keys->items[back] = key;
126
+ vals->items[back] = val;
127
+ }
128
+
129
+ sek_buf_init(&out, pool);
130
+ for (index = 0; index < keys->len; index++) {
131
+ if (0 < index) {
132
+ sek_buf_addch(&out, '&');
133
+ }
134
+ sek_buf_add(&out, keys->items[index]);
135
+ sek_buf_addch(&out, '=');
136
+ sek_buf_add(&out, vals->items[index]);
137
+ }
138
+ }
139
+
140
+ return out.data;
141
+ }
142
+
143
+ /* The `host` header value, the way the WHATWG URL model computes it: the
144
+ * hostname lowercased, userinfo stripped, and the port appended ONLY when
145
+ * it is not the scheme's default. `Host: x:443` is not what a signature
146
+ * over `host` covers.
147
+ *
148
+ * Hand-split, like every other address parse in this library: a platform
149
+ * URL type would have to agree with eleven other platforms' URL types for
150
+ * the shared vectors to pass. */
151
+ static void splithost(sek_pool *pool, const char *url, char **host, char **path, char **query) {
152
+ const char *rest;
153
+ const char *stop;
154
+ const char *authority;
155
+ size_t authlen;
156
+ const char *at;
157
+ const char *colon;
158
+ int tls = 0;
159
+ char *bare;
160
+ const char *port = NULL;
161
+ const char *tail;
162
+
163
+ if (sek_has_prefix(url, "https://")) {
164
+ rest = url + 8;
165
+ tls = 1;
166
+ } else if (sek_has_prefix(url, "http://")) {
167
+ rest = url + 7;
168
+ } else {
169
+ rest = url;
170
+ }
171
+
172
+ stop = rest;
173
+ while ('\0' != *stop && '/' != *stop && '?' != *stop && '#' != *stop) {
174
+ stop++;
175
+ }
176
+
177
+ authority = rest;
178
+ authlen = (size_t)(stop - rest);
179
+
180
+ /* Userinfo is stripped rather than parsed: checkaddr has already
181
+ * refused any address that carries it, so this only ever runs on one
182
+ * that does not. */
183
+ {
184
+ char *whole = sek_strndup(pool, authority, authlen);
185
+ at = strrchr(whole, '@');
186
+ if (NULL != at) {
187
+ whole = sek_strdup(pool, at + 1);
188
+ }
189
+
190
+ /* rfind, so an IPv6 literal's own colons are not read as a port. */
191
+ colon = strrchr(whole, ':');
192
+ if (NULL != colon && '\0' != whole[0] && ']' != whole[strlen(whole) - 1]) {
193
+ bare = sek_strndup(pool, whole, (size_t)(colon - whole));
194
+ port = colon + 1;
195
+ } else {
196
+ bare = whole;
197
+ }
198
+
199
+ bare = sek_lowercase(pool, bare);
200
+
201
+ if (NULL == port || '\0' == *port || (tls && 0 == strcmp(port, "443")) ||
202
+ (!tls && 0 == strcmp(port, "80"))) {
203
+ *host = bare;
204
+ } else {
205
+ *host = sek_fmt(pool, "%s:%s", bare, port);
206
+ }
207
+ }
208
+
209
+ /* The path is the RAW, already-percent-encoded text: re-escaping it
210
+ * would change a signature over a path that legitimately carries one. */
211
+ tail = stop;
212
+ {
213
+ const char *hash = strchr(tail, '#');
214
+ const char *mark = strchr(tail, '?');
215
+
216
+ if (NULL != mark && (NULL == hash || mark < hash)) {
217
+ *path = sek_strndup(pool, tail, (size_t)(mark - tail));
218
+ *query = NULL == hash ? sek_strdup(pool, mark + 1)
219
+ : sek_strndup(pool, mark + 1, (size_t)(hash - mark - 1));
220
+ } else {
221
+ *path = NULL == hash ? sek_strdup(pool, tail) : sek_strndup(pool, tail, (size_t)(hash - tail));
222
+ *query = sek_strdup(pool, "");
223
+ }
224
+ }
225
+
226
+ if ('\0' == (*path)[0]) {
227
+ *path = sek_strdup(pool, "/");
228
+ }
229
+ }
230
+
231
+ /* Trimmed, and internally collapsed: AWS folds every run of spaces and
232
+ * tabs to one space before signing, so a header value of `a b\tc` must
233
+ * sign as `a b c` or the service refuses the request. */
234
+ static char *foldvalue(sek_pool *pool, const char *value) {
235
+ sek_buf out;
236
+ size_t index = 0;
237
+ size_t len = strlen(value);
238
+ size_t end = len;
239
+ int pending = 0;
240
+
241
+ while (index < end && (' ' == value[index] || '\t' == value[index])) {
242
+ index++;
243
+ }
244
+ while (end > index && (' ' == value[end - 1] || '\t' == value[end - 1])) {
245
+ end--;
246
+ }
247
+
248
+ sek_buf_init(&out, pool);
249
+
250
+ for (; index < end; index++) {
251
+ char ch = value[index];
252
+ if (' ' == ch || '\t' == ch) {
253
+ pending = 1;
254
+ continue;
255
+ }
256
+ if (pending) {
257
+ sek_buf_addch(&out, ' ');
258
+ pending = 0;
259
+ }
260
+ sek_buf_addch(&out, ch);
261
+ }
262
+
263
+ return out.data;
264
+ }
265
+
266
+ sek_map *sek_sigv4(sek_pool *pool, const sek_signing *input) {
267
+ sek_map *headers = sek_map_new(pool);
268
+ sek_map *out = sek_map_new(pool);
269
+ char *host = NULL;
270
+ char *path = NULL;
271
+ char *query = NULL;
272
+ char *date;
273
+ char *scope;
274
+ char *canonicalheaders;
275
+ char *signedheaders;
276
+ char *canonicalrequest;
277
+ char *stringtosign;
278
+ const char *session = sek_empty(input->session) ? NULL : input->session;
279
+ unsigned char key[SEK_SHA256_LEN];
280
+ unsigned char step[SEK_SHA256_LEN];
281
+ size_t index;
282
+ sek_buf headbuf;
283
+ sek_buf namebuf;
284
+
285
+ splithost(pool, input->url, &host, &path, &query);
286
+
287
+ date = sek_strndup(pool, input->datetime, 8);
288
+
289
+ /* The caller's headers first, lowercased and folded; then host,
290
+ * x-amz-date and the session token, which are inserted AFTER so they
291
+ * win over a caller that set them. */
292
+ if (NULL != input->headers) {
293
+ for (index = 0; index < input->headers->len; index++) {
294
+ sek_map_set(headers, sek_lowercase(pool, input->headers->keys[index]),
295
+ foldvalue(pool, input->headers->vals[index]));
296
+ }
297
+ }
298
+ sek_map_set(headers, "host", host);
299
+ sek_map_set(headers, "x-amz-date", input->datetime);
300
+ if (NULL != session) {
301
+ sek_map_set(headers, "x-amz-security-token", session);
302
+ }
303
+
304
+ /* Sorted by name, ASCII ascending: the canonical order. */
305
+ for (index = 1; index < headers->len; index++) {
306
+ char *name = headers->keys[index];
307
+ char *value = headers->vals[index];
308
+ size_t back = index;
309
+
310
+ while (0 < back && 0 < strcmp(headers->keys[back - 1], name)) {
311
+ headers->keys[back] = headers->keys[back - 1];
312
+ headers->vals[back] = headers->vals[back - 1];
313
+ back--;
314
+ }
315
+
316
+ headers->keys[back] = name;
317
+ headers->vals[back] = value;
318
+ }
319
+
320
+ sek_buf_init(&headbuf, pool);
321
+ sek_buf_init(&namebuf, pool);
322
+ for (index = 0; index < headers->len; index++) {
323
+ sek_buf_addfmt(&headbuf, "%s:%s\n", headers->keys[index], headers->vals[index]);
324
+ if (0 < index) {
325
+ sek_buf_addch(&namebuf, ';');
326
+ }
327
+ sek_buf_add(&namebuf, headers->keys[index]);
328
+ }
329
+ canonicalheaders = headbuf.data;
330
+ signedheaders = namebuf.data;
331
+
332
+ /* Six lines. canonicalheaders already ends in a newline, so joining
333
+ * with `\n` leaves the blank line the algorithm calls for. */
334
+ {
335
+ sek_buf req;
336
+ char *method = sek_strdup(pool, input->method);
337
+ size_t at;
338
+
339
+ for (at = 0; '\0' != method[at]; at++) {
340
+ method[at] = sek_upper(method[at]);
341
+ }
342
+
343
+ sek_buf_init(&req, pool);
344
+ sek_buf_addfmt(&req, "%s\n%s\n%s\n%s\n%s\n%s", method, path, canonicalquery(pool, query),
345
+ canonicalheaders, signedheaders,
346
+ sek_sha256hex(pool, sek_orempty(input->body)));
347
+ canonicalrequest = req.data;
348
+ }
349
+
350
+ scope = sek_fmt(pool, "%s/%s/%s/aws4_request", date, input->region, input->service);
351
+
352
+ stringtosign = sek_fmt(pool, "AWS4-HMAC-SHA256\n%s\n%s\n%s", input->datetime, scope,
353
+ sek_sha256hex(pool, canonicalrequest));
354
+
355
+ {
356
+ char *seed = sek_fmt(pool, "AWS4%s", sek_orempty(input->secret));
357
+
358
+ sek_hmac_sha256((const unsigned char *)seed, strlen(seed), (const unsigned char *)date,
359
+ strlen(date), step);
360
+ sek_hmac_sha256(step, SEK_SHA256_LEN, (const unsigned char *)input->region,
361
+ strlen(input->region), key);
362
+ sek_hmac_sha256(key, SEK_SHA256_LEN, (const unsigned char *)input->service,
363
+ strlen(input->service), step);
364
+ sek_hmac_sha256(step, SEK_SHA256_LEN, (const unsigned char *)"aws4_request", 12, key);
365
+ sek_hmac_sha256(key, SEK_SHA256_LEN, (const unsigned char *)stringtosign,
366
+ strlen(stringtosign), step);
367
+ }
368
+
369
+ /* The exact literal form, verified server-side by regex: one space
370
+ * after the algorithm, ", " between the three components. */
371
+ sek_map_set(out, "authorization",
372
+ sek_fmt(pool, "AWS4-HMAC-SHA256 Credential=%s/%s, SignedHeaders=%s, Signature=%s",
373
+ sek_orempty(input->keyid), scope, signedheaders,
374
+ sek_hex(pool, step, SEK_SHA256_LEN)));
375
+ sek_map_set(out, "x-amz-date", input->datetime);
376
+
377
+ if (NULL != session) {
378
+ sek_map_set(out, "x-amz-security-token", session);
379
+ }
380
+
381
+ return out;
382
+ }
@@ -0,0 +1,153 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (c/plugins/support.h)
2
+ // Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ /* What the PLUGINS share and the core must never link: the HTTP
5
+ * transport, the TLS seam, the SHA-256 primitives SigV4 is built from,
6
+ * the two encoders, a child process and a clock.
7
+ *
8
+ * ONE TRANSLATION UNIT PER CAPABILITY, and that is a link-time decision
9
+ * rather than a filing preference. A static archive is pulled in an
10
+ * object at a time, so a plugin that signs nothing must not sit in the
11
+ * same object as the signer, and the shared percent-encoder must not
12
+ * either - `sek_uriescape` is used by four stores that hash nothing, so
13
+ * it lives with the transport in `encode.c` and SigV4 depends on it,
14
+ * never the other way round. `make check-core` reads the link and says
15
+ * which objects each plugin actually pulls.
16
+ *
17
+ * The core's own header, `src/internal.h`, is the other half of what a
18
+ * plugin compiles against; nothing here is visible from `src/`.
19
+ */
20
+
21
+ #ifndef VOXGIG_SEKRETO_PLUGIN_SUPPORT_H
22
+ #define VOXGIG_SEKRETO_PLUGIN_SUPPORT_H
23
+
24
+ #include <stddef.h>
25
+
26
+ #include "internal.h"
27
+ #include "sekretoplugins.h"
28
+
29
+ /* ---- crypto -------------------------------------------------------- */
30
+
31
+ /* FIPS 180-4 SHA-256 and RFC 2104 HMAC-SHA256, hand-rolled.
32
+ *
33
+ * Hand-rolled even though this port links libcrypto, and that is the
34
+ * rule, not an oversight: the TLS exception covers cryptographic
35
+ * TRANSPORT and nothing else. Rust is the worked precedent - `ring` is
36
+ * already inside rustls's dependency closure and rust/src/crypto.rs still
37
+ * carries both primitives. Both are proved by the SigV4 known-answer
38
+ * vectors: a signature is a chain of these, so one wrong bit fails there.
39
+ *
40
+ * `sha256.c` and nothing else. The aws plugin is the only thing in the
41
+ * library that names these, and a link of any other plugin must not pull
42
+ * the object they are in. */
43
+ #define SEK_SHA256_LEN 32
44
+
45
+ void sek_sha256(const unsigned char *data, size_t len, unsigned char out[SEK_SHA256_LEN]);
46
+ void sek_hmac_sha256(const unsigned char *key, size_t keylen, const unsigned char *data,
47
+ size_t datalen, unsigned char out[SEK_SHA256_LEN]);
48
+
49
+ char *sek_hex(sek_pool *pool, const unsigned char *bytes, size_t len);
50
+ char *sek_sha256hex(sek_pool *pool, const char *text);
51
+
52
+ /* ---- encoders ------------------------------------------------------ */
53
+
54
+ /* Strict standard base64. Answers NULL for anything outside the alphabet,
55
+ * for a length that is not a multiple of four, or for more than two
56
+ * padding characters. A lenient decoder hands back plausible bytes for a
57
+ * corrupted payload, and those bytes are then returned AS THE SECRET.
58
+ *
59
+ * With `sek_uriescape` in `encode.c`, not with the signer: base64 decodes
60
+ * an AWS binary secret and a GCP payload, percent-encoding builds four
61
+ * stores' URLs, and none of those five hashes anything. */
62
+ unsigned char *sek_unbase64(sek_pool *pool, const char *text, size_t *outlen);
63
+
64
+ /* ---- http ---------------------------------------------------------- */
65
+
66
+ /* How long any single vault round-trip may take before it is treated as
67
+ * unreachable, and how much of a body will be read before the store is
68
+ * treated as having answered incoherently. Ports carry the same bounds. */
69
+ #define SEK_TIMEOUT_MS 10000
70
+ #define SEK_MAXBODY (8 * 1024 * 1024)
71
+
72
+ typedef struct {
73
+ int status;
74
+ char *body;
75
+ size_t bodylen;
76
+ } sek_response;
77
+
78
+ /* One HTTP exchange. A non-2xx status is returned, not raised: a 404 from
79
+ * a vault means "no such secret", which is a miss rather than a failure. */
80
+ sek_err sek_http(sek_pool *pool, const char *method, const char *url, const sek_map *headers,
81
+ const char *body, sek_response *out);
82
+
83
+ /* One JSON round-trip: status plus parsed body. A 200 whose body does not
84
+ * parse is an error - the store answered incoherently, and reading that
85
+ * as a miss would fall through to a weaker store. */
86
+ typedef struct {
87
+ int status;
88
+ sek_json *body;
89
+ } sek_answer;
90
+
91
+ sek_err sek_fetchjson(sek_pool *pool, const char *method, const char *url, const sek_map *headers,
92
+ const char *body, sek_answer *out);
93
+
94
+ /* ---- tls ----------------------------------------------------------- */
95
+
96
+ /* The whole TLS surface of this port. `sek_tls_conn` is opaque: nothing
97
+ * outside tls.c knows it is an OpenSSL SSL*.
98
+ *
99
+ * The four obligations every binding in this repository must meet are
100
+ * met inside sek_tls_open, and are stated on its definition: chain
101
+ * verification against the system trust store, HOSTNAME verification
102
+ * (separate from chain verification, and the half people forget), SNI,
103
+ * and additive extra roots from SEKRETO_CA_BUNDLE. */
104
+ typedef struct sek_tls_conn sek_tls_conn;
105
+
106
+ /* The variable naming extra trust roots, as a PEM bundle. Additive: the
107
+ * system roots are loaded first, unconditionally. */
108
+ #define SEK_CABUNDLE "SEKRETO_CA_BUNDLE"
109
+
110
+ /* Wrap a connected socket in TLS for `host`. `host` is the bare host with
111
+ * any IPv6 brackets stripped - it is both the SNI name and the identity
112
+ * the certificate is checked against. Returns an error message on any
113
+ * failure, including a rejected certificate. */
114
+ sek_err sek_tls_open(sek_pool *pool, int fd, const char *host, sek_tls_conn **out);
115
+
116
+ /* Read and write with the same deadline discipline as the plain socket.
117
+ * Both answer < 0 on error and set *err; a read of 0 is end of stream. */
118
+ long sek_tls_write(sek_tls_conn *conn, const char *data, size_t len, sek_err *err);
119
+ long sek_tls_read(sek_tls_conn *conn, char *data, size_t len, sek_err *err);
120
+ void sek_tls_close(sek_tls_conn *conn);
121
+
122
+ /* Is this build able to speak TLS at all? Zero means every https address
123
+ * must be refused loudly rather than reached quietly. */
124
+ int sek_tls_available(void);
125
+
126
+ /* ---- subprocess ---------------------------------------------------- */
127
+
128
+ typedef struct {
129
+ char *out;
130
+ char *why; /* stderr, trimmed */
131
+ int status;
132
+ } sek_ran;
133
+
134
+ /* Run a child to completion and collect both its streams. Only `boru` and
135
+ * `secretspec` reach this, and it is the only object in the library that
136
+ * forks. */
137
+ sek_err sek_runcmd(sek_pool *pool, char *const argv[], const char *command, const char *envkey,
138
+ const char *envval, sek_ran *out);
139
+
140
+ /* ---- clock --------------------------------------------------------- */
141
+
142
+ /* When a logged-in token must be renewed, from its expiry in seconds (a
143
+ * JSON number, or a string as Azure IMDS sends it). A missing or zero
144
+ * expiry means never - which is what a configured token gets. */
145
+ #define SEK_NEVER 0x7fffffffffffffffll
146
+
147
+ long long sek_renewtime(const sek_json *expires);
148
+ long long sek_nowms(void);
149
+
150
+ /* The `YYYYMMDDTHHMMSSZ` timestamp SigV4 wants, for now. */
151
+ char *sek_awsnow(sek_pool *pool);
152
+
153
+ #endif /* VOXGIG_SEKRETO_PLUGIN_SUPPORT_H */