@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,232 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/depend.lua)
|
|
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
|
+
-- Dependency cardinality, policy, and the restart graph (section 11.3).
|
|
5
|
+
--
|
|
6
|
+
-- TWO AXES, BOTH DECLARED BY THE DEFINITION THAT HAS THE REQUIREMENT,
|
|
7
|
+
-- because only it knows what it can cope with:
|
|
8
|
+
--
|
|
9
|
+
-- | static (default) | dynamic
|
|
10
|
+
-- -------------|---------------------------|--------------------------
|
|
11
|
+
-- mandatory | unmet -> pending; | unmet -> pending;
|
|
12
|
+
-- (default) | lost -> pending, | lost -> STAYS LIVE,
|
|
13
|
+
-- | recursively | notified
|
|
14
|
+
-- -------------|---------------------------|--------------------------
|
|
15
|
+
-- optional:true| never gates activation; | never gates activation;
|
|
16
|
+
-- | a change deactivates and | a change is a
|
|
17
|
+
-- | reactivates | notification, nothing else
|
|
18
|
+
--
|
|
19
|
+
-- `dynamic` means the plugin has said, IN WRITING, that it can survive its
|
|
20
|
+
-- provider being swapped underneath it. It is not the default because most
|
|
21
|
+
-- plugins cannot, and the cost of wrongly assuming they can is a live
|
|
22
|
+
-- instance holding a dead reference.
|
|
23
|
+
--
|
|
24
|
+
-- The rebinding-preference axis is deliberately omitted. OSGi has
|
|
25
|
+
-- reluctant vs greedy and it is a knob every author must understand to
|
|
26
|
+
-- read anyone else's component; we take always-reluctant. Three axes were
|
|
27
|
+
-- more than the model can carry across twenty ports.
|
|
28
|
+
|
|
29
|
+
local T = require 'feature.secrets.plugin.types'
|
|
30
|
+
local R = require 'feature.secrets.plugin.ref'
|
|
31
|
+
|
|
32
|
+
local M = {}
|
|
33
|
+
|
|
34
|
+
-- A bare string is shorthand for `{name}`.
|
|
35
|
+
function M.normrequire(raw)
|
|
36
|
+
if 'string' == type(raw) then
|
|
37
|
+
return T.map { name = raw }
|
|
38
|
+
end
|
|
39
|
+
if not T.ismap(raw) then return T.map {} end
|
|
40
|
+
local out = T.map {}
|
|
41
|
+
for k, v in pairs(raw) do out[k] = v end
|
|
42
|
+
return out
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
-- The requirements a definition declared, normalized.
|
|
46
|
+
--
|
|
47
|
+
-- BOTH AXES ARE READ AT TWO LEVELS, AND THE PER-REQUIREMENT ONE WINS.
|
|
48
|
+
--
|
|
49
|
+
-- The instance-level `policy` and `optional` list are how a DOCUMENT
|
|
50
|
+
-- states the axis without editing the definition, and they apply to every
|
|
51
|
+
-- requirement. The per-requirement form is the one section 11.1's object
|
|
52
|
+
-- syntax exists for, and it is strictly more expressive: an instance that
|
|
53
|
+
-- is `static` on its store and `dynamic` on its metrics cannot be written
|
|
54
|
+
-- at all at the instance level.
|
|
55
|
+
--
|
|
56
|
+
-- `optional` unions rather than overriding - both spellings are statements
|
|
57
|
+
-- that this requirement need not gate activation, and there is no reading
|
|
58
|
+
-- under which one of them means "actually, mandatory".
|
|
59
|
+
function M.requirements(options)
|
|
60
|
+
local raw = T.getv(options, 'requires') or T.list {}
|
|
61
|
+
local marked = T.getv(options, 'optional')
|
|
62
|
+
local fallback = T.getv(options, 'policy')
|
|
63
|
+
|
|
64
|
+
local out = {}
|
|
65
|
+
for i = 1, T.len(raw) do
|
|
66
|
+
local req = M.normrequire(raw[i])
|
|
67
|
+
local ismarked = false
|
|
68
|
+
if T.islist(marked) then
|
|
69
|
+
for j = 1, #marked do
|
|
70
|
+
if T.same(marked[j], T.getv(req, 'name')) then ismarked = true break end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
if T.truthy(T.getv(req, 'optional')) or ismarked then
|
|
74
|
+
req.optional = true
|
|
75
|
+
end
|
|
76
|
+
if nil == T.getv(req, 'policy') and nil ~= fallback then
|
|
77
|
+
req.policy = fallback
|
|
78
|
+
end
|
|
79
|
+
out[#out + 1] = req
|
|
80
|
+
end
|
|
81
|
+
return out
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
-- Does losing this requirement's SELECTED provider restart the consumer?
|
|
85
|
+
-- The mandatory ones under `static`, and the `static` optional ones - both
|
|
86
|
+
-- make a capability change deactivate and reactivate. `dynamic` never
|
|
87
|
+
-- restarts.
|
|
88
|
+
function M.restartsonloss(req)
|
|
89
|
+
return 'dynamic' ~= (T.getv(req, 'policy') or 'static')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
-- Does an unmet requirement keep the consumer out of `live`?
|
|
93
|
+
--
|
|
94
|
+
-- Cardinality alone decides this, NOT policy. `dynamic` is a statement
|
|
95
|
+
-- about surviving a SWAP, not about starting without the thing at all - a
|
|
96
|
+
-- mandatory-dynamic consumer still waits in `pending` for its first
|
|
97
|
+
-- provider.
|
|
98
|
+
function M.gatesactivation(req)
|
|
99
|
+
return true ~= T.getv(req, 'optional')
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
-- Edges that can cause a restart, which is exactly the set a cycle must be
|
|
103
|
+
-- detected over (section 11.3).
|
|
104
|
+
--
|
|
105
|
+
-- ONLY `dynamic` OPTIONAL EDGES ARE EXCLUDED, and they are the ones the
|
|
106
|
+
-- exclusion was for: two plugins that optionally and dynamically consume
|
|
107
|
+
-- each other's capabilities both activate happily, neither gates on the
|
|
108
|
+
-- other, and each is merely notified when the other appears. Nothing
|
|
109
|
+
-- restarts, so nothing oscillates.
|
|
110
|
+
--
|
|
111
|
+
-- An earlier draft of section 11.3 excluded EVERY optional edge and
|
|
112
|
+
-- thereby admitted the non-terminating case it was trying to permit.
|
|
113
|
+
function M.restartcausing(req)
|
|
114
|
+
return M.gatesactivation(req) or M.restartsonloss(req)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
-- A cycle through restart-causing requirements is
|
|
118
|
+
-- `plugin_dependency_cycle`, detected AT LOAD - before anything runs,
|
|
119
|
+
-- because the failure it describes is a non-terminating reconcile and the
|
|
120
|
+
-- only safe time to report that is before it starts.
|
|
121
|
+
--
|
|
122
|
+
-- The graph is over capabilities, not refs: an edge runs from a consumer
|
|
123
|
+
-- to EVERY node that provides what it needs, because any of them could be
|
|
124
|
+
-- the one selected and a cycle through any is a cycle. A node also
|
|
125
|
+
-- satisfies its own name as a ref (section 11.1), which is why the ref is
|
|
126
|
+
-- a provider of itself here.
|
|
127
|
+
--
|
|
128
|
+
-- `nodes` is a plain lua array of {ref=, provides=, requires=} records.
|
|
129
|
+
function M.dependencycycle(nodes)
|
|
130
|
+
-- TWO INDEXES, NOT ONE MERGED MAP. Capability names and refs are
|
|
131
|
+
-- matched differently - a capability by its exact name, a ref through
|
|
132
|
+
-- the canonical spelling (section 4 rule 5) - and one map keyed by both
|
|
133
|
+
-- can only do one of them. Keyed by both and looked up raw, as this
|
|
134
|
+
-- was, a cycle spelled `a$`/`b$` found no providers and EVADED the
|
|
135
|
+
-- load-time check that exists to catch a non-terminating reconcile.
|
|
136
|
+
local bycap = {}
|
|
137
|
+
local isref = {}
|
|
138
|
+
for _, n in ipairs(nodes) do
|
|
139
|
+
isref[n.ref] = true
|
|
140
|
+
for _, cap in ipairs(n.provides) do
|
|
141
|
+
if nil == bycap[cap] then bycap[cap] = {} end
|
|
142
|
+
table.insert(bycap[cap], n.ref)
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
local edges = {}
|
|
147
|
+
local starts = {}
|
|
148
|
+
for _, n in ipairs(nodes) do
|
|
149
|
+
local out = {}
|
|
150
|
+
local seen = {}
|
|
151
|
+
for _, req in ipairs(n.requires) do
|
|
152
|
+
if M.restartcausing(req) then
|
|
153
|
+
local reqname = T.getv(req, 'name')
|
|
154
|
+
local from = {}
|
|
155
|
+
for _, p in ipairs(bycap[reqname] or {}) do from[#from + 1] = p end
|
|
156
|
+
-- A node satisfies its own name AS A REF (section 11.1),
|
|
157
|
+
-- canonically - exactly what `providersof` does at runtime.
|
|
158
|
+
-- `canon` hands back a name no ref could have unchanged, and no
|
|
159
|
+
-- instance ref can equal one, so it is the tolerant test.
|
|
160
|
+
local asref = R.canon(reqname)
|
|
161
|
+
if isref[asref] then
|
|
162
|
+
local dup = false
|
|
163
|
+
for _, p in ipairs(from) do if p == asref then dup = true end end
|
|
164
|
+
if not dup then from[#from + 1] = asref end
|
|
165
|
+
end
|
|
166
|
+
for _, p in ipairs(from) do
|
|
167
|
+
if p ~= n.ref and not seen[p] then
|
|
168
|
+
seen[p] = true
|
|
169
|
+
out[#out + 1] = p
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
table.sort(out)
|
|
175
|
+
edges[n.ref] = out
|
|
176
|
+
starts[#starts + 1] = n.ref
|
|
177
|
+
end
|
|
178
|
+
table.sort(starts)
|
|
179
|
+
|
|
180
|
+
-- Iterative DFS with an explicit stack: twenty ports, and several of
|
|
181
|
+
-- them have no recursion budget worth relying on.
|
|
182
|
+
local WHITE, GREY, BLACK = 0, 1, 2
|
|
183
|
+
local colour = {}
|
|
184
|
+
for _, n in ipairs(nodes) do colour[n.ref] = WHITE end
|
|
185
|
+
|
|
186
|
+
for _, start in ipairs(starts) do
|
|
187
|
+
if WHITE == colour[start] then
|
|
188
|
+
local path = { start }
|
|
189
|
+
local stack = { { start, 1 } }
|
|
190
|
+
colour[start] = GREY
|
|
191
|
+
|
|
192
|
+
while 0 < #stack do
|
|
193
|
+
local top = stack[#stack]
|
|
194
|
+
local outs = edges[top[1]]
|
|
195
|
+
if #outs < top[2] then
|
|
196
|
+
colour[top[1]] = BLACK
|
|
197
|
+
table.remove(stack)
|
|
198
|
+
table.remove(path)
|
|
199
|
+
else
|
|
200
|
+
local nxt = outs[top[2]]
|
|
201
|
+
top[2] = top[2] + 1
|
|
202
|
+
if GREY == colour[nxt] then
|
|
203
|
+
-- Report the cycle itself, not the walk that found it.
|
|
204
|
+
local at = 1
|
|
205
|
+
while at <= #path and path[at] ~= nxt do at = at + 1 end
|
|
206
|
+
local cycle = {}
|
|
207
|
+
for i = at, #path do cycle[#cycle + 1] = path[i] end
|
|
208
|
+
cycle[#cycle + 1] = nxt
|
|
209
|
+
return cycle
|
|
210
|
+
elseif BLACK ~= colour[nxt] then
|
|
211
|
+
colour[nxt] = GREY
|
|
212
|
+
path[#path + 1] = nxt
|
|
213
|
+
stack[#stack + 1] = { nxt, 1 }
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
return nil
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
-- Raise on a cycle, naming it. Separate from the detector so the detector
|
|
223
|
+
-- stays pure and corpus-testable.
|
|
224
|
+
function M.checkcycle(nodes)
|
|
225
|
+
local cycle = M.dependencycycle(nodes)
|
|
226
|
+
if nil == cycle then return end
|
|
227
|
+
T.fail('plugin_dependency_cycle',
|
|
228
|
+
'requirements cycle: ' .. table.concat(cycle, ' -> '),
|
|
229
|
+
T.map { cycle = T.list(cycle) })
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
return M
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/env.lua)
|
|
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
|
+
-- Environment overrides (section 9.5) - level 7 of the ladder.
|
|
5
|
+
--
|
|
6
|
+
-- One prefix, so nothing drifts: `VOXGIG_PLUGIN_*`.
|
|
7
|
+
--
|
|
8
|
+
-- VOXGIG_PLUGIN_PROFILE the profile name
|
|
9
|
+
-- VOXGIG_PLUGIN_<REF>_<PATH> one option
|
|
10
|
+
-- VOXGIG_PLUGIN_ACTIVE/INACTIVE comma-separated refs, INACTIVE wins
|
|
11
|
+
--
|
|
12
|
+
-- THE ENCODING IS LOSSY, AND THIS SAYS SO RATHER THAN PRETENDING
|
|
13
|
+
-- OTHERWISE. Ref and path are upper-snake with `$` -> `__` and `.` -> `_`.
|
|
14
|
+
-- But `_` is legal in a name and in a tag, and the mapping folds case, so
|
|
15
|
+
-- `retry$fast` and `retry__fast` both encode to `RETRY__FAST`.
|
|
16
|
+
--
|
|
17
|
+
-- Rather than restrict a grammar the rest of the stack already uses, the
|
|
18
|
+
-- host DETECTS THE COLLISION: it encodes every ref it holds, and a key two
|
|
19
|
+
-- refs claim is `plugin_env_ambiguous`, naming both.
|
|
20
|
+
|
|
21
|
+
local T = require 'feature.secrets.plugin.types'
|
|
22
|
+
local R = require 'feature.secrets.plugin.ref'
|
|
23
|
+
local J = require 'feature.secrets.plugin.json'
|
|
24
|
+
|
|
25
|
+
local M = {}
|
|
26
|
+
|
|
27
|
+
M.ENV_PREFIX = 'VOXGIG_PLUGIN_'
|
|
28
|
+
|
|
29
|
+
-- `retry$fast` -> `RETRY__FAST`.
|
|
30
|
+
function M.encode_ref(ref)
|
|
31
|
+
local out = ref:gsub('%$', '__'):gsub('%.', '_')
|
|
32
|
+
return out:upper()
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
local function checkreserved(ref, reserved)
|
|
36
|
+
if not T.islist(reserved) or 0 == #reserved then return end
|
|
37
|
+
local name = R.refname(ref)
|
|
38
|
+
for i = 1, #reserved do
|
|
39
|
+
if reserved[i] == name then
|
|
40
|
+
T.fail('plugin_ref_reserved', 'ref is reserved by the host: ' .. ref,
|
|
41
|
+
T.map { ref = ref })
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
local function split(value)
|
|
47
|
+
local out = {}
|
|
48
|
+
if 'string' ~= type(value) then return out end
|
|
49
|
+
for part in (value .. ','):gmatch('([^,]*),') do
|
|
50
|
+
local trimmed = part:match('^%s*(.-)%s*$')
|
|
51
|
+
if '' ~= trimmed then out[#out + 1] = trimmed end
|
|
52
|
+
end
|
|
53
|
+
return out
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
-- Values parse as JSON, FALLING BACK TO STRING - so `8080` is a number,
|
|
57
|
+
-- `true` is a boolean, `{"a":1}` is a map, and `hello` is the string it
|
|
58
|
+
-- looks like rather than a parse error.
|
|
59
|
+
local function parsevalue(value)
|
|
60
|
+
if 'string' ~= type(value) then return value end
|
|
61
|
+
local ok, parsed = pcall(J.parse, value)
|
|
62
|
+
if ok then return parsed end
|
|
63
|
+
return value
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
function M.apply_env(input)
|
|
67
|
+
input = input or T.map {}
|
|
68
|
+
local env = T.getv(input, 'env') or T.map {}
|
|
69
|
+
local reserved = T.getv(input, 'reserved') or T.list {}
|
|
70
|
+
|
|
71
|
+
local refs = {}
|
|
72
|
+
local given = T.getv(input, 'refs') or T.list {}
|
|
73
|
+
for i = 1, T.len(given) do
|
|
74
|
+
refs[#refs + 1] = R.canon_ref(given[i])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
local options = T.map {}
|
|
78
|
+
local active = T.list {}
|
|
79
|
+
local inactive = T.list {}
|
|
80
|
+
local out = T.map { options = options, active = active, inactive = inactive }
|
|
81
|
+
|
|
82
|
+
-- Encode every ref the host holds, and refuse a key that two of them
|
|
83
|
+
-- claim. Done up front so the collision is reported even when no
|
|
84
|
+
-- environment variable exercises it - a latent ambiguity is still an
|
|
85
|
+
-- ambiguity, and finding it at deploy time is the failure this exists to
|
|
86
|
+
-- prevent.
|
|
87
|
+
local byencoded = {}
|
|
88
|
+
local encodedkeys = {}
|
|
89
|
+
for _, r in ipairs(refs) do
|
|
90
|
+
local e = M.encode_ref(r)
|
|
91
|
+
if nil == byencoded[e] then
|
|
92
|
+
byencoded[e] = {}
|
|
93
|
+
encodedkeys[#encodedkeys + 1] = e
|
|
94
|
+
end
|
|
95
|
+
table.insert(byencoded[e], r)
|
|
96
|
+
end
|
|
97
|
+
table.sort(encodedkeys)
|
|
98
|
+
for _, e in ipairs(encodedkeys) do
|
|
99
|
+
if 1 < #byencoded[e] then
|
|
100
|
+
local pair = T.sortstrings(byencoded[e])
|
|
101
|
+
T.fail('plugin_env_ambiguous',
|
|
102
|
+
'refs collide in the environment encoding as ' .. e .. ': '
|
|
103
|
+
.. table.concat(pair, ', '),
|
|
104
|
+
T.map { encoded = e, refs = T.list(pair) })
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
-- Longest encoded ref first, so `retry$fast` wins over `retry` on
|
|
109
|
+
-- `RETRY__FAST_MIN`. Shortest-first would read the tag as a path.
|
|
110
|
+
local encoded = T.stable_sort(encodedkeys, function(a, b)
|
|
111
|
+
return #a > #b
|
|
112
|
+
end)
|
|
113
|
+
|
|
114
|
+
for _, key in ipairs(T.keys(env)) do
|
|
115
|
+
if M.ENV_PREFIX == key:sub(1, #M.ENV_PREFIX) then
|
|
116
|
+
local rest = key:sub(#M.ENV_PREFIX + 1)
|
|
117
|
+
|
|
118
|
+
if 'PROFILE' == rest then
|
|
119
|
+
out.profile = env[key]
|
|
120
|
+
elseif 'ACTIVE' == rest or 'INACTIVE' == rest then
|
|
121
|
+
local target = 'ACTIVE' == rest and active or inactive
|
|
122
|
+
for _, raw in ipairs(split(env[key])) do
|
|
123
|
+
local ref = R.canon_ref(raw)
|
|
124
|
+
-- The reservation covers EVERY input layer (section 9.1).
|
|
125
|
+
-- VOXGIG_PLUGIN_INACTIVE=station is easier to set than editing a
|
|
126
|
+
-- config file, and INACTIVE has the final word - so guarding
|
|
127
|
+
-- documents alone would leave the one lever this mechanism
|
|
128
|
+
-- exists to deny wide open.
|
|
129
|
+
checkreserved(ref, reserved)
|
|
130
|
+
target[#target + 1] = ref
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
local enc
|
|
134
|
+
for _, e in ipairs(encoded) do
|
|
135
|
+
if rest == e or (e .. '_') == rest:sub(1, #e + 1) then
|
|
136
|
+
enc = e
|
|
137
|
+
break
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if nil ~= enc then
|
|
142
|
+
local ref = byencoded[enc][1]
|
|
143
|
+
checkreserved(ref, reserved)
|
|
144
|
+
|
|
145
|
+
-- A ref with no path sets nothing.
|
|
146
|
+
if rest ~= enc then
|
|
147
|
+
local path = {}
|
|
148
|
+
for piece in (rest:sub(#enc + 2):lower() .. '_'):gmatch('([^_]*)_') do
|
|
149
|
+
path[#path + 1] = piece
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if not T.ismap(options[ref]) then options[ref] = T.map {} end
|
|
153
|
+
local node = options[ref]
|
|
154
|
+
for i = 1, #path - 1 do
|
|
155
|
+
if not T.ismap(node[path[i]]) then node[path[i]] = T.map {} end
|
|
156
|
+
node = node[path[i]]
|
|
157
|
+
end
|
|
158
|
+
node[path[#path]] = parsevalue(env[key])
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
return out
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
return M
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/export.lua)
|
|
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
|
+
-- Exports (section 11).
|
|
5
|
+
--
|
|
6
|
+
-- An instance publishes values for other plugins and for the application.
|
|
7
|
+
-- Read with `host:exports('retry$fast/client')`.
|
|
8
|
+
--
|
|
9
|
+
-- THE UNQUALIFIED ALIAS IS THE INTERESTING PART. `retry/client` resolves
|
|
10
|
+
-- to the UNTAGGED instance if one exists; if not, and exactly one tagged
|
|
11
|
+
-- instance exports that key, it resolves to that one; if two do, it is
|
|
12
|
+
-- `plugin_export_ambiguous` - deliberately diverging from seneca's silent
|
|
13
|
+
-- last-wins, because with multi-instance as a headline feature an
|
|
14
|
+
-- ambiguous alias is a defect waiting for production.
|
|
15
|
+
|
|
16
|
+
local T = require 'feature.secrets.plugin.types'
|
|
17
|
+
local R = require 'feature.secrets.plugin.ref'
|
|
18
|
+
|
|
19
|
+
local M = {}
|
|
20
|
+
|
|
21
|
+
-- `exported` is a plain lua array of {ref=, key=, value=} records: an
|
|
22
|
+
-- internal shape, never a corpus value, so it is not tagged.
|
|
23
|
+
function M.resolve_export(spec, exported)
|
|
24
|
+
local cut = spec:find('/', 1, true)
|
|
25
|
+
if nil == cut then
|
|
26
|
+
T.fail('plugin_export_ambiguous', 'export spec needs a key: ' .. spec,
|
|
27
|
+
T.map { spec = spec })
|
|
28
|
+
end
|
|
29
|
+
local head = spec:sub(1, cut - 1)
|
|
30
|
+
local key = spec:sub(cut + 1)
|
|
31
|
+
|
|
32
|
+
-- A fully qualified ref: exactly one answer or none.
|
|
33
|
+
local want = R.canon(head)
|
|
34
|
+
for _, e in ipairs(exported) do
|
|
35
|
+
if e.ref == want and e.key == key then
|
|
36
|
+
return e.value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
-- An alias: the name, not a ref. Look at every instance of it.
|
|
41
|
+
local byname = {}
|
|
42
|
+
for _, e in ipairs(exported) do
|
|
43
|
+
if R.refname(e.ref) == head and e.key == key then
|
|
44
|
+
byname[#byname + 1] = e
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
if 0 == #byname then return nil end
|
|
48
|
+
|
|
49
|
+
for _, e in ipairs(byname) do
|
|
50
|
+
if '' == R.parse_ref(e.ref).tag then
|
|
51
|
+
return e.value
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
if 1 == #byname then return byname[1].value end
|
|
56
|
+
|
|
57
|
+
local refs = {}
|
|
58
|
+
for _, e in ipairs(byname) do refs[#refs + 1] = e.ref end
|
|
59
|
+
table.sort(refs)
|
|
60
|
+
T.fail('plugin_export_ambiguous',
|
|
61
|
+
'alias ' .. spec .. ' matches ' .. #refs .. ' instances: '
|
|
62
|
+
.. table.concat(refs, ', '),
|
|
63
|
+
T.map { spec = spec, refs = T.list(refs) })
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
return M
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/plugin sdk-20260908-1556-0 (lua/src/plugin/graph.lua)
|
|
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
|
+
-- Whole-graph resolution (section 11.4) - a phase, not a discovery.
|
|
5
|
+
--
|
|
6
|
+
-- "Activate, and wait in `pending` if you must" is correct and, on its
|
|
7
|
+
-- own, produces a terrible experience: apply twenty instances against a
|
|
8
|
+
-- registry missing one thing and you get NINETEEN pending rows and no
|
|
9
|
+
-- statement of what is actually wrong.
|
|
10
|
+
--
|
|
11
|
+
-- `resolve_graph` is a PURE FUNCTION of the registry and the intended
|
|
12
|
+
-- activation set. No callbacks run, no state changes, nothing is touched.
|
|
13
|
+
-- It answers for the whole graph at once which instances can be live, and
|
|
14
|
+
-- for each blocked one THE SPECIFIC REQUIREMENT that is unmet, and why.
|
|
15
|
+
--
|
|
16
|
+
-- The failure mode being designed against is a famous one: OSGi's resolver
|
|
17
|
+
-- is correct and its diagnostics are legendarily unusable. A resolver that
|
|
18
|
+
-- says "blocked" without saying WHY has moved the problem rather than
|
|
19
|
+
-- solved it, so `why` is part of the contract and the corpus pins its
|
|
20
|
+
-- shape.
|
|
21
|
+
|
|
22
|
+
local T = require 'feature.secrets.plugin.types'
|
|
23
|
+
local Cap = require 'feature.secrets.plugin.capability'
|
|
24
|
+
local V = require 'feature.secrets.plugin.version'
|
|
25
|
+
local R = require 'feature.secrets.plugin.ref'
|
|
26
|
+
|
|
27
|
+
local M = {}
|
|
28
|
+
|
|
29
|
+
local function candidates(byref, refs, name)
|
|
30
|
+
local out = {}
|
|
31
|
+
-- A NODE SATISFIES ITS OWN REF (section 11.1), and the graph learned it
|
|
32
|
+
-- here. Considering only declared capabilities made `resolve` answer
|
|
33
|
+
-- `absent` about a provider sitting right there and live - section
|
|
34
|
+
-- 11.4's job is explaining the graph the runtime reconciles.
|
|
35
|
+
local asref = R.canon(name)
|
|
36
|
+
-- Sorted refs, so the walk is deterministic in a language whose tables
|
|
37
|
+
-- have no order at all.
|
|
38
|
+
for _, ref in ipairs(refs) do
|
|
39
|
+
local node = byref[ref]
|
|
40
|
+
-- The ref match WINS OUTRIGHT for that node, as at runtime: one
|
|
41
|
+
-- candidate, not two, for a node both named `b` and providing `b`.
|
|
42
|
+
if ref == asref then
|
|
43
|
+
out[#out + 1] = T.map {
|
|
44
|
+
ref = T.getv(node, 'ref'),
|
|
45
|
+
pos = T.getv(node, 'pos') or 0,
|
|
46
|
+
provides = T.map { name = name },
|
|
47
|
+
}
|
|
48
|
+
goto continue
|
|
49
|
+
end
|
|
50
|
+
local provides = T.getv(node, 'provides') or T.list {}
|
|
51
|
+
for i = 1, T.len(provides) do
|
|
52
|
+
local prov = provides[i]
|
|
53
|
+
if T.same(T.getv(prov, 'name'), name) then
|
|
54
|
+
out[#out + 1] = T.map {
|
|
55
|
+
ref = T.getv(node, 'ref'),
|
|
56
|
+
pos = T.getv(node, 'pos') or 0,
|
|
57
|
+
provides = prov,
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
::continue::
|
|
62
|
+
end
|
|
63
|
+
return T.list(out)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
local function unmet(node, name, why)
|
|
67
|
+
return T.map { ref = T.getv(node, 'ref'), unmet = name, why = why }
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
local function firstunmet(node, byref, refs, resolved)
|
|
71
|
+
local requires = T.getv(node, 'requires') or T.list {}
|
|
72
|
+
for i = 1, T.len(requires) do
|
|
73
|
+
local req = requires[i]
|
|
74
|
+
if not T.truthy(T.getv(req, 'optional')) then
|
|
75
|
+
local name = T.getv(req, 'name')
|
|
76
|
+
local all = candidates(byref, refs, name)
|
|
77
|
+
if 0 == #all then
|
|
78
|
+
return unmet(node, name, T.map { kind = 'absent' })
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
local ok = Cap.resolve_capability(req, all)
|
|
82
|
+
if 0 < #ok then
|
|
83
|
+
-- A provider exists and matches - but if none of them is itself
|
|
84
|
+
-- resolved, this node is blocked BEHIND it, and the chain is the
|
|
85
|
+
-- useful answer rather than "unmet".
|
|
86
|
+
local any = false
|
|
87
|
+
for j = 1, #ok do
|
|
88
|
+
if resolved[T.getv(ok[j], 'ref')] then any = true break end
|
|
89
|
+
end
|
|
90
|
+
if not any then
|
|
91
|
+
local chain = {}
|
|
92
|
+
for j = 1, #ok do chain[#chain + 1] = T.getv(ok[j], 'ref') end
|
|
93
|
+
table.sort(chain)
|
|
94
|
+
return unmet(node, name,
|
|
95
|
+
T.map { kind = 'blocked', chain = T.list(chain) })
|
|
96
|
+
end
|
|
97
|
+
else
|
|
98
|
+
-- Providers exist and none matched. Say which test failed.
|
|
99
|
+
local range = T.getv(req, 'range')
|
|
100
|
+
if nil ~= range then
|
|
101
|
+
local versions = {}
|
|
102
|
+
for j = 1, #all do
|
|
103
|
+
local have = T.getv(T.getv(all[j], 'provides'), 'version')
|
|
104
|
+
if nil == have or not V.satisfiesq(have, range) then
|
|
105
|
+
versions[#versions + 1] = have or '(none)'
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
if 0 < #versions then
|
|
109
|
+
table.sort(versions)
|
|
110
|
+
return unmet(node, name, T.map {
|
|
111
|
+
kind = 'version', range = range, found = T.list(versions),
|
|
112
|
+
})
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
local want = T.getv(req, 'match')
|
|
117
|
+
if nil ~= want then
|
|
118
|
+
for j = 1, #all do
|
|
119
|
+
local attrs = T.getv(T.getv(all[j], 'provides'), 'attrs') or T.map {}
|
|
120
|
+
for _, k in ipairs(T.keys(want)) do
|
|
121
|
+
if not (T.has(attrs, k) and Cap.matchvalue(want[k], attrs[k])) then
|
|
122
|
+
-- `T.has(attrs, k) and attrs[k] or T.NULL` would report a
|
|
123
|
+
-- present FALSE as a null: lua's `and`/`or` is not a
|
|
124
|
+
-- ternary when the middle term can be false, and
|
|
125
|
+
-- `graph/blocked#match` is exactly that case.
|
|
126
|
+
local found = T.NULL
|
|
127
|
+
if T.has(attrs, k) then found = attrs[k] end
|
|
128
|
+
return unmet(node, name, T.map {
|
|
129
|
+
kind = 'match', failing = k, want = want[k], found = found,
|
|
130
|
+
})
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
return unmet(node, name, T.map { kind = 'absent' })
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
return nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
function M.resolve_graph(nodes)
|
|
144
|
+
local byref = {}
|
|
145
|
+
local refs = {}
|
|
146
|
+
for i = 1, T.len(nodes) do
|
|
147
|
+
local ref = T.getv(nodes[i], 'ref')
|
|
148
|
+
byref[ref] = nodes[i]
|
|
149
|
+
refs[#refs + 1] = ref
|
|
150
|
+
end
|
|
151
|
+
table.sort(refs)
|
|
152
|
+
|
|
153
|
+
local resolved = {}
|
|
154
|
+
local blocked = {}
|
|
155
|
+
|
|
156
|
+
-- Fixed point: a node resolves when every mandatory requirement is met
|
|
157
|
+
-- by an ALREADY-RESOLVED provider. Iterating to a fixed point is what
|
|
158
|
+
-- makes a provider that is itself blocked propagate, rather than each
|
|
159
|
+
-- node being judged against the raw registry.
|
|
160
|
+
local moved = true
|
|
161
|
+
while moved do
|
|
162
|
+
moved = false
|
|
163
|
+
for i = 1, T.len(nodes) do
|
|
164
|
+
local n = nodes[i]
|
|
165
|
+
local ref = T.getv(n, 'ref')
|
|
166
|
+
if not resolved[ref] and nil == firstunmet(n, byref, refs, resolved) then
|
|
167
|
+
resolved[ref] = true
|
|
168
|
+
moved = true
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
for i = 1, T.len(nodes) do
|
|
174
|
+
local n = nodes[i]
|
|
175
|
+
local ref = T.getv(n, 'ref')
|
|
176
|
+
if not resolved[ref] then
|
|
177
|
+
local why = firstunmet(n, byref, refs, resolved)
|
|
178
|
+
if nil ~= why then blocked[ref] = why end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
local resolvedout = {}
|
|
183
|
+
for _, ref in ipairs(refs) do
|
|
184
|
+
if resolved[ref] then resolvedout[#resolvedout + 1] = ref end
|
|
185
|
+
end
|
|
186
|
+
local blockedout = {}
|
|
187
|
+
for _, ref in ipairs(refs) do
|
|
188
|
+
if nil ~= blocked[ref] then blockedout[#blockedout + 1] = blocked[ref] end
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
return T.map { resolved = T.list(resolvedout), blocked = T.list(blockedout) }
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
return M
|