@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.
- package/bin/voxgig-sdkgen +1 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +330 -0
- package/project/.sdk/model/target/c.aon +15 -2
- package/project/.sdk/model/target/cpp.aon +18 -0
- package/project/.sdk/model/target/lua.aon +17 -0
- package/project/.sdk/model/target/ocaml.aon +48 -5
- package/project/.sdk/model/target/zig.aon +30 -4
- package/project/.sdk/src/cmp/c/Config_c.ts +338 -1
- package/project/.sdk/src/cmp/c/Main_c.ts +57 -2
- package/project/.sdk/src/cmp/c/Package_c.ts +12 -2
- package/project/.sdk/src/cmp/cpp/Config_cpp.ts +324 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +2 -0
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +62 -4
- package/project/.sdk/src/cmp/cpp/Package_cpp.ts +10 -0
- package/project/.sdk/src/cmp/lua/Config_lua.ts +88 -0
- package/project/.sdk/src/cmp/lua/Gitignore_lua.ts +4 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +93 -3
- package/project/.sdk/src/cmp/lua/Package_lua.ts +60 -0
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +10 -0
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +183 -5
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +160 -3
- package/project/.sdk/src/cmp/ocaml/Package_ocaml.ts +25 -1
- package/project/.sdk/src/cmp/zig/Config_zig.ts +130 -9
- package/project/.sdk/src/cmp/zig/Main_zig.ts +208 -4
- package/project/.sdk/{tm/zig/build.zig → src/cmp/zig/fragment/Build.fragment.zig} +7 -0
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +25 -0
- package/project/.sdk/{tm/zig/root.zig → src/cmp/zig/fragment/Root.fragment.zig} +9 -0
- package/project/.sdk/tm/c/Makefile +58 -9
- package/project/.sdk/tm/c/core/sdk.h +10 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +133 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +39 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +83 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +48 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.c +413 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/config.h +24 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +264 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +29 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.c +220 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/env.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.c +97 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/export.h +19 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +237 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +17 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.c +1494 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/host.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.c +288 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/order.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/point.h +80 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +170 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +52 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +98 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +18 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.c +150 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/types.h +104 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.c +649 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/value.h +135 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.c +151 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/version.h +34 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +281 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +207 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +164 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +75 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +141 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +144 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +177 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +239 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +599 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +165 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +194 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +233 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +125 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +270 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +382 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/support.h +153 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +420 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +86 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +721 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +813 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +944 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +490 -0
- package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +442 -0
- package/project/.sdk/tm/c/feature/secrets.c +797 -0
- package/project/.sdk/tm/c/feature/secrets.h +46 -0
- package/project/.sdk/tm/c/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/c/tests/feature/secrets/secrets_test.c +802 -0
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +38 -11
- package/project/.sdk/tm/clojure/test/sdk/test/feature/secrets.clj +40 -6
- package/project/.sdk/tm/cpp/Makefile +48 -4
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +41 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +66 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +376 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +29 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +230 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +31 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +205 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +84 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +24 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +222 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +21 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +1200 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +250 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +22 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +110 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +79 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +136 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +60 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +82 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +25 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +90 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +65 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +491 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +120 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +143 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +36 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +248 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +30 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +149 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +117 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +180 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +52 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +87 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +121 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +153 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +666 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +160 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +123 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +125 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +23 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +223 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +104 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +27 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +242 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +58 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +260 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +47 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +476 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +89 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +312 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +263 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +354 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +111 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +613 -0
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +227 -0
- package/project/.sdk/tm/cpp/feature/secrets.hpp +745 -0
- package/project/.sdk/tm/cpp/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/test/feature/secrets/secrets_test.cpp +808 -0
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +34 -8
- package/project/.sdk/tm/csharp/test/feature/secrets/SecretsFeatureTest.cs +85 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +17 -2
- package/project/.sdk/tm/elixir/test/feature/secrets/secrets_test.exs +41 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +32 -10
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +116 -0
- package/project/.sdk/tm/java/feature/SecretsFeature.java +33 -8
- package/project/.sdk/tm/java/test/feature/secrets/SecretsFeatureTest.java +64 -0
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +34 -11
- package/project/.sdk/tm/js/test/feature/secrets/Secrets.test.js +73 -0
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +32 -7
- package/project/.sdk/tm/kotlin/test/feature/secrets/SecretsTest.kt +69 -0
- package/project/.sdk/tm/lua/Makefile +15 -4
- package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +806 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +135 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +63 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +361 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +232 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +168 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +66 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +194 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +1190 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +169 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +207 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +106 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +115 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +78 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +275 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +131 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin.lua +76 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +47 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +315 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +228 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +137 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +124 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +212 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +89 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +129 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +154 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +248 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +113 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +449 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +198 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +126 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +93 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +269 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +146 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +346 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +479 -0
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +690 -0
- package/project/.sdk/tm/lua/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/extend_test.lua +105 -0
- package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +862 -0
- package/project/.sdk/tm/ocaml/Makefile +52 -8
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +106 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +43 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +349 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +143 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +217 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +197 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +89 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +227 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +1112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +202 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +138 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +126 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +62 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +387 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +139 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +171 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +116 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +95 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +149 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +61 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +93 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +120 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +421 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +66 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +85 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +112 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +97 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +68 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +259 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +44 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +358 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +376 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +647 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +299 -0
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +347 -0
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +453 -0
- package/project/.sdk/tm/ocaml/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +670 -0
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +33 -12
- package/project/.sdk/tm/perl/t/feature/secrets/secrets.t +47 -0
- package/project/.sdk/tm/php/feature/SecretsFeature.php +30 -6
- package/project/.sdk/tm/php/test/feature/secrets/SecretsTest.php +98 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +28 -6
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +114 -0
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +28 -6
- package/project/.sdk/tm/rb/test/feature/secrets/secrets_feature_test.rb +93 -0
- package/project/.sdk/tm/rust/feature/secrets.rs +33 -10
- package/project/.sdk/tm/rust/tests/feature/secrets/main.rs +96 -0
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +29 -7
- package/project/.sdk/tm/scala/sdktest/feature/secrets/SecretsTestMain.scala +71 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +35 -12
- package/project/.sdk/tm/ts/test/feature/secrets/Secrets.test.ts +73 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +137 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +90 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +346 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +244 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +201 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +83 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +212 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +1224 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +126 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +228 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +34 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +166 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +147 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +74 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +140 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +662 -0
- package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +139 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +294 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +222 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +188 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +135 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +170 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +242 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +535 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +167 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +202 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +160 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +336 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +148 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +259 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +440 -0
- package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +944 -0
- package/project/.sdk/tm/zig/feature/secrets.zig +854 -0
- package/project/.sdk/tm/zig/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/zig/test/feature/secrets/secrets_test.zig +891 -0
- package/project/sdkgen-package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
1
|
import {
|
|
3
2
|
Content,
|
|
4
3
|
File,
|
|
4
|
+
Folder,
|
|
5
5
|
cmp,
|
|
6
6
|
configDefinition,
|
|
7
7
|
each,
|
|
@@ -21,6 +21,291 @@ import {
|
|
|
21
21
|
} from './utility_cpp'
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
// PLUGIN DEFINITIONS PER FEATURE (the cpp peer of Config_c's
|
|
25
|
+
// pluginDefinitions and Config_go's featurePlugins map).
|
|
26
|
+
//
|
|
27
|
+
// Upstream sekreto retired its self-registration registry for voxgig/plugin
|
|
28
|
+
// definitions: a provider kind the caller did not pass in
|
|
29
|
+
// `SekretoOptions::plugins` is unknown to that Sekreto. So the model's
|
|
30
|
+
// choice of plugin groups IS the SDK's provider vocabulary, and the
|
|
31
|
+
// generated code names each active group's factory (`def: cpp:` in
|
|
32
|
+
// model/feature/secrets.aon - `hashicorp`, the `Definition hashicorp()`
|
|
33
|
+
// each vendored kind header declares in namespace sekreto) and nothing
|
|
34
|
+
// else. A symbol named here whose file the plugin trim removed is an
|
|
35
|
+
// unresolved reference at link time - a loud failure, which is the right
|
|
36
|
+
// kind. The owning file is kept per symbol because the generated
|
|
37
|
+
// translation unit has to include that file's header.
|
|
38
|
+
//
|
|
39
|
+
// One entry per ACTIVE feature that declares a `plugin` map at all, read
|
|
40
|
+
// with `only_active: false` (pluginExcludesFor's subtlety: the feature
|
|
41
|
+
// object a component is handed has already been filtered, so a feature
|
|
42
|
+
// whose groups are all off would otherwise look like one with no plugin
|
|
43
|
+
// machinery, and its kinds.cpp - which the Makefile reads as the feature's
|
|
44
|
+
// WIRING - would not be emitted).
|
|
45
|
+
function pluginDefinitions(model: Model, target: any):
|
|
46
|
+
Record<string, { syms: Record<string, string>, groups: number }> {
|
|
47
|
+
const out: Record<string, { syms: Record<string, string>, groups: number }> = {}
|
|
48
|
+
const feature = targetFeatures(model, target)
|
|
49
|
+
|
|
50
|
+
each(feature, (f: any) => {
|
|
51
|
+
const declared = getModelPath(model,
|
|
52
|
+
`main.${KIT}.feature.${f.name}.plugin`,
|
|
53
|
+
{ required: false, only_active: false }) || {}
|
|
54
|
+
if (0 === Object.keys(declared).length) return
|
|
55
|
+
|
|
56
|
+
const syms: Record<string, string> = {}
|
|
57
|
+
let groups = 0
|
|
58
|
+
each(declared, (plugin: any) => {
|
|
59
|
+
// Filter on `active` HERE rather than trusting the feature object to
|
|
60
|
+
// arrive filtered (Config_go's note): getting this wrong names a
|
|
61
|
+
// factory for a file the trim just deleted.
|
|
62
|
+
if (true !== plugin.active) return
|
|
63
|
+
const defs = plugin.def?.[target.name] || {}
|
|
64
|
+
if (0 < Object.keys(defs).length) groups++
|
|
65
|
+
for (const sym of Object.keys(defs)) syms[sym] = String(defs[sym])
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
out[f.name] = { syms, groups }
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
return out
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// feature/<name>/kinds.cpp - GENERATED, one per plugin-bearing active
|
|
76
|
+
// feature, and the ONE translation unit this otherwise header-only target
|
|
77
|
+
// generates.
|
|
78
|
+
//
|
|
79
|
+
// It cannot live in core/config.hpp: that header is included by every test
|
|
80
|
+
// translation unit, and it must not name the vendored voxgig/plugin's
|
|
81
|
+
// `Definition` type - the same reason go hides its list behind []any and c
|
|
82
|
+
// behind void**. So config.hpp's accessor is type-erased
|
|
83
|
+
// (std::shared_ptr<void>), and this file, which may include the kind
|
|
84
|
+
// headers, produces the erased list. It sits one level ABOVE the vendored
|
|
85
|
+
// sekreto/, plugin/ and plugins/ directories on purpose: the vendoring
|
|
86
|
+
// guard fails any non-vendored file inside a vendor dir, and this one is
|
|
87
|
+
// generated.
|
|
88
|
+
//
|
|
89
|
+
// Beside it goes feature/<name>/kinds.mk, the feature's BUILD WIRING: a
|
|
90
|
+
// generated make fragment that tm/cpp/Makefile reads through
|
|
91
|
+
// `-include $(wildcard feature/*/kinds.mk)`. The Makefile itself names no
|
|
92
|
+
// feature (the `nothing left behind names a dropped feature` guard holds a
|
|
93
|
+
// trimmed template tree to that), so everything the payload needs from the
|
|
94
|
+
// build is stated here, from the model: this translation unit and the
|
|
95
|
+
// vendored cores to compile into libsdkfeature.a, the suite to build, and
|
|
96
|
+
// - only when a plugin group is active - the plugin layer with the OpenSSL
|
|
97
|
+
// it brings. A tree whose model never activated the feature has no
|
|
98
|
+
// fragment, compiles none of the payload and links libstdc++ alone. Both
|
|
99
|
+
// files are emitted for an active feature with NO active group as well -
|
|
100
|
+
// an [env, memory] chain still needs the sekreto core - with an empty
|
|
101
|
+
// definitions list and no plugin layer.
|
|
102
|
+
//
|
|
103
|
+
// For `secrets` it additionally carries `secrets_rawfetch`, the
|
|
104
|
+
// token-exchange transport of last resort (go's rawExchangeFetch). The cpp
|
|
105
|
+
// core ships no HTTP client (utility/pipeline.hpp fetcher: "provide
|
|
106
|
+
// options.system.fetch"), and the decision for this target - as for c - is
|
|
107
|
+
// to bundle one INSIDE the gated feature, compiled in only when a plugin
|
|
108
|
+
// group is active, so an SDK without secrets, or with a chain of built-ins,
|
|
109
|
+
// still ships zero external dependencies. DELIBERATE DIVERGENCE from c,
|
|
110
|
+
// which bundles libcurl: the cpp sekreto port exports its own HTTPS client
|
|
111
|
+
// (`sekreto::httprequest`, plugins/Httpjson.cpp over plugins/Tls.cpp), and
|
|
112
|
+
// it is already compiled and linked - OpenSSL and all - on exactly the
|
|
113
|
+
// condition this transport needs. Reusing it means one HTTP stack and one
|
|
114
|
+
// -l pair (-lssl -lcrypto) instead of two; kinds.mk links OpenSSL on the
|
|
115
|
+
// same condition (a plugin group active), so the two cannot disagree.
|
|
116
|
+
// With no group active the exchange still works through a caller-supplied
|
|
117
|
+
// options.system.fetch, which every live cpp request already lives under;
|
|
118
|
+
// only the fallback is missing, and it says so.
|
|
119
|
+
const FeaturePlugins = cmp(async function FeaturePlugins(props: any) {
|
|
120
|
+
const ctx$ = props.ctx$
|
|
121
|
+
const target = props.target
|
|
122
|
+
const model: Model = ctx$.model
|
|
123
|
+
|
|
124
|
+
const defs = pluginDefinitions(model, target)
|
|
125
|
+
if (0 === Object.keys(defs).length) return
|
|
126
|
+
|
|
127
|
+
Folder({ name: 'feature' }, () => {
|
|
128
|
+
for (const fname of Object.keys(defs).sort()) {
|
|
129
|
+
const { syms, groups } = defs[fname]
|
|
130
|
+
const symnames = Object.keys(syms).sort()
|
|
131
|
+
|
|
132
|
+
// The header each selected kind file declares its factory in,
|
|
133
|
+
// relative to this file (feature/<fname>/): `feature/<fname>/
|
|
134
|
+
// plugins/Hashicorp.cpp` -> `plugins/Hashicorp.hpp`. Deduplicated,
|
|
135
|
+
// because aws declares two factories in one header.
|
|
136
|
+
const headers = Array.from(new Set(symnames.map((sym) =>
|
|
137
|
+
syms[sym]
|
|
138
|
+
.replace(new RegExp('^feature/' + fname + '/'), '')
|
|
139
|
+
.replace(/\.cpp$/, '.hpp')))).sort()
|
|
140
|
+
|
|
141
|
+
Folder({ name: fname }, () => {
|
|
142
|
+
// The build wiring (see above). Paths are SDK-root-relative, as the
|
|
143
|
+
// Makefile's own globs are. kinds.cpp itself is listed: nothing
|
|
144
|
+
// else in the tree is a .cpp the Makefile would otherwise compile.
|
|
145
|
+
File({ name: 'kinds.mk' }, () => {
|
|
146
|
+
Content(`# Generated beside kinds.cpp: what the \`${fname}\` feature needs from the
|
|
147
|
+
# build, read by the Makefile through \`-include $(wildcard feature/*/kinds.mk)\`.
|
|
148
|
+
# Without this file none of the feature's vendored payload is compiled or
|
|
149
|
+
# linked. Do not hand-edit - change the model and regenerate.
|
|
150
|
+
|
|
151
|
+
# The wiring translation unit, the vendored cores every chain needs (sekreto
|
|
152
|
+
# and the voxgig/plugin host it is built on), and the feature's gated suite.
|
|
153
|
+
FEATURE_SRCS += feature/${fname}/kinds.cpp \\
|
|
154
|
+
$(wildcard feature/${fname}/sekreto/*.cpp feature/${fname}/plugin/*.cpp)
|
|
155
|
+
FEATURE_TEST_SRCS += $(wildcard test/feature/${fname}/*.cpp)
|
|
156
|
+
`)
|
|
157
|
+
if (0 === groups) {
|
|
158
|
+
Content(`
|
|
159
|
+
# No plugin group is active: the plugin layer (the kinds, the socket HTTPS
|
|
160
|
+
# client and its OpenSSL binding, the digests and the child-process
|
|
161
|
+
# launcher) is on disk but NOT compiled - plugins/Tls.cpp hard-includes
|
|
162
|
+
# <openssl/ssl.h> - and nothing beyond libstdc++ is linked. A chain of
|
|
163
|
+
# built-ins needs none of it.
|
|
164
|
+
`)
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
Content(`
|
|
168
|
+
# A plugin group is active: the selected kinds and the four shared helpers
|
|
169
|
+
# they call (the socket HTTPS client, its OpenSSL binding, the digests and
|
|
170
|
+
# the child-process launcher), with the one external library they bring -
|
|
171
|
+
# OpenSSL, for the vault kinds' TLS and for the token-exchange transport of
|
|
172
|
+
# last resort in kinds.cpp, which rides on the same vendored client.
|
|
173
|
+
FEATURE_SRCS += $(wildcard feature/${fname}/plugins/*.cpp)
|
|
174
|
+
FEATURE_LIBS += -lssl -lcrypto
|
|
175
|
+
`)
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
File({ name: 'kinds.cpp' }, () => {
|
|
180
|
+
Content(`// Generated: the plugin definitions the model selected for the \`${fname}\`
|
|
181
|
+
// feature's provider chain (the cpp peer of go's core.FeaturePlugins),
|
|
182
|
+
// read back by core/config.hpp's featurePlugins("${fname}") and by the
|
|
183
|
+
// feature itself through ${fname}_plugins().
|
|
184
|
+
//
|
|
185
|
+
// GENERATED beside kinds.mk, the build wiring tm/cpp/Makefile includes. Do
|
|
186
|
+
// not hand-edit - change the model's plugin groups and regenerate.
|
|
187
|
+
//
|
|
188
|
+
// The one non-header translation unit this SDK generates: it includes the
|
|
189
|
+
// header-only SDK (for the declarations feature/${fname}.hpp makes) and the
|
|
190
|
+
// vendored kind headers, which core/config.hpp must never name.
|
|
191
|
+
|
|
192
|
+
#include "../../core/sdk.hpp"
|
|
193
|
+
|
|
194
|
+
#include <memory>
|
|
195
|
+
#include <string>
|
|
196
|
+
#include <utility>
|
|
197
|
+
#include <vector>
|
|
198
|
+
|
|
199
|
+
${headers.map((h) => `#include "${h}"
|
|
200
|
+
`).join('')}
|
|
201
|
+
namespace sdk {
|
|
202
|
+
|
|
203
|
+
${0 === symnames.length ?
|
|
204
|
+
`// No plugin group is active: the chain can name the four built-in kinds
|
|
205
|
+
// (env, memory, dotenv, file) and a custom provider, and nothing else.
|
|
206
|
+
std::vector<std::shared_ptr<void>> ${fname}_plugins() {
|
|
207
|
+
return {};
|
|
208
|
+
}
|
|
209
|
+
` :
|
|
210
|
+
`// One factory call per selected kind, type-erased for config.hpp (the
|
|
211
|
+
// feature casts each back to plugin::DefinitionPtr).
|
|
212
|
+
std::vector<std::shared_ptr<void>> ${fname}_plugins() {
|
|
213
|
+
return {
|
|
214
|
+
${symnames.map((sym) => ` std::static_pointer_cast<void>(sekreto::${sym}()),
|
|
215
|
+
`).join('')} };
|
|
216
|
+
}
|
|
217
|
+
`}`)
|
|
218
|
+
|
|
219
|
+
if ('secrets' !== fname) {
|
|
220
|
+
Content(`
|
|
221
|
+
} // namespace sdk
|
|
222
|
+
`)
|
|
223
|
+
return
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (0 === groups) {
|
|
227
|
+
Content(`
|
|
228
|
+
// THE EXCHANGE TRANSPORT OF LAST RESORT, when no plugin group is active:
|
|
229
|
+
// there is none. The cpp core ships no HTTP client, and the vendored HTTPS
|
|
230
|
+
// client (plugins/Httpjson.cpp, OpenSSL) is compiled with the plugin
|
|
231
|
+
// groups only (see kinds.mk beside this file), so a token purchase needs
|
|
232
|
+
// options.system.fetch - the seam every live cpp request already uses.
|
|
233
|
+
// Reached only by an exchange whose caller supplied no transport; a chain
|
|
234
|
+
// that resolves a static credential never comes here.
|
|
235
|
+
SecretsRawResponse secrets_rawfetch(
|
|
236
|
+
const std::string& method, const std::string& url,
|
|
237
|
+
const std::vector<std::pair<std::string, std::string>>& headers,
|
|
238
|
+
const std::string& body) {
|
|
239
|
+
(void)method; (void)headers; (void)body;
|
|
240
|
+
SecretsRawResponse out;
|
|
241
|
+
out.ok = false;
|
|
242
|
+
out.err = "secrets: the token exchange has no HTTP transport: this SDK selected "
|
|
243
|
+
"no secrets plugin group, so the vendored HTTPS client is not compiled; "
|
|
244
|
+
"supply options.system.fetch or activate a plugin group (URL was: \\"" +
|
|
245
|
+
url + "\\")";
|
|
246
|
+
return out;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
} // namespace sdk
|
|
250
|
+
`)
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
Content(`
|
|
255
|
+
// THE EXCHANGE TRANSPORT OF LAST RESORT (go's rawExchangeFetch): the
|
|
256
|
+
// vendored sekreto HTTPS client, answering the status and raw body the
|
|
257
|
+
// feature turns into the transport-shaped map the system.fetch seam
|
|
258
|
+
// promises. It exists so an exchange works with ordinary SDK options -
|
|
259
|
+
// requiring a custom transport for the COMMON case would refuse every
|
|
260
|
+
// live token purchase before a request was made. Deliberately NOT the SDK
|
|
261
|
+
// transport: that is what the secrets feature wraps, and sending the
|
|
262
|
+
// token request back through it would recurse on the first expiry.
|
|
263
|
+
//
|
|
264
|
+
// \`sekreto::httprequest\` RETURNS a non-2xx status rather than raising (a
|
|
265
|
+
// 401 from a token endpoint is an answer), raises only on a transport
|
|
266
|
+
// failure, follows no redirect and consults no proxy - the properties a
|
|
267
|
+
// credential-bearing request wants. It is compiled because a plugin group
|
|
268
|
+
// is active in this model; kinds.mk links OpenSSL on exactly that
|
|
269
|
+
// condition. (c bundles libcurl here instead - see the note on
|
|
270
|
+
// FeaturePlugins in Config_cpp.ts for why cpp reuses the vendored client.)
|
|
271
|
+
|
|
272
|
+
} // namespace sdk
|
|
273
|
+
|
|
274
|
+
#include "plugins/Httpjson.hpp"
|
|
275
|
+
|
|
276
|
+
namespace sdk {
|
|
277
|
+
|
|
278
|
+
SecretsRawResponse secrets_rawfetch(
|
|
279
|
+
const std::string& method, const std::string& url,
|
|
280
|
+
const std::vector<std::pair<std::string, std::string>>& headers,
|
|
281
|
+
const std::string& body) {
|
|
282
|
+
SecretsRawResponse out;
|
|
283
|
+
try {
|
|
284
|
+
sekreto::Ordered h;
|
|
285
|
+
for (const auto& kv : headers) h.set(kv.first, kv.second);
|
|
286
|
+
std::optional<std::string> reqbody;
|
|
287
|
+
if (!body.empty()) reqbody = body;
|
|
288
|
+
sekreto::Response res = sekreto::httprequest(method, url, h, reqbody);
|
|
289
|
+
out.ok = true;
|
|
290
|
+
out.status = res.status;
|
|
291
|
+
out.body = res.body;
|
|
292
|
+
} catch (const std::exception& e) {
|
|
293
|
+
out.ok = false;
|
|
294
|
+
out.err = std::string("secrets: token exchange transport failed: ") + e.what() +
|
|
295
|
+
" (URL was: \\"" + url + "\\")";
|
|
296
|
+
}
|
|
297
|
+
return out;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
} // namespace sdk
|
|
301
|
+
`)
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
|
|
24
309
|
// core/config.hpp: makeConfig() rebuilds the embedded API model by parsing a
|
|
25
310
|
// chunked JSON literal with the vendored struct parser; makeFeature(name) is
|
|
26
311
|
// the N-feature-safe by-name factory the client uses (mirrors Config_java /
|
|
@@ -53,6 +338,7 @@ const Config = cmp(async function Config(props: any) {
|
|
|
53
338
|
|
|
54
339
|
#include <memory>
|
|
55
340
|
#include <string>
|
|
341
|
+
#include <vector>
|
|
56
342
|
|
|
57
343
|
#include "../core/struct.hpp"
|
|
58
344
|
#include "../core/types.hpp"
|
|
@@ -107,6 +393,40 @@ inline FeaturePtr makeFeature(const std::string& name) {
|
|
|
107
393
|
|
|
108
394
|
Content(` return std::make_shared<BaseFeature>();
|
|
109
395
|
}
|
|
396
|
+
`)
|
|
397
|
+
|
|
398
|
+
// The plugin-definitions accessor, EMITTED UNCONDITIONALLY so a caller
|
|
399
|
+
// can always ask, and EMPTY unless a plugin-bearing feature is active:
|
|
400
|
+
// each such feature's list lives in its generated
|
|
401
|
+
// feature/<name>/kinds.cpp (see FeaturePlugins above), which this
|
|
402
|
+
// dispatches to by name, so this header never names the vendored
|
|
403
|
+
// plugin's types - the list is type-erased (std::shared_ptr<void>; the
|
|
404
|
+
// feature casts back to plugin::DefinitionPtr), the way go returns
|
|
405
|
+
// []any and c void**. The per-feature function is an ordinary extern
|
|
406
|
+
// declaration here and in the feature header alike; kinds.cpp defines
|
|
407
|
+
// it, and the generated kinds.mk has the Makefile compile it.
|
|
408
|
+
const plugged = Object.keys(pluginDefinitions(model, target)).sort()
|
|
409
|
+
|
|
410
|
+
Content(`
|
|
411
|
+
// The plugin definitions the model selected per feature (type-erased; see
|
|
412
|
+
// feature/<name>/kinds.cpp). Empty for a feature with none, and for a
|
|
413
|
+
// model with no plugin-bearing feature active.
|
|
414
|
+
`)
|
|
415
|
+
for (const fname of plugged) {
|
|
416
|
+
Content(`std::vector<std::shared_ptr<void>> ${fname}_plugins();
|
|
417
|
+
`)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
Content(`
|
|
421
|
+
inline std::vector<std::shared_ptr<void>> featurePlugins(const std::string& name) {
|
|
422
|
+
`)
|
|
423
|
+
for (const fname of plugged) {
|
|
424
|
+
Content(` if (name == "${fname}") return ${fname}_plugins();
|
|
425
|
+
`)
|
|
426
|
+
}
|
|
427
|
+
Content(` (void)name;
|
|
428
|
+
return {};
|
|
429
|
+
}
|
|
110
430
|
|
|
111
431
|
} // namespace sdk
|
|
112
432
|
|
|
@@ -117,5 +437,7 @@ inline FeaturePtr makeFeature(const std::string& name) {
|
|
|
117
437
|
|
|
118
438
|
|
|
119
439
|
export {
|
|
120
|
-
Config
|
|
440
|
+
Config,
|
|
441
|
+
FeaturePlugins,
|
|
442
|
+
pluginDefinitions,
|
|
121
443
|
}
|
|
@@ -12,6 +12,8 @@ const Gitignore = cmp(async function Gitignore(_props: any) {
|
|
|
12
12
|
test/*.out
|
|
13
13
|
*.o
|
|
14
14
|
*.out
|
|
15
|
+
# The gated secrets feature's vendored archive (tm/cpp/Makefile)
|
|
16
|
+
*.a
|
|
15
17
|
|
|
16
18
|
# Struct-corpus run report (written by test/struct_corpus_test.cpp)
|
|
17
19
|
corpus-scoreboard.json
|
|
@@ -3,8 +3,10 @@ import * as Path from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
cmp, each,
|
|
6
|
-
File,
|
|
7
|
-
TEST_CONTROL_EXCLUDE
|
|
6
|
+
File, Copy, Folder, Fragment,
|
|
7
|
+
TEST_CONTROL_EXCLUDE,
|
|
8
|
+
pluginExcludes,
|
|
9
|
+
targetFeatures,
|
|
8
10
|
} from '@voxgig/sdkgen'
|
|
9
11
|
|
|
10
12
|
|
|
@@ -20,7 +22,7 @@ import {
|
|
|
20
22
|
|
|
21
23
|
|
|
22
24
|
import { Package } from './Package_cpp'
|
|
23
|
-
import { Config } from './Config_cpp'
|
|
25
|
+
import { Config, FeaturePlugins } from './Config_cpp'
|
|
24
26
|
import { Gitignore } from './Gitignore_cpp'
|
|
25
27
|
import { MainEntity } from './MainEntity_cpp'
|
|
26
28
|
import { EntityBase } from './EntityBase_cpp'
|
|
@@ -34,15 +36,65 @@ const Main = cmp(async function Main(props: any) {
|
|
|
34
36
|
|
|
35
37
|
const entity: ModelEntity = getModelPath(model, `main.${KIT}.entity`)
|
|
36
38
|
|
|
39
|
+
// THE PLUGIN TRIM FOR A FEATURE THAT IS ITSELF OFF (Main_c's and
|
|
40
|
+
// Main_scala's inactivePluginExcludes, for the same reason).
|
|
41
|
+
//
|
|
42
|
+
// pluginExcludes(model) below walks only the model's ACTIVE features, so
|
|
43
|
+
// a `secrets` declared `active: false` keeps every declared group's
|
|
44
|
+
// vendored kind file in the tree. For cpp that is not merely untidy: the
|
|
45
|
+
// Makefile decides whether to compile the plugin layer - and to link
|
|
46
|
+
// OpenSSL - from whether a KIND FILE is present under
|
|
47
|
+
// feature/secrets/plugins/, so the files have to go. Every declared group
|
|
48
|
+
// of an inactive feature goes, not only the groups marked inactive: a
|
|
49
|
+
// feature that is off has no active plugins whatever its `plugin` map
|
|
50
|
+
// says (targetFeatures drops it before Config ever reads a group). The
|
|
51
|
+
// feature's own header and the vendored cores are left to the Makefile's
|
|
52
|
+
// wiring gate (feature/secrets/kinds.cpp is generated only for an active
|
|
53
|
+
// feature; without it nothing of the feature is compiled, and
|
|
54
|
+
// core/config.hpp includes no feature/secrets.hpp) and to `target add`,
|
|
55
|
+
// which trims the whole container for a real project.
|
|
56
|
+
//
|
|
57
|
+
// Rooting matches pluginExcludes': cpp's declared paths are
|
|
58
|
+
// target-root-relative, which is this Copy's root, and the other
|
|
59
|
+
// targets' paths in the same list cannot match anything in a cpp tree
|
|
60
|
+
// (every pattern is anchored at its own extension).
|
|
61
|
+
const feature = targetFeatures(model, target)
|
|
62
|
+
const esc = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
|
63
|
+
const allfeature = getModelPath(model, `main.${KIT}.feature`,
|
|
64
|
+
{ required: false, only_active: false }) || {}
|
|
65
|
+
const inactivePluginExcludes: RegExp[] = []
|
|
66
|
+
for (const fname of Object.keys(allfeature)) {
|
|
67
|
+
if (null != (feature as any)[fname]) continue
|
|
68
|
+
const groups = getModelPath(model, `main.${KIT}.feature.${fname}.plugin`,
|
|
69
|
+
{ required: false, only_active: false }) || {}
|
|
70
|
+
for (const gname of Object.keys(groups)) {
|
|
71
|
+
for (const one of (groups[gname].path || [])) {
|
|
72
|
+
const pat = esc(String(one))
|
|
73
|
+
inactivePluginExcludes.push(new RegExp('(^|/)' +
|
|
74
|
+
pat.replace(/\\\/$/, '') + (/\/$/.test(String(one)) ? '/' : '$')))
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
37
79
|
Package({ target })
|
|
38
80
|
|
|
39
81
|
Gitignore({})
|
|
40
82
|
|
|
41
83
|
// Copy tm/cpp verbatim (with placeholder substitution). The tm src/ subtree
|
|
42
84
|
// only stages the per-feature custom-source dirs (target add), so exclude it.
|
|
85
|
+
//
|
|
86
|
+
// pluginExcludes: the generate-time plugin trim (an INACTIVE plugin
|
|
87
|
+
// group's declared files stay out of the tree - the model's `path`
|
|
88
|
+
// entries are target-root-relative, which is this Copy's root). cpp has
|
|
89
|
+
// `srcfeature: false`, so the per-feature Copy in cmp/Feature.ts - where
|
|
90
|
+
// pluginExcludesFor normally applies this trim - never runs for it, and
|
|
91
|
+
// this whole-tree Copy is the ONLY copy the target has: without the
|
|
92
|
+
// exclude an active secrets feature would ship every inactive kind, and
|
|
93
|
+
// the Makefile would compile and link them all (Main_go.ts precedent).
|
|
43
94
|
Copy({
|
|
44
95
|
from: 'tm/' + target.name,
|
|
45
|
-
exclude: [/src\//, TEST_CONTROL_EXCLUDE
|
|
96
|
+
exclude: [/src\//, TEST_CONTROL_EXCLUDE,
|
|
97
|
+
...pluginExcludes(model), ...inactivePluginExcludes],
|
|
46
98
|
replace: {
|
|
47
99
|
...props.ctx$.stdrep,
|
|
48
100
|
}
|
|
@@ -82,6 +134,12 @@ const Main = cmp(async function Main(props: any) {
|
|
|
82
134
|
})
|
|
83
135
|
})
|
|
84
136
|
|
|
137
|
+
// feature/<name>/kinds.cpp — the plugin definitions an active
|
|
138
|
+
// plugin-bearing feature selected, and the Makefile's wiring gate for that
|
|
139
|
+
// feature's vendored payload (see Config_cpp). Nothing is emitted when no
|
|
140
|
+
// such feature is active.
|
|
141
|
+
FeaturePlugins({ target })
|
|
142
|
+
|
|
85
143
|
})
|
|
86
144
|
|
|
87
145
|
|
|
@@ -8,6 +8,16 @@ import {
|
|
|
8
8
|
// verbatim); there is no package manifest to generate (unlike pom.xml /
|
|
9
9
|
// Cargo.toml / go.mod). This component is a no-op kept for parity with the
|
|
10
10
|
// other targets' Main -> Package call.
|
|
11
|
+
//
|
|
12
|
+
// The Makefile stays a TEMPLATE even now that the gated `secrets` feature
|
|
13
|
+
// brings a multi-translation-unit payload: the Makefile names no feature
|
|
14
|
+
// and reads `-include $(wildcard feature/*/kinds.mk)`, so the same verbatim
|
|
15
|
+
// file is right for every model, and everything that differs per API -
|
|
16
|
+
// which payload to compile, which suite to build, which kinds were
|
|
17
|
+
// selected, whether OpenSSL is linked - is emitted by Config_cpp's
|
|
18
|
+
// FeaturePlugins as feature/secrets/kinds.mk and kinds.cpp, not here. (c
|
|
19
|
+
// makes the same choice; rust generates a module index instead because
|
|
20
|
+
// cargo has no wildcard.)
|
|
11
21
|
const Package = cmp(async function Package(_props: any) {
|
|
12
22
|
})
|
|
13
23
|
|
|
@@ -33,6 +33,58 @@ import {
|
|
|
33
33
|
} from './utility_lua'
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
// PLUGIN DEFINITION REQUIRES AND THE FEATURE PLUGINS TABLE (the lua peer
|
|
37
|
+
// of cmp/py/Config_py.ts's pluginImports/pluginDefs).
|
|
38
|
+
//
|
|
39
|
+
// Upstream sekreto replaced its self-registration registry with
|
|
40
|
+
// voxgig/plugin definitions: a provider kind the caller did not pass in via
|
|
41
|
+
// `plugins = { ... }` is unknown to that Sekreto. So the generated
|
|
42
|
+
// config_plugins module requires each active plugin's module and names the
|
|
43
|
+
// FIELD it exports (the model's `def.lua` map - `hashicorp` on
|
|
44
|
+
// plugins/hashicorp.lua, `awssecrets` AND `awsparams` on plugins/aws.lua),
|
|
45
|
+
// handing the list to the feature.
|
|
46
|
+
//
|
|
47
|
+
// A def value is the module's path under tm/lua, this target's root; the
|
|
48
|
+
// require is that path with `.lua` stripped and slashes turned to dots,
|
|
49
|
+
// resolved by the plain `?.lua` searcher every generated lua SDK relies on.
|
|
50
|
+
// One `local` per module, so a two-definition module is required once.
|
|
51
|
+
function pluginRequires(feature: any): { locals: string[], defs: Record<string, string[]> } {
|
|
52
|
+
const bypath: Record<string, { local: string, syms: string[] }> = {}
|
|
53
|
+
const defs: Record<string, string[]> = {}
|
|
54
|
+
|
|
55
|
+
each(feature, (f: any) => {
|
|
56
|
+
const syms: string[] = []
|
|
57
|
+
|
|
58
|
+
each(f.plugin, (plugin: any) => {
|
|
59
|
+
// Filter on `active` HERE rather than trusting the feature object to
|
|
60
|
+
// arrive filtered: getting it wrong in this direction emits a
|
|
61
|
+
// require for a module the plugin trim just deleted - an SDK that
|
|
62
|
+
// does not load, rather than one that merely carries too much.
|
|
63
|
+
if (false === plugin.active || null == plugin.active) return
|
|
64
|
+
|
|
65
|
+
for (const [sym, one] of Object.entries(plugin.def?.lua || {})) {
|
|
66
|
+
const path = String(one)
|
|
67
|
+
const local = path.replace(/^.*\//, '').replace(/\.lua$/, '')
|
|
68
|
+
const entry = (bypath[path] = bypath[path] || { local: 'plugin_' + local, syms: [] })
|
|
69
|
+
entry.syms.push(sym)
|
|
70
|
+
syms.push(entry.local + '.' + sym)
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
if (0 < syms.length) {
|
|
75
|
+
defs[f.name] = syms.sort()
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const locals = Object.keys(bypath).sort().map((path: string) => {
|
|
80
|
+
const mod = path.replace(/\.lua$/, '').replace(/\//g, '.')
|
|
81
|
+
return `local ${bypath[path].local} = require("${mod}")`
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
return { locals, defs }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
36
88
|
const Config = cmp(async function Config(props: any) {
|
|
37
89
|
const ctx$ = props.ctx$
|
|
38
90
|
const target = props.target
|
|
@@ -187,6 +239,42 @@ return make_config
|
|
|
187
239
|
`)
|
|
188
240
|
})
|
|
189
241
|
|
|
242
|
+
// The plugin definitions the model selected per feature, as a module of
|
|
243
|
+
// the config family. ALWAYS emitted, even with nothing declared: the
|
|
244
|
+
// secrets feature requires it (a missing module and a broken one must
|
|
245
|
+
// read differently there), and a feature source arrives in the tree by
|
|
246
|
+
// Main's blanket copy whether or not the model declares the feature.
|
|
247
|
+
//
|
|
248
|
+
// A sibling module rather than a member of `config`, for the reason
|
|
249
|
+
// config_shared is: `config` returns a bare function.
|
|
250
|
+
const plugins = pluginRequires(feature)
|
|
251
|
+
|
|
252
|
+
File({ name: 'config_plugins.' + target.ext }, () => {
|
|
253
|
+
Content(`-- ${model.const.Name} SDK feature plugin definitions
|
|
254
|
+
--
|
|
255
|
+
-- The sekreto plugin DEFINITIONS the model selected per feature, required
|
|
256
|
+
-- below from the modules the catalogue's active \`plugin.def\` entries
|
|
257
|
+
-- declare. Handed to each feature (secrets builds its Sekreto with them):
|
|
258
|
+
-- a provider kind not listed here is unknown to this SDK - the four
|
|
259
|
+
-- built-in kinds (env, memory, dotenv, file) come with the core and never
|
|
260
|
+
-- appear here.
|
|
261
|
+
${0 < plugins.locals.length ? '\n' + plugins.locals.join('\n') + '\n' : ''}
|
|
262
|
+
|
|
263
|
+
local FEATURE_PLUGINS = {
|
|
264
|
+
${Object.keys(plugins.defs).sort().map((fname: string) =>
|
|
265
|
+
` ["${fname}"] = {\n` +
|
|
266
|
+
plugins.defs[fname].map((sym: string) => ` ${sym},\n`).join('') +
|
|
267
|
+
` },\n`).join('')}}
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
-- The definitions list for one feature's chain; empty when the model
|
|
271
|
+
-- selected no plugin group for it.
|
|
272
|
+
return function(name)
|
|
273
|
+
return FEATURE_PLUGINS[name] or {}
|
|
274
|
+
end
|
|
275
|
+
`)
|
|
276
|
+
})
|
|
277
|
+
|
|
190
278
|
// A sibling module rather than a member of `config`: `config` returns a
|
|
191
279
|
// bare function (`require("config")()`), and turning it into a table would
|
|
192
280
|
// change its observable type for any consumer holding it as a factory.
|
|
@@ -16,6 +16,10 @@ const Gitignore = cmp(async function Gitignore(_props: any) {
|
|
|
16
16
|
*.dylib
|
|
17
17
|
*.dll
|
|
18
18
|
|
|
19
|
+
# The sekreto transport helper the secrets feature's plugin kinds run,
|
|
20
|
+
# compiled by \`make build\` from feature/secrets/native/sekretonet.c
|
|
21
|
+
feature/secrets/native/sekreto-net
|
|
22
|
+
|
|
19
23
|
# LuaRocks
|
|
20
24
|
.luarocks/
|
|
21
25
|
lua_modules/
|