@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
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (c/src/config.c)
|
|
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
|
+
/* The declarative document (§9): normalization, and the ten-level
|
|
5
|
+
* precedence ladder.
|
|
6
|
+
*
|
|
7
|
+
* TWO FUNCTIONS, AND THE SPLIT BETWEEN THEM IS FORCED.
|
|
8
|
+
*
|
|
9
|
+
* `normalizeconfig` normalizes STRUCTURE and ENTRY KEYS. It does not
|
|
10
|
+
* merge options, and cannot: §9.4 makes merge behaviour a property of
|
|
11
|
+
* the definition's option SHAPE, which normalization has never seen. A
|
|
12
|
+
* normalizer that flattened the option layers would make
|
|
13
|
+
* `$MERGE: append` unimplementable at load time, because the layers it
|
|
14
|
+
* must concatenate would already be collapsed.
|
|
15
|
+
*
|
|
16
|
+
* `resolveoptions` applies the ladder, and it is the only place that
|
|
17
|
+
* knows the shape. */
|
|
18
|
+
|
|
19
|
+
#include <stdio.h>
|
|
20
|
+
#include <stdlib.h>
|
|
21
|
+
#include <string.h>
|
|
22
|
+
|
|
23
|
+
#include "config.h"
|
|
24
|
+
#include "ref.h"
|
|
25
|
+
|
|
26
|
+
/* Byte-wise, NOT locale-aware and NOT case-folded. All-lowercase refs
|
|
27
|
+
* sort identically under all three, so only mixed input discriminates:
|
|
28
|
+
* '@' is 0x40, uppercase 0x41-0x5A, lowercase 0x61-0x7A. */
|
|
29
|
+
static int bytewise(const void *a, const void *b) {
|
|
30
|
+
return strcmp(*(const char *const *)a, *(const char *const *)b);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* §9.1: reservation is all-or-nothing per NAME, so the tagged forms go
|
|
34
|
+
* too. A configuration surface that can disable the thing reading it is
|
|
35
|
+
* not a surface, it is a trap. */
|
|
36
|
+
static void checkreserved(const char *ref, Value *reserved) {
|
|
37
|
+
if (!vislist(reserved) || 0 == vlen(reserved)) return;
|
|
38
|
+
const char *name = refname(ref);
|
|
39
|
+
for (size_t i = 0; i < vlen(reserved); i++) {
|
|
40
|
+
Value *r = vat(reserved, i);
|
|
41
|
+
if (visstr(r) && 0 == strcmp(vasstr(r), name)) {
|
|
42
|
+
size_t sz = strlen(ref) + 48;
|
|
43
|
+
char *text = (char *)arena_alloc(sz);
|
|
44
|
+
snprintf(text, sz, "ref is reserved by the host: %s", ref);
|
|
45
|
+
fail("plugin_ref_reserved", text, details1("ref", vstr(ref)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Both document forms reduce to {ref -> entry} plus the order the form
|
|
51
|
+
* implies: array POSITION for the array form, sorted refs for the map
|
|
52
|
+
* form. */
|
|
53
|
+
typedef struct {
|
|
54
|
+
Value *map; /* ref -> entry */
|
|
55
|
+
Value *order; /* list of refs */
|
|
56
|
+
} Entries;
|
|
57
|
+
|
|
58
|
+
static Entries entriesof(Value *src) {
|
|
59
|
+
Entries out;
|
|
60
|
+
out.map = vmap();
|
|
61
|
+
out.order = vlist();
|
|
62
|
+
if (visnull(src)) return out;
|
|
63
|
+
|
|
64
|
+
if (vislist(src)) {
|
|
65
|
+
for (size_t i = 0; i < vlen(src); i++) {
|
|
66
|
+
Value *item = vat(src, i);
|
|
67
|
+
const char *ref = canonref(vget(item, "ref"));
|
|
68
|
+
vset(out.map, ref, item);
|
|
69
|
+
vpush(out.order, vstr(ref));
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Map-form refs arrive as KEYS, through a different path than an
|
|
75
|
+
* array element's `ref` field — and must canonicalize the same way. */
|
|
76
|
+
const char **keys;
|
|
77
|
+
size_t n = vkeys(src, &keys);
|
|
78
|
+
for (size_t i = 0; i < n; i++) {
|
|
79
|
+
vset(out.map, canonref(vstr(keys[i])), vget(src, keys[i]));
|
|
80
|
+
}
|
|
81
|
+
const char **canonkeys;
|
|
82
|
+
size_t cn = vkeys(out.map, &canonkeys);
|
|
83
|
+
if (1 < cn) qsort((void *)canonkeys, cn, sizeof(char *), bytewise);
|
|
84
|
+
for (size_t i = 0; i < cn; i++) vpush(out.order, vstr(canonkeys[i]));
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* PRESENT WINS, EVEN WHEN THE VALUE IS NULL. The canonical is
|
|
89
|
+
* `src && undefined !== src[key]`, and in JavaScript a key holding
|
|
90
|
+
* `null` passes that test — so a profile's `order: null` clears a base
|
|
91
|
+
* ordering block and `active: null` over a base `active: true` is
|
|
92
|
+
* falsy, and barred. Testing for non-null instead treated an authored
|
|
93
|
+
* null as an absent key, which is §9.1's distinction inverted. */
|
|
94
|
+
static Value *pick(Value *src, const char *key, Value *dflt) {
|
|
95
|
+
if (vismap(src) && vhas(src, key)) return vget(src, key);
|
|
96
|
+
return dflt;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static bool listhas(Value *list, const char *s) {
|
|
100
|
+
for (size_t i = 0; i < vlen(list); i++) {
|
|
101
|
+
if (visstr(vat(list, i)) && 0 == strcmp(vasstr(vat(list, i)), s)) return true;
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
Value *normalizeconfig(Value *input) {
|
|
107
|
+
Value *doc = vget(input, "doc");
|
|
108
|
+
if (!vismap(doc)) doc = vmap();
|
|
109
|
+
Value *keys = vget(input, "keys");
|
|
110
|
+
const char *ikey = visstr(vget(keys, "instance")) ? vasstr(vget(keys, "instance")) : "instance";
|
|
111
|
+
const char *dkey = visstr(vget(keys, "default")) ? vasstr(vget(keys, "default")) : "default";
|
|
112
|
+
Value *reserved = vget(input, "reserved");
|
|
113
|
+
Value *profile = vget(input, "profile");
|
|
114
|
+
|
|
115
|
+
/* The rename is applied at TWO PLACES AND NO OTHERS: the document
|
|
116
|
+
* root, and every profile.<name> overlay root (§9.1). A rename applied
|
|
117
|
+
* only at the root would leave `profile.prod.sdk` untranslated and
|
|
118
|
+
* silently drop every environment override the host depends on.
|
|
119
|
+
* Recursing further would be worse: option data is the definition's. */
|
|
120
|
+
Value *baseinst = vget(doc, ikey);
|
|
121
|
+
Value *basedef = vget(doc, dkey);
|
|
122
|
+
if (!vismap(basedef)) basedef = vmap();
|
|
123
|
+
|
|
124
|
+
Value *overlay = NULL;
|
|
125
|
+
if (visstr(profile)) {
|
|
126
|
+
Value *profiles = vget(doc, "profile");
|
|
127
|
+
overlay = vget(profiles, vasstr(profile));
|
|
128
|
+
}
|
|
129
|
+
Value *overinst = vismap(overlay) ? vget(overlay, ikey) : NULL;
|
|
130
|
+
Value *overdef = vismap(overlay) ? vget(overlay, dkey) : NULL;
|
|
131
|
+
if (!vismap(overdef)) overdef = vmap();
|
|
132
|
+
|
|
133
|
+
Entries base = entriesof(baseinst);
|
|
134
|
+
Entries over = entriesof(overinst);
|
|
135
|
+
|
|
136
|
+
const char **rk;
|
|
137
|
+
size_t rn = vkeys(base.map, &rk);
|
|
138
|
+
for (size_t i = 0; i < rn; i++) checkreserved(rk[i], reserved);
|
|
139
|
+
rn = vkeys(over.map, &rk);
|
|
140
|
+
for (size_t i = 0; i < rn; i++) checkreserved(rk[i], reserved);
|
|
141
|
+
rn = vkeys(basedef, &rk);
|
|
142
|
+
for (size_t i = 0; i < rn; i++) checkreserved(rk[i], reserved);
|
|
143
|
+
rn = vkeys(overdef, &rk);
|
|
144
|
+
for (size_t i = 0; i < rn; i++) checkreserved(rk[i], reserved);
|
|
145
|
+
|
|
146
|
+
/* A PARTIAL ARRAY IS NOT A FILTER (§9.1). sdkgen learned this the hard
|
|
147
|
+
* way: deriving order from a partial array silently dropped
|
|
148
|
+
* config-activated features. Refs in the base but absent from the
|
|
149
|
+
* overlay still load, in sorted position AFTER the listed ones. A
|
|
150
|
+
* profile may also INTRODUCE a ref the base never declared. */
|
|
151
|
+
Value *order = vlist();
|
|
152
|
+
for (size_t i = 0; i < vlen(over.order); i++) {
|
|
153
|
+
const char *r = vasstr(vat(over.order, i));
|
|
154
|
+
if (!listhas(order, r)) vpush(order, vstr(r));
|
|
155
|
+
}
|
|
156
|
+
/* The remainder keeps the BASE's own order — array position for the
|
|
157
|
+
* array form, sorted refs for the map form. Re-sorting here would
|
|
158
|
+
* discard an array document's positional order entirely, which is the
|
|
159
|
+
* one thing the array form exists to express. */
|
|
160
|
+
for (size_t i = 0; i < vlen(base.order); i++) {
|
|
161
|
+
const char *r = vasstr(vat(base.order, i));
|
|
162
|
+
if (!listhas(order, r)) vpush(order, vstr(r));
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
Value *instance = vmap();
|
|
166
|
+
for (size_t i = 0; i < vlen(order); i++) {
|
|
167
|
+
const char *ref = vasstr(vat(order, i));
|
|
168
|
+
Value *b = vget(base.map, ref);
|
|
169
|
+
Value *o = vget(over.map, ref);
|
|
170
|
+
|
|
171
|
+
/* MERGE THE ENTRIES AS AUTHORED, THEN APPLY DEFAULTS TO THE RESULT
|
|
172
|
+
* (§9.3). A safety rule, not a tidiness one: if the overlay had its
|
|
173
|
+
* defaults filled in before merging it would carry a synthesized
|
|
174
|
+
* active:true and overwrite a base's false — silently re-enabling a
|
|
175
|
+
* deliberately disabled integration in production. */
|
|
176
|
+
Value *active = pick(o, "active", pick(b, "active", vbool(true)));
|
|
177
|
+
Value *start = pick(o, "start", pick(b, "start", vstr("eager")));
|
|
178
|
+
Value *ord = pick(o, "order", pick(b, "order", NULL));
|
|
179
|
+
|
|
180
|
+
/* Option layers, levels 3-6, IN LADDER ORDER. Never merged here. */
|
|
181
|
+
Value *layers = vlist();
|
|
182
|
+
const char *nm = refname(ref);
|
|
183
|
+
Value *bd = vget(basedef, nm);
|
|
184
|
+
if (vismap(bd) && vhas(bd, "options")) vpush(layers, vget(bd, "options"));
|
|
185
|
+
if (vismap(b) && vhas(b, "options")) vpush(layers, vget(b, "options"));
|
|
186
|
+
Value *od = vget(overdef, nm);
|
|
187
|
+
if (vismap(od) && vhas(od, "options")) vpush(layers, vget(od, "options"));
|
|
188
|
+
if (vismap(o) && vhas(o, "options")) vpush(layers, vget(o, "options"));
|
|
189
|
+
|
|
190
|
+
Value *ent = vmap();
|
|
191
|
+
vset(ent, "pos", vnum((double)i));
|
|
192
|
+
vset(ent, "active", active);
|
|
193
|
+
vset(ent, "start", start);
|
|
194
|
+
vset(ent, "optionlayers", layers);
|
|
195
|
+
if (NULL != ord) vset(ent, "order", ord);
|
|
196
|
+
vset(instance, ref, ent);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* `default` DECLARES NOTHING (§9.3). It is a base for every instance
|
|
200
|
+
* of that definition; it does not create one, and an entry for a name
|
|
201
|
+
* with no instances is inert rather than an error — which is what
|
|
202
|
+
* makes a shared library of defaults shippable. */
|
|
203
|
+
Value *defout = vmap();
|
|
204
|
+
size_t dn = vkeys(basedef, &rk);
|
|
205
|
+
for (size_t i = 0; i < dn; i++) vset(defout, rk[i], vget(basedef, rk[i]));
|
|
206
|
+
dn = vkeys(overdef, &rk);
|
|
207
|
+
for (size_t i = 0; i < dn; i++) vset(defout, rk[i], vget(overdef, rk[i]));
|
|
208
|
+
|
|
209
|
+
Value *out = vmap();
|
|
210
|
+
vset(out, "instance", instance);
|
|
211
|
+
vset(out, "order", order);
|
|
212
|
+
vset(out, "default", defout);
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* ------------------------------------------------------------------ */
|
|
217
|
+
/* resolveoptions — §9.3's ten levels, and §9.4's merge directives */
|
|
218
|
+
/* ------------------------------------------------------------------ */
|
|
219
|
+
|
|
220
|
+
/* §9.4: N is an integer of at least 1, and everything else is an error.
|
|
221
|
+
*
|
|
222
|
+
* `{"deep": 0}` is rejected DESPITE having an obvious reading, because
|
|
223
|
+
* "replace at this key" already has a spelling and two spellings for one
|
|
224
|
+
* behaviour is the defect class this repo exists to avoid. Without the
|
|
225
|
+
* stated domain each port picks its own reading — reject, replace,
|
|
226
|
+
* unlimited merge, or clamp to 1 — and the same document resolves
|
|
227
|
+
* differently per language. */
|
|
228
|
+
void checkshape(Value *shape) {
|
|
229
|
+
if (!vismap(shape)) return;
|
|
230
|
+
const char **keys;
|
|
231
|
+
size_t n = vkeys(shape, &keys);
|
|
232
|
+
for (size_t i = 0; i < n; i++) {
|
|
233
|
+
Value *v = vget(shape, keys[i]);
|
|
234
|
+
if (!vismap(v) || !vhas(v, "$MERGE")) continue;
|
|
235
|
+
Value *d = vget(v, "$MERGE");
|
|
236
|
+
|
|
237
|
+
if (visstr(d)) {
|
|
238
|
+
const char *w = vasstr(d);
|
|
239
|
+
if (0 == strcmp(w, "replace") || 0 == strcmp(w, "append")) continue;
|
|
240
|
+
size_t sz = strlen(keys[i]) + strlen(w) + 64;
|
|
241
|
+
char *text = (char *)arena_alloc(sz);
|
|
242
|
+
snprintf(text, sz, "invalid $MERGE directive at %s: %s", keys[i], w);
|
|
243
|
+
fail("plugin_shape_invalid", text,
|
|
244
|
+
details2("key", vstr(keys[i]), "directive", d));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (vismap(d) && vhas(d, "deep")) {
|
|
248
|
+
Value *nv = vget(d, "deep");
|
|
249
|
+
double x = vasnum(nv);
|
|
250
|
+
if (!visnum(nv) || x != (double)(long long)x || 1 > x) {
|
|
251
|
+
const char *shown = vjson(nv);
|
|
252
|
+
size_t sz = strlen(keys[i]) + strlen(shown) + 64;
|
|
253
|
+
char *text = (char *)arena_alloc(sz);
|
|
254
|
+
snprintf(text, sz, "invalid $MERGE deep at %s: %s", keys[i], shown);
|
|
255
|
+
fail("plugin_shape_invalid", text,
|
|
256
|
+
details2("key", vstr(keys[i]), "directive", d));
|
|
257
|
+
}
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const char *shown = vjson(d);
|
|
262
|
+
size_t sz = strlen(keys[i]) + strlen(shown) + 64;
|
|
263
|
+
char *text = (char *)arena_alloc(sz);
|
|
264
|
+
snprintf(text, sz, "invalid $MERGE directive at %s: %s", keys[i], shown);
|
|
265
|
+
fail("plugin_shape_invalid", text,
|
|
266
|
+
details2("key", vstr(keys[i]), "directive", d));
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* The shape's non-directive values are the level-1 defaults. */
|
|
271
|
+
static Value *defaultsof(Value *shape) {
|
|
272
|
+
Value *out = vmap();
|
|
273
|
+
if (!vismap(shape)) return out;
|
|
274
|
+
const char **keys;
|
|
275
|
+
size_t n = vkeys(shape, &keys);
|
|
276
|
+
for (size_t i = 0; i < n; i++) {
|
|
277
|
+
Value *v = vget(shape, keys[i]);
|
|
278
|
+
if (vismap(v) && vhas(v, "$MERGE")) continue;
|
|
279
|
+
vset(out, keys[i], v);
|
|
280
|
+
}
|
|
281
|
+
return out;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
static Value *optsof(Value *src, const char *key) {
|
|
285
|
+
if (visnull(src)) return NULL;
|
|
286
|
+
/* The array form is equivalent to the map form (§9.1). */
|
|
287
|
+
if (vislist(src)) {
|
|
288
|
+
for (size_t i = 0; i < vlen(src); i++) {
|
|
289
|
+
Value *item = vat(src, i);
|
|
290
|
+
if (0 == strcmp(canonref(vget(item, "ref")), key)) {
|
|
291
|
+
return vhas(item, "options") ? vget(item, "options") : NULL;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return NULL;
|
|
295
|
+
}
|
|
296
|
+
const char **keys;
|
|
297
|
+
size_t n = vkeys(src, &keys);
|
|
298
|
+
for (size_t i = 0; i < n; i++) {
|
|
299
|
+
if (0 == strcmp(canonref(vstr(keys[i])), key)) {
|
|
300
|
+
Value *e = vget(src, keys[i]);
|
|
301
|
+
return vhas(e, "options") ? vget(e, "options") : NULL;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return NULL;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/* Merge N levels below this key, replace below that. */
|
|
308
|
+
static Value *deepto(Value *base, Value *over, long n) {
|
|
309
|
+
if (0 >= n) return vclone(over);
|
|
310
|
+
if (!vismap(base) || !vismap(over)) return vclone(over);
|
|
311
|
+
Value *out = vmap();
|
|
312
|
+
const char **keys;
|
|
313
|
+
size_t kn = vkeys(base, &keys);
|
|
314
|
+
for (size_t i = 0; i < kn; i++) vset(out, keys[i], vget(base, keys[i]));
|
|
315
|
+
kn = vkeys(over, &keys);
|
|
316
|
+
for (size_t i = 0; i < kn; i++) {
|
|
317
|
+
vset(out, keys[i], deepto(vget(out, keys[i]), vget(over, keys[i]), n - 1));
|
|
318
|
+
}
|
|
319
|
+
return out;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* Merge ONE layer onto the accumulator, honouring the shape's
|
|
323
|
+
* directives. The directive holds at EVERY precedence level, not only
|
|
324
|
+
* between document levels — §9.4 makes it a property of the shape,
|
|
325
|
+
* which does not know which layer a value arrived from. */
|
|
326
|
+
static Value *mergeone(Value *base, Value *over, Value *shape) {
|
|
327
|
+
if (visnull(over)) return base;
|
|
328
|
+
if (!vismap(base) || !vismap(over)) return vclone(over);
|
|
329
|
+
|
|
330
|
+
Value *out = vmap();
|
|
331
|
+
const char **keys;
|
|
332
|
+
size_t n = vkeys(base, &keys);
|
|
333
|
+
for (size_t i = 0; i < n; i++) vset(out, keys[i], vget(base, keys[i]));
|
|
334
|
+
|
|
335
|
+
n = vkeys(over, &keys);
|
|
336
|
+
for (size_t i = 0; i < n; i++) {
|
|
337
|
+
const char *k = keys[i];
|
|
338
|
+
Value *entry = vismap(shape) ? vget(shape, k) : NULL;
|
|
339
|
+
Value *directive = vismap(entry) ? vget(entry, "$MERGE") : NULL;
|
|
340
|
+
Value *b = vget(out, k);
|
|
341
|
+
Value *o = vget(over, k);
|
|
342
|
+
|
|
343
|
+
if (visstr(directive) && 0 == strcmp(vasstr(directive), "replace")) {
|
|
344
|
+
vset(out, k, vclone(o));
|
|
345
|
+
}
|
|
346
|
+
else if (visstr(directive) && 0 == strcmp(vasstr(directive), "append")) {
|
|
347
|
+
Value *merged = vlist();
|
|
348
|
+
if (vislist(b)) {
|
|
349
|
+
for (size_t j = 0; j < vlen(b); j++) vpush(merged, vat(b, j));
|
|
350
|
+
}
|
|
351
|
+
if (vislist(o)) {
|
|
352
|
+
for (size_t j = 0; j < vlen(o); j++) vpush(merged, vat(o, j));
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
vpush(merged, o);
|
|
356
|
+
}
|
|
357
|
+
vset(out, k, merged);
|
|
358
|
+
}
|
|
359
|
+
else if (vismap(directive) && vhas(directive, "deep")) {
|
|
360
|
+
vset(out, k, deepto(b, o, (long)vasnum(vget(directive, "deep"))));
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
/* Library default: deep for maps, REPLACE for lists. struct.merge
|
|
364
|
+
* is element-wise by index, which for option maps is nearly always
|
|
365
|
+
* wrong — ["a"] over ["x","y","z"] yielding ["a","y","z"] is the
|
|
366
|
+
* defect station hit on secrets.providers. */
|
|
367
|
+
if (vismap(b) && vismap(o)) vset(out, k, mergeone(b, o, NULL));
|
|
368
|
+
else vset(out, k, vclone(o));
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return out;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
Value *resolveoptions(Value *input) {
|
|
375
|
+
Value *shape = vget(input, "shape");
|
|
376
|
+
if (!vismap(shape)) shape = vmap();
|
|
377
|
+
checkshape(shape);
|
|
378
|
+
|
|
379
|
+
const char *ref = canonref(vget(input, "ref"));
|
|
380
|
+
const char *name = refname(ref);
|
|
381
|
+
Value *doc = vget(input, "doc");
|
|
382
|
+
if (!vismap(doc)) doc = vmap();
|
|
383
|
+
|
|
384
|
+
Value *profile = vget(input, "profile");
|
|
385
|
+
Value *overlay = NULL;
|
|
386
|
+
if (visstr(profile)) {
|
|
387
|
+
overlay = vget(vget(doc, "profile"), vasstr(profile));
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* ONE ordered merge, lowest to highest. Levels 3-6 are not two
|
|
391
|
+
* namespaces collapsed separately and composed afterwards: that
|
|
392
|
+
* inverts the rule that PROFILE SPECIFICITY OUTRANKS DEFINITION
|
|
393
|
+
* SPECIFICITY, so a prod per-definition default would lose to a base
|
|
394
|
+
* instance value. */
|
|
395
|
+
Value *layers[10];
|
|
396
|
+
layers[0] = defaultsof(shape); /* 1 */
|
|
397
|
+
layers[1] = vget(input, "hostdefaults"); /* 2 */
|
|
398
|
+
layers[2] = optsof(vget(doc, "default"), name); /* 3 */
|
|
399
|
+
layers[3] = optsof(vget(doc, "instance"), ref); /* 4 */
|
|
400
|
+
layers[4] = optsof(vismap(overlay) ? vget(overlay, "default") : NULL, name); /* 5 */
|
|
401
|
+
layers[5] = optsof(vismap(overlay) ? vget(overlay, "instance") : NULL, ref); /* 6 */
|
|
402
|
+
layers[6] = vget(input, "env"); /* 7 */
|
|
403
|
+
layers[7] = vget(input, "hostoptions"); /* 8 */
|
|
404
|
+
layers[8] = vget(input, "loadoptions"); /* 9 */
|
|
405
|
+
layers[9] = vget(input, "patch"); /* 10 */
|
|
406
|
+
|
|
407
|
+
Value *out = vmap();
|
|
408
|
+
for (int i = 0; i < 10; i++) {
|
|
409
|
+
if (visnull(layers[i])) continue;
|
|
410
|
+
out = mergeone(out, layers[i], shape);
|
|
411
|
+
}
|
|
412
|
+
return out;
|
|
413
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (c/src/config.h)
|
|
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
|
+
/* The declarative document (§9): normalization, and the ten-level
|
|
5
|
+
* precedence ladder. See config.c for why the two functions are split. */
|
|
6
|
+
|
|
7
|
+
#ifndef VOXGIG_PLUGIN_CONFIG_H
|
|
8
|
+
#define VOXGIG_PLUGIN_CONFIG_H
|
|
9
|
+
|
|
10
|
+
#include "types.h"
|
|
11
|
+
#include "value.h"
|
|
12
|
+
|
|
13
|
+
/* {instance: {ref -> entry}, order: [ref], default: {name -> entry}} */
|
|
14
|
+
Value *normalizeconfig(Value *input);
|
|
15
|
+
|
|
16
|
+
/* §9.3's ten levels, and §9.4's merge directives. */
|
|
17
|
+
Value *resolveoptions(Value *input);
|
|
18
|
+
|
|
19
|
+
/* §9.4: validated WHEN THE SHAPE ENTERS THE CATALOG, not when a
|
|
20
|
+
* document exercises the key — so a malformed shape fails once, and in
|
|
21
|
+
* the same place everywhere. `declare/shape` pins the timing. */
|
|
22
|
+
void checkshape(Value *shape);
|
|
23
|
+
|
|
24
|
+
#endif
|