@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,143 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/version.cpp)
2
+ // Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ /* Versions and ranges (§11.2). */
5
+
6
+ #include "version.hpp"
7
+
8
+ namespace plugin {
9
+
10
+ /* A COMPONENT IS BOUNDED, like a ref is (§4's 1024).
11
+ *
12
+ * The grammar admits an unbounded digit sequence, and every language
13
+ * then disagrees about what happens past its integer range: JavaScript
14
+ * silently loses precision, Go's Atoi errors (and a port ignoring that
15
+ * gets 0), C overflows, Python is exact. `satisfies("0",
16
+ * "9223372036854775808")` was false in the canonical and true in go,
17
+ * from the same corpus.
18
+ *
19
+ * 2^31-1 because every port has a signed 32-bit integer, and no real
20
+ * version has ever needed more. Stated rather than left to arithmetic
21
+ * nobody agrees on. Found by review of the go port. */
22
+ static const long COMPONENT_MAX = 2147483647L;
23
+
24
+ /* `^(\d+)(?:\.(\d+))?(?:\.(\d+))?$`, by hand: three components, digits
25
+ * only, no leading sign, no empty component. Written out rather than
26
+ * handed to <regex> because the bound below has to be checked per
27
+ * component anyway, and a regex that matched then needed re-scanning
28
+ * would be the worse of both. */
29
+ static bool parse3(const std::string& s, long out[3], bool& overflow) {
30
+ out[0] = out[1] = out[2] = 0;
31
+ overflow = false;
32
+ if (s.empty()) return false;
33
+
34
+ size_t i = 0;
35
+ for (int part = 0; part < 3; part++) {
36
+ if (i >= s.size()) return 0 < part; /* fewer than three is fine */
37
+ if (0 < part) {
38
+ if ('.' != s[i]) return false;
39
+ i++;
40
+ }
41
+ size_t start = i;
42
+ long acc = 0;
43
+ while (i < s.size() && '0' <= s[i] && '9' >= s[i]) {
44
+ if (!overflow) {
45
+ acc = acc * 10 + (s[i] - '0');
46
+ if (COMPONENT_MAX < acc) overflow = true;
47
+ }
48
+ i++;
49
+ }
50
+ if (start == i) return false; /* an empty component is not a number */
51
+ out[part] = acc;
52
+ }
53
+ return i == s.size();
54
+ }
55
+
56
+ static V triple(const long n[3]) {
57
+ V out = vlist();
58
+ for (int i = 0; i < 3; i++) push(out, vnum(static_cast<double>(n[i])));
59
+ return out;
60
+ }
61
+
62
+ V parserange(const V& range) {
63
+ if (!isstr(range) || asstr(range).empty()) {
64
+ std::string shown = isstr(range) ? asstr(range) : "";
65
+ fail("plugin_bad_range", "invalid range: " + shown,
66
+ details1("range", isnull(range) ? vnull() : range));
67
+ }
68
+
69
+ const std::string s = asstr(range);
70
+ /* Two forms and no more (§11.2):
71
+ * '2.1' >= 2.1.0 and < 3.0.0
72
+ * '~2.1' >= 2.1.0 and < 2.2.0 */
73
+ bool tilde = '~' == s[0];
74
+ std::string body = tilde ? s.substr(1) : s;
75
+
76
+ long n[3];
77
+ bool overflow = false;
78
+ if (!parse3(body, n, overflow) || overflow) {
79
+ fail("plugin_bad_range",
80
+ overflow ? "version component out of range in " + s
81
+ : "invalid range: " + s,
82
+ details1("range", range));
83
+ }
84
+
85
+ long lo[3] = { n[0], n[1], n[2] };
86
+ long hi[3];
87
+ if (tilde) { hi[0] = n[0]; hi[1] = n[1] + 1; hi[2] = 0; }
88
+ else { hi[0] = n[0] + 1; hi[1] = 0; hi[2] = 0; }
89
+
90
+ V out = vmap();
91
+ set(out, "lo", triple(lo));
92
+ set(out, "hi", triple(hi));
93
+ return out;
94
+ }
95
+
96
+ V parseversion(const V& version) {
97
+ if (!isstr(version)) {
98
+ fail("plugin_bad_range", "invalid version",
99
+ details1("version", isnull(version) ? vnull() : version));
100
+ }
101
+ const std::string s = asstr(version);
102
+ long n[3];
103
+ bool overflow = false;
104
+ if (!parse3(s, n, overflow) || overflow) {
105
+ /* `plugin_bad_range` either way — the same code the rest of the
106
+ * grammar's failures use, because "this is not a version I can
107
+ * compare" is one fact however it went wrong. */
108
+ fail("plugin_bad_range",
109
+ overflow ? "version component out of range in " + s
110
+ : "invalid version: " + s,
111
+ details1("version", version));
112
+ }
113
+ return triple(n);
114
+ }
115
+
116
+ int vercmp(const V& a, const V& b) {
117
+ for (size_t i = 0; i < 3; i++) {
118
+ double x = asnum(at(a, i));
119
+ double y = asnum(at(b, i));
120
+ if (x != y) return x < y ? -1 : 1;
121
+ }
122
+ return 0;
123
+ }
124
+
125
+ bool satisfies(const V& version, const V& range) {
126
+ V v = parseversion(version);
127
+ V r = parserange(range);
128
+ return 0 <= vercmp(v, get(r, "lo")) && 0 > vercmp(v, get(r, "hi"));
129
+ }
130
+
131
+ bool satisfiesq(const V& version, const V& range) {
132
+ /* `satisfies` for the internal callers that treat an unparseable
133
+ * version or range as "does not satisfy" — Capability and Graph, both
134
+ * of which run over data the corpus has already admitted. */
135
+ try {
136
+ return satisfies(version, range);
137
+ }
138
+ catch (const PluginError&) {
139
+ return false;
140
+ }
141
+ }
142
+
143
+ } // namespace plugin
@@ -0,0 +1,36 @@
1
+ // VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/version.hpp)
2
+ // Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
3
+ // License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
4
+ /* Versions and ranges (§11.2).
5
+ *
6
+ * TWO FIELDS AND ONE PREDICATE. A capability declares `version`, a
7
+ * concrete version. A requirement declares `range`. A requirement is
8
+ * satisfied when the names match, the `match` passes, and the
9
+ * provider's `version` falls inside the requirement's `range`. That is
10
+ * the whole rule — there is no third field and no second comparison. */
11
+
12
+ #ifndef VOXGIG_PLUGIN_VERSION_HPP
13
+ #define VOXGIG_PLUGIN_VERSION_HPP
14
+
15
+ #include "types.hpp"
16
+ #include "value.hpp"
17
+
18
+ namespace plugin {
19
+
20
+ /* A parsed range is {lo:[3], hi:[3]} — the shape `version/range` asserts
21
+ * directly, so it is a Value rather than a struct. */
22
+ V parserange(const V& range);
23
+ /* [major, minor, patch]. */
24
+ V parseversion(const V& version);
25
+
26
+ /* The one satisfaction predicate: lo <= version < hi. */
27
+ bool satisfies(const V& version, const V& range);
28
+ /* The same, tolerant of a missing version — a bare ref carries none, so
29
+ * `graph` and `depend` ask this rather than raising. */
30
+ bool satisfiesq(const V& version, const V& range);
31
+
32
+ int vercmp(const V& a, const V& b);
33
+
34
+ } // namespace plugin
35
+
36
+ #endif
@@ -0,0 +1,248 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Aws.cpp)
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
+ #include "Aws.hpp"
5
+
6
+ #include <ctime>
7
+
8
+ #include "Httpjson.hpp"
9
+ #include "../sekreto/Providers.hpp"
10
+ #include "../sekreto/Sekreto.hpp"
11
+ #include "Sigv4.hpp"
12
+
13
+ namespace sekreto {
14
+
15
+ namespace {
16
+
17
+ // -------------------------------------------------------------------- aws
18
+
19
+ /// The `YYYYMMDDTHHMMSSZ` timestamp SigV4 wants, for now. The only place
20
+ /// in this port that samples the clock for a signature - `sigv4` itself is
21
+ /// pure.
22
+ std::string awsnow() {
23
+ std::time_t stamp = std::time(nullptr);
24
+ std::tm parts;
25
+ gmtime_r(&stamp, &parts);
26
+
27
+ char buf[32];
28
+ std::strftime(buf, sizeof(buf), "%Y%m%dT%H%M%SZ", &parts);
29
+
30
+ return buf;
31
+ }
32
+
33
+ /// Region and credentials, resolved for one call.
34
+ struct Awsauth {
35
+ std::string region;
36
+ std::string keyid;
37
+ std::string secret;
38
+ std::string session;
39
+ };
40
+
41
+ /// From config first and the standard AWS_* environment variables second -
42
+ /// those are AWS's own convention, and a pod or CI job that has them set
43
+ /// should just work. Missing either is an error: an AWS store with no
44
+ /// credentials could not answer.
45
+ Awsauth awsauth(const std::string& region, const std::string& keyid,
46
+ const std::string& secret, const std::string& session) {
47
+ Awsauth out;
48
+
49
+ out.region = first(region, envvar("AWS_REGION"), envvar("AWS_DEFAULT_REGION"));
50
+ out.keyid = first(keyid, envvar("AWS_ACCESS_KEY_ID"));
51
+ out.secret = first(secret, envvar("AWS_SECRET_ACCESS_KEY"));
52
+ out.session = first(session, envvar("AWS_SESSION_TOKEN"));
53
+
54
+ if (out.region.empty()) {
55
+ throw SekretoError("sekreto: aws: no region (set region or AWS_REGION)");
56
+ }
57
+
58
+ if (out.keyid.empty() || out.secret.empty()) {
59
+ throw SekretoError(
60
+ "sekreto: aws: no credentials"
61
+ " (set keyid/secret or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)");
62
+ }
63
+
64
+ return out;
65
+ }
66
+
67
+ /// One signed call to an AWS JSON-1.1 API.
68
+ Answer awscall(const std::string& region, const std::string& keyid,
69
+ const std::string& secret, const std::string& session,
70
+ const std::string& addr, const std::string& service,
71
+ const std::string& target, const std::string& payload) {
72
+ Awsauth auth = awsauth(region, keyid, secret, session);
73
+
74
+ // The China partition lives under its own suffix; every other commercial
75
+ // region is plain amazonaws.com.
76
+ bool china = 0 == auth.region.compare(0, 3, "cn-");
77
+ std::string suffix = china ? ".amazonaws.com.cn" : ".amazonaws.com";
78
+ std::string useaddr = first(addr, "https://" + service + "." + auth.region + suffix);
79
+
80
+ checkaddr(useaddr);
81
+
82
+ std::string url = trimslash(useaddr) + "/";
83
+
84
+ Ordered extras;
85
+ extras.set("content-type", "application/x-amz-json-1.1");
86
+ extras.set("x-amz-target", target);
87
+
88
+ Signing input;
89
+ input.method = "POST";
90
+ input.url = url;
91
+ input.service = service;
92
+ input.region = auth.region;
93
+ input.keyid = auth.keyid;
94
+ input.secret = auth.secret;
95
+ input.datetime = awsnow();
96
+ input.headers = extras;
97
+ input.body = payload;
98
+ input.session = auth.session;
99
+
100
+ Ordered headers = extras;
101
+ for (const auto& entry : sigv4(input).pairs) {
102
+ headers.set(entry.first, entry.second);
103
+ }
104
+
105
+ return fetchjson("POST", url, headers, payload);
106
+ }
107
+
108
+ /// Does this AWS error body name one of the not-found types? Those are a
109
+ /// miss; every other failure is a store that could not answer. AWS sends
110
+ /// `com.amazonaws...#ResourceNotFoundException`, so this is a CONTAINS.
111
+ bool awsmiss(const Json& body, const std::string& want) {
112
+ std::string errtype;
113
+ if (!body.get("__type").asstr(errtype)) return false;
114
+
115
+ return std::string::npos != errtype.find(want);
116
+ }
117
+
118
+ /// AWS Secrets Manager.
119
+ ///
120
+ /// `api.token` reads the secret named `api` (the vaultref path, so
121
+ /// `db.pass.main` reads `db/pass`) and takes the `token` field of its JSON
122
+ /// SecretString - the AWS idiom of one JSON map per secret. A SecretString
123
+ /// that is not JSON is the value itself, under the conventional field
124
+ /// `value`. Requests are SigV4-signed in-tree.
125
+ class AwssecretsProvider : public Provider {
126
+ public:
127
+ AwssecretsProvider(const std::string& region, const std::string& keyid,
128
+ const std::string& secret, const std::string& session,
129
+ const std::string& addr)
130
+ : region_(region), keyid_(keyid), secret_(secret), session_(session), addr_(addr) {}
131
+
132
+ std::optional<std::string> lookup(const std::string& name) override {
133
+ VaultRef ref = vaultref(name);
134
+
135
+ Answer res = awscall(region_, keyid_, secret_, session_, addr_, "secretsmanager",
136
+ "secretsmanager.GetSecretValue",
137
+ Json::stringify(Json::obj({{"SecretId", Json::str(ref.path)}})));
138
+
139
+ if (400 == res.status && awsmiss(res.body, "ResourceNotFoundException")) {
140
+ return std::nullopt;
141
+ }
142
+
143
+ if (200 != res.status) {
144
+ throw SekretoError("sekreto: aws secretsmanager error: " + std::to_string(res.status));
145
+ }
146
+
147
+ std::string text;
148
+
149
+ if (!res.body.get("SecretString").asstr(text)) {
150
+ // A binary secret has no fields to address; only the conventional
151
+ // `value` field can mean "the bytes themselves".
152
+ std::string binary;
153
+ if (!res.body.get("SecretBinary").asstr(binary) || "value" != ref.field) {
154
+ return std::nullopt;
155
+ }
156
+
157
+ std::string decoded;
158
+ if (!unbase64(binary, decoded)) {
159
+ throw SekretoError("sekreto: aws secretsmanager: undecodable secret");
160
+ }
161
+
162
+ return decoded;
163
+ }
164
+
165
+ Json parsed;
166
+ if (Json::parse(text, parsed) && parsed.isobj()) {
167
+ return textof(parsed.get(ref.field));
168
+ }
169
+
170
+ // A plain-string secret is the whole value; it has no named fields.
171
+ if ("value" == ref.field) return text;
172
+
173
+ return std::nullopt;
174
+ }
175
+
176
+ // Config only, never the environment: describe() feeds the spec's
177
+ // sources group, which must answer the same everywhere.
178
+ std::string describe() const override { return "awssecrets:" + region_; }
179
+
180
+ private:
181
+ std::string region_;
182
+ std::string keyid_;
183
+ std::string secret_;
184
+ std::string session_;
185
+ std::string addr_;
186
+ };
187
+
188
+ /// AWS SSM Parameter Store.
189
+ ///
190
+ /// `db.pass.main` reads the parameter `/db/pass/main` (under an optional
191
+ /// prefix path), decrypted. Parameter Store carries flat strings, so there
192
+ /// is no field indirection.
193
+ class AwsparamsProvider : public Provider {
194
+ public:
195
+ AwsparamsProvider(const std::string& region, const std::string& keyid,
196
+ const std::string& secret, const std::string& session,
197
+ const std::string& addr, const std::string& prefix)
198
+ : region_(region),
199
+ keyid_(keyid),
200
+ secret_(secret),
201
+ session_(session),
202
+ addr_(addr),
203
+ prefix_(prefix) {}
204
+
205
+ std::optional<std::string> lookup(const std::string& name) override {
206
+ Json payload = Json::obj({{"Name", Json::str(awsparam(name, prefix_))},
207
+ {"WithDecryption", Json::boolean(true)}});
208
+
209
+ Answer res = awscall(region_, keyid_, secret_, session_, addr_, "ssm",
210
+ "AmazonSSM.GetParameter", Json::stringify(payload));
211
+
212
+ if (400 == res.status && awsmiss(res.body, "ParameterNotFound")) return std::nullopt;
213
+
214
+ if (200 != res.status) {
215
+ throw SekretoError("sekreto: aws ssm error: " + std::to_string(res.status));
216
+ }
217
+
218
+ return textof(res.body.get("Parameter").get("Value"));
219
+ }
220
+
221
+ std::string describe() const override { return "awsparams:" + region_ + prefix_; }
222
+
223
+ private:
224
+ std::string region_;
225
+ std::string keyid_;
226
+ std::string secret_;
227
+ std::string session_;
228
+ std::string addr_;
229
+ std::string prefix_;
230
+ };
231
+
232
+ } // namespace
233
+
234
+ Definition awssecrets() {
235
+ return providerplugin("awssecrets", [](const ProviderSpec& spec) -> std::shared_ptr<Provider> {
236
+ return std::make_shared<AwssecretsProvider>(spec.region, spec.keyid, spec.secret,
237
+ spec.session, spec.addr);
238
+ });
239
+ }
240
+
241
+ Definition awsparams() {
242
+ return providerplugin("awsparams", [](const ProviderSpec& spec) -> std::shared_ptr<Provider> {
243
+ return std::make_shared<AwsparamsProvider>(spec.region, spec.keyid, spec.secret,
244
+ spec.session, spec.addr, spec.prefix);
245
+ });
246
+ }
247
+
248
+ } // namespace sekreto
@@ -0,0 +1,30 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Aws.hpp)
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 Secrets Manager and SSM Parameter Store.
5
+ //
6
+ // SIGV4 TRAVELS WITH THIS PLUGIN, and it is the sharpest instance of the
7
+ // whole split: the core of no port includes a hash function, and this is
8
+ // the only kind that needs one.
9
+ //
10
+ // A PLUGIN, not a built-in: this kind opens a socket, signs a request or
11
+ // spawns a process, so a chain that does not name it links none of that.
12
+ // The calling project includes this header and passes what it declares to
13
+ // the Sekreto constructor (docs/design/plugin-providers.md).
14
+
15
+ #ifndef SEKRETO_PLUGINS_AWS_HPP
16
+ #define SEKRETO_PLUGINS_AWS_HPP
17
+
18
+ #include "../sekreto/Provider.hpp"
19
+
20
+ namespace sekreto {
21
+
22
+ /// The `awssecrets` provider kind, as a voxgig/plugin definition.
23
+ Definition awssecrets();
24
+
25
+ /// The `awsparams` provider kind, as a voxgig/plugin definition.
26
+ Definition awsparams();
27
+
28
+ } // namespace sekreto
29
+
30
+ #endif
@@ -0,0 +1,149 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Azuresecrets.cpp)
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
+ #include "Azuresecrets.hpp"
5
+
6
+ #include "Httpjson.hpp"
7
+ #include "../sekreto/Providers.hpp"
8
+ #include "../sekreto/Sekreto.hpp"
9
+
10
+ namespace sekreto {
11
+
12
+ namespace {
13
+
14
+ // ------------------------------------------------------------------ azure
15
+
16
+ /// The Key Vault audience an Azure token is minted for.
17
+ const char* const AZURERESOURCE = "https://vault.azure.net";
18
+
19
+ /// Azure Key Vault.
20
+ ///
21
+ /// `api.token` reads secret `api-token` (dots flattened to `-`; Key Vault
22
+ /// names allow nothing else), current version. The token comes from
23
+ /// config, then a client-credentials login when tenant/clientid/
24
+ /// clientsecret are given, then the IMDS managed-identity endpoint.
25
+ class AzuresecretsProvider : public Provider {
26
+ public:
27
+ AzuresecretsProvider(const std::string& vault, const std::string& token,
28
+ const std::string& tenant, const std::string& clientid,
29
+ const std::string& clientsecret, const std::string& loginaddr,
30
+ const std::string& imdsaddr, const std::string& apiversion)
31
+ : vault_(vault),
32
+ token_(token),
33
+ tenant_(tenant),
34
+ clientid_(clientid),
35
+ clientsecret_(clientsecret),
36
+ loginaddr_(loginaddr),
37
+ imdsaddr_(imdsaddr),
38
+ apiversion_(apiversion) {}
39
+
40
+ std::optional<std::string> lookup(const std::string& name) override {
41
+ if (vault_.empty()) throw SekretoError("sekreto: azure: no vault");
42
+
43
+ // Only an explicit scheme is a URL; a vault NAMED httpvault must still
44
+ // become https://httpvault.vault.azure.net.
45
+ bool isurl = 0 == vault_.compare(0, 7, "http://") || 0 == vault_.compare(0, 8, "https://");
46
+ std::string vaulturl = isurl ? vault_ : "https://" + vault_ + ".vault.azure.net";
47
+
48
+ checkaddr(vaulturl);
49
+
50
+ if (!livetoken_.has_value() || nowms() >= renewat_) {
51
+ livetoken_ = login();
52
+ }
53
+
54
+ std::string url = trimslash(vaulturl) + "/secrets/" + flatname(name, "-") +
55
+ "?api-version=" + first(apiversion_, "7.4");
56
+
57
+ Ordered headers;
58
+ headers.set("authorization", "Bearer " + livetoken_.value_or(""));
59
+
60
+ Answer res = fetchjson("GET", url, headers);
61
+
62
+ if (404 == res.status) return std::nullopt;
63
+
64
+ if (200 != res.status) {
65
+ throw SekretoError("sekreto: azure error: " + std::to_string(res.status) + ": " +
66
+ bareurl(url));
67
+ }
68
+
69
+ return textof(res.body.get("value"));
70
+ }
71
+
72
+ std::string describe() const override { return "azuresecrets:" + vault_; }
73
+
74
+ private:
75
+ std::string login() {
76
+ if (!token_.empty()) return token_;
77
+
78
+ if (!tenant_.empty() && !clientid_.empty() && !clientsecret_.empty()) {
79
+ std::string useloginaddr = first(loginaddr_, "https://login.microsoftonline.com");
80
+ checkaddr(useloginaddr);
81
+
82
+ std::string url = trimslash(useloginaddr) + "/" + tenant_ + "/oauth2/v2.0/token";
83
+ std::string form = "grant_type=client_credentials&client_id=" + uriescape(clientid_) +
84
+ "&client_secret=" + uriescape(clientsecret_) +
85
+ "&scope=" + uriescape(std::string(AZURERESOURCE) + "/.default");
86
+
87
+ Ordered headers;
88
+ headers.set("content-type", "application/x-www-form-urlencoded");
89
+
90
+ Answer res = fetchjson("POST", url, headers, form);
91
+
92
+ std::optional<std::string> got = textof(res.body.get("access_token"));
93
+
94
+ if (200 != res.status || !got.has_value() || got.value().empty()) {
95
+ throw SekretoError("sekreto: azure login failed: " + std::to_string(res.status));
96
+ }
97
+
98
+ renewat_ = renewtime(res.body.get("expires_in"));
99
+
100
+ return got.value();
101
+ }
102
+
103
+ std::string imds = trimslash(first(imdsaddr_, "http://169.254.169.254")) +
104
+ "/metadata/identity/oauth2/token?api-version=2018-02-01&resource=" +
105
+ uriescape(AZURERESOURCE);
106
+
107
+ Ordered headers;
108
+ headers.set("Metadata", "true");
109
+
110
+ Answer res = fetchjson("GET", imds, headers);
111
+
112
+ std::optional<std::string> got = textof(res.body.get("access_token"));
113
+
114
+ if (200 != res.status || !got.has_value() || got.value().empty()) {
115
+ throw SekretoError(
116
+ "sekreto: azure: no token, no client credentials, and IMDS did not answer");
117
+ }
118
+
119
+ // IMDS sends expires_in as a STRING, unlike everybody else.
120
+ renewat_ = renewtime(res.body.get("expires_in"));
121
+
122
+ return got.value();
123
+ }
124
+
125
+ std::string vault_;
126
+ std::string token_;
127
+ std::string tenant_;
128
+ std::string clientid_;
129
+ std::string clientsecret_;
130
+ std::string loginaddr_;
131
+ std::string imdsaddr_;
132
+ std::string apiversion_;
133
+
134
+ std::optional<std::string> livetoken_;
135
+ double renewat_ = NEVER;
136
+ };
137
+
138
+ } // namespace
139
+
140
+ Definition azuresecrets() {
141
+ return providerplugin("azuresecrets", [](const ProviderSpec& spec) -> std::shared_ptr<Provider> {
142
+ return std::make_shared<AzuresecretsProvider>(spec.vault, spec.token, spec.tenant,
143
+ spec.clientid, spec.clientsecret,
144
+ spec.loginaddr, spec.imdsaddr,
145
+ spec.apiversion);
146
+ });
147
+ }
148
+
149
+ } // namespace sekreto
@@ -0,0 +1,23 @@
1
+ // VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Azuresecrets.hpp)
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
+ // Azure Key Vault.
5
+ //
6
+ // A PLUGIN, not a built-in: this kind opens a socket, signs a request or
7
+ // spawns a process, so a chain that does not name it links none of that.
8
+ // The calling project includes this header and passes what it declares to
9
+ // the Sekreto constructor (docs/design/plugin-providers.md).
10
+
11
+ #ifndef SEKRETO_PLUGINS_AZURESECRETS_HPP
12
+ #define SEKRETO_PLUGINS_AZURESECRETS_HPP
13
+
14
+ #include "../sekreto/Provider.hpp"
15
+
16
+ namespace sekreto {
17
+
18
+ /// The `azuresecrets` provider kind, as a voxgig/plugin definition.
19
+ Definition azuresecrets();
20
+
21
+ } // namespace sekreto
22
+
23
+ #endif