@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
|
@@ -268,8 +268,11 @@
|
|
|
268
268
|
;; Resolution.
|
|
269
269
|
;; ---------------------------------------------------------------------------
|
|
270
270
|
|
|
271
|
+
;; Resolve once, answering whether a credential came out of it. That
|
|
272
|
+
;; boolean is the whole of what resolve! needs to tell a cacheable HIT from
|
|
273
|
+
;; a miss it must not keep.
|
|
271
274
|
(defn- resolve-once [fa]
|
|
272
|
-
(
|
|
275
|
+
(if-let [s (st fa :sek)]
|
|
273
276
|
;; tryget: nil for a MISS, THROWS for a provider ERROR.
|
|
274
277
|
(let [found (sekreto/tryget s (st fa :secretname))]
|
|
275
278
|
(if (nil? (st fa :exchange))
|
|
@@ -278,7 +281,9 @@
|
|
|
278
281
|
;; going out on the wire. (An explicit apikey OPTION is never lost
|
|
279
282
|
;; here - it seats FIRST in the chain as a memory store, so the
|
|
280
283
|
;; chain HITS while one is set and this branch is unreachable.)
|
|
281
|
-
(
|
|
284
|
+
(do
|
|
285
|
+
(swap! fa assoc :cred (if (string? found) found ""))
|
|
286
|
+
(string? found))
|
|
282
287
|
|
|
283
288
|
;; Exchanging: what the chain resolved is the REFRESH token, kept
|
|
284
289
|
;; for every later purchase. A miss is not fatal - an explicit
|
|
@@ -292,19 +297,41 @@
|
|
|
292
297
|
(let [k (vs/getprop (liveopts fa) "apikey")]
|
|
293
298
|
(if (string? k) k "")))]
|
|
294
299
|
(swap! fa assoc :cred apikey)
|
|
295
|
-
(
|
|
300
|
+
(cond
|
|
301
|
+
(seq apikey) true
|
|
302
|
+
|
|
303
|
+
;; `auth: nil` is the documented way to send NO credential,
|
|
304
|
+
;; and a purchase is a credential-bearing call: the refresh
|
|
305
|
+
;; token goes to the token endpoint in the request body.
|
|
306
|
+
;; with-refresh honours suppression for the RETRY, but it runs
|
|
307
|
+
;; after this - by then the refresh token has already left the
|
|
308
|
+
;; process, and no later check can call it back. The
|
|
309
|
+
;; suppression has to be honoured here, before the first
|
|
310
|
+
;; purchase, or it only ever half-held.
|
|
311
|
+
(nil? (auth-of fa)) false
|
|
312
|
+
|
|
313
|
+
:else
|
|
296
314
|
;; No starting access token: buy one now. A failure here is a
|
|
297
315
|
;; failure of the operation - fail closed.
|
|
298
|
-
(buy fa)))))))
|
|
316
|
+
(do (buy fa) true))))))
|
|
317
|
+
false))
|
|
299
318
|
|
|
300
319
|
|
|
301
320
|
;; One resolution, shared by every concurrent caller.
|
|
302
321
|
;;
|
|
303
|
-
;; Returns nil on success, or the Throwable that failed it. A settled
|
|
304
|
-
;;
|
|
305
|
-
;;
|
|
306
|
-
;;
|
|
307
|
-
;;
|
|
322
|
+
;; Returns nil on success, or the Throwable that failed it. A settled HIT is
|
|
323
|
+
;; kept only when caching is on (`cache: false` means every request asks the
|
|
324
|
+
;; chain again); a FAILURE is NEVER kept, so a transient vault outage cannot
|
|
325
|
+
;; poison the client permanently - the next operation asks the chain again
|
|
326
|
+
;; and recovers.
|
|
327
|
+
;;
|
|
328
|
+
;; A MISS is not kept either, however caching is set. That rule is
|
|
329
|
+
;; sekreto's, not this feature's: `A miss is never cached: the next read
|
|
330
|
+
;; asks again`, in sekreto's own source. Keeping a settled miss here would
|
|
331
|
+
;; override that from the layer above, and a secret provisioned after
|
|
332
|
+
;; startup - a mounted file, a policy granted a minute late - would never be
|
|
333
|
+
;; picked up for the life of the client. `cache` is about caching a HIT; it
|
|
334
|
+
;; was never a promise to keep saying no.
|
|
308
335
|
(defn- resolve! [fa]
|
|
309
336
|
(if-let [e (st fa :initerr)]
|
|
310
337
|
e
|
|
@@ -312,8 +339,8 @@
|
|
|
312
339
|
(if (and (st fa :cache) (st fa :resolved))
|
|
313
340
|
nil
|
|
314
341
|
(try
|
|
315
|
-
(resolve-once fa)
|
|
316
|
-
|
|
342
|
+
(let [hit (resolve-once fa)]
|
|
343
|
+
(swap! fa assoc :resolved (boolean hit)))
|
|
317
344
|
nil
|
|
318
345
|
(catch Throwable e
|
|
319
346
|
(swap! fa assoc :resolved false)
|
|
@@ -461,6 +461,33 @@
|
|
|
461
461
|
(credential-is (:auth (call-at stub 0)) "ROT01" "first")
|
|
462
462
|
(credential-is (:auth (call-at stub 1)) "ROT02" "asked again"))))
|
|
463
463
|
|
|
464
|
+
;; A MISS IS NOT A CACHEABLE ANSWER - sekreto's own rule, which this
|
|
465
|
+
;; feature used to override from the layer above. DEFAULT caching here,
|
|
466
|
+
;; which is the whole point: `cache: true` is about holding a HIT (the
|
|
467
|
+
;; test above pins that half), and keeping the settled resolution after
|
|
468
|
+
;; a miss meant the chain was never asked again for the life of the
|
|
469
|
+
;; client - a secret provisioned after startup was invisible forever.
|
|
470
|
+
(chk "secrets-cache-true-re-asks-after-a-miss"
|
|
471
|
+
(fn []
|
|
472
|
+
(let [present (atom false)
|
|
473
|
+
n (atom 0)
|
|
474
|
+
late (reify provider/Provider
|
|
475
|
+
(lookup [_ _]
|
|
476
|
+
(swap! n inc)
|
|
477
|
+
(when @present "LATEKEY01"))
|
|
478
|
+
(describe [_] "late:test"))
|
|
479
|
+
stub (counting-fetch)
|
|
480
|
+
sdk (live-sdk stub :secrets (sekopts "providers" (vs/jt late)))]
|
|
481
|
+
(client/direct sdk (vs/jm "path" "/thing"))
|
|
482
|
+
(t/is-nil (:auth (call-at stub 0))
|
|
483
|
+
"the chain has nothing yet, so no credential should go out")
|
|
484
|
+
(let [asked @n]
|
|
485
|
+
(reset! present true)
|
|
486
|
+
(client/direct sdk (vs/jm "path" "/thing"))
|
|
487
|
+
(t/is-eq (< asked @n) true
|
|
488
|
+
"the MISS was cached: a secret that appears later can never be picked up")
|
|
489
|
+
(credential-is (:auth (call-at stub 1)) "LATEKEY01" "late secret")))))
|
|
490
|
+
|
|
464
491
|
;; ---- auth: nil SUPPRESSES, chain or no chain ----
|
|
465
492
|
|
|
466
493
|
(chk "secrets-auth-nil-suppresses-the-credential"
|
|
@@ -518,7 +545,7 @@
|
|
|
518
545
|
(credential-is (:auth (call-at stub 1)) "ACCESS01" "attempt 1")
|
|
519
546
|
(credential-is (:auth (call-at stub 3)) "ACCESS02" "the retry"))))
|
|
520
547
|
|
|
521
|
-
(chk "secrets-exchange-with-auth-nil-never-retries"
|
|
548
|
+
(chk "secrets-exchange-with-auth-nil-never-buys-or-retries"
|
|
522
549
|
(fn []
|
|
523
550
|
(let [stub (counting-fetch
|
|
524
551
|
(fn [_n url _fd]
|
|
@@ -527,11 +554,18 @@
|
|
|
527
554
|
[(response 401 (vs/jm "err" "expired")) nil])))
|
|
528
555
|
sdk (live-sdk stub :auth-nil true :secrets (xsecrets))]
|
|
529
556
|
(client/direct sdk (vs/jm "path" "/thing"))
|
|
530
|
-
;;
|
|
531
|
-
;;
|
|
532
|
-
;;
|
|
533
|
-
|
|
534
|
-
|
|
557
|
+
;; NOTHING IS BOUGHT, and the API request goes out ONCE.
|
|
558
|
+
;;
|
|
559
|
+
;; This used to read "token + one API call only": the token
|
|
560
|
+
;; WAS bought at resolution, because resolve! ran before
|
|
561
|
+
;; with-refresh's suppression check. A purchase is a
|
|
562
|
+
;; credential-bearing call - the refresh token travels to the
|
|
563
|
+
;; token endpoint in the request body - so `auth: nil` was
|
|
564
|
+
;; only ever half-held, and stopping the retry could not
|
|
565
|
+
;; unsend it. The suppression is now honoured before the
|
|
566
|
+
;; first purchase.
|
|
567
|
+
(t/is-eq (sent stub) 1 (str "one API call, no purchase: " (wire stub)))
|
|
568
|
+
(t/is-nil (:auth (call-at stub 0)) "no authorization header"))))
|
|
535
569
|
|
|
536
570
|
(chk "secrets-exchange-with-no-refresh-token-fails-closed"
|
|
537
571
|
(fn []
|
|
@@ -3,11 +3,40 @@
|
|
|
3
3
|
# Header-only runtime (core/, utility/, feature/, entity/); each test/*.cpp is
|
|
4
4
|
# an independent executable. `make test` compiles and runs them all, failing
|
|
5
5
|
# if any test binary exits non-zero. Mirrors the struct/cpp and tm/rust build.
|
|
6
|
+
#
|
|
7
|
+
# The ONE exception to header-only is a gated feature's vendored payload
|
|
8
|
+
# (below): a multi-translation-unit library, compiled into an archive the
|
|
9
|
+
# test executables link - and only while that feature is wired in.
|
|
6
10
|
|
|
7
11
|
CXX ?= g++
|
|
8
12
|
CXXFLAGS ?= -std=c++17 -O0 -g -Wall -Wextra -Wno-unused-parameter -pthread
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
# ---- gated feature payloads (model/feature/<name>.aon plugin groups) --------
|
|
15
|
+
#
|
|
16
|
+
# A gated feature's vendored payload sits two levels under feature/
|
|
17
|
+
# (feature/<name>/<lib>/*.cpp), as .cpp/.hpp pairs that cannot ride inside
|
|
18
|
+
# a test's single translation unit. What of it is built is decided by a
|
|
19
|
+
# GENERATED make fragment, feature/<name>/kinds.mk, that the feature's
|
|
20
|
+
# Config component emits beside its generated wiring file only when the
|
|
21
|
+
# model activates the feature for this target. The fragment appends the
|
|
22
|
+
# payload sources to FEATURE_SRCS, the feature's suite to FEATURE_TEST_SRCS,
|
|
23
|
+
# and - only when a plugin group is active - the plugin layer and the
|
|
24
|
+
# external libraries it brings to FEATURE_LIBS. Nothing here names a
|
|
25
|
+
# feature: a tree whose model never activated one has no fragment, carries
|
|
26
|
+
# its payload as inert source, and links libstdc++ alone, and a project's
|
|
27
|
+
# `target add` trims it outright. `ldd` on any test binary shows which case
|
|
28
|
+
# this tree is. Every quoted include inside a payload is either
|
|
29
|
+
# same-directory or an explicit sibling path written at vendoring time
|
|
30
|
+
# (ts/vendor/routes.json), so NO -I is needed and a payload's types.hpp or
|
|
31
|
+
# value.hpp can never shadow core/types.hpp.
|
|
32
|
+
FEATURE_SRCS :=
|
|
33
|
+
FEATURE_TEST_SRCS :=
|
|
34
|
+
FEATURE_LIBS :=
|
|
35
|
+
-include $(wildcard feature/*/kinds.mk)
|
|
36
|
+
FEATURE_OBJS := $(FEATURE_SRCS:.cpp=.o)
|
|
37
|
+
FEATURE_ARCHIVE := $(if $(strip $(FEATURE_SRCS)),libsdkfeature.a,)
|
|
38
|
+
|
|
39
|
+
TEST_SRCS := $(wildcard test/*.cpp) $(FEATURE_TEST_SRCS)
|
|
11
40
|
TEST_BINS := $(TEST_SRCS:.cpp=.out)
|
|
12
41
|
|
|
13
42
|
# REBUILD WHEN A HEADER CHANGES. The runtime is header-only, so a test binary
|
|
@@ -20,7 +49,9 @@ TEST_BINS := $(TEST_SRCS:.cpp=.out)
|
|
|
20
49
|
# test/ is listed too: the corpus suites are driven by test/*.hpp (the omni
|
|
21
50
|
# resolver and the retained runner support) and by the vendored omni headers
|
|
22
51
|
# under test/vendor/omni/, none of which the pattern rule below names either.
|
|
52
|
+
# feature/*/ and feature/*/*/ cover a gated feature's vendored headers.
|
|
23
53
|
SDK_HDRS := $(wildcard core/*.hpp entity/*.hpp feature/*.hpp \
|
|
54
|
+
feature/*/*.hpp feature/*/*/*.hpp \
|
|
24
55
|
utility/*.hpp utility/*/*.hpp *.hpp \
|
|
25
56
|
test/*.hpp test/vendor/omni/*.hpp)
|
|
26
57
|
|
|
@@ -37,11 +68,24 @@ test: build
|
|
|
37
68
|
if [ $$fail -ne 0 ]; then echo "SOME TESTS FAILED"; exit 1; fi; \
|
|
38
69
|
echo "ALL TESTS PASSED"
|
|
39
70
|
|
|
40
|
-
|
|
41
|
-
|
|
71
|
+
# The payload archive. `ar r` REPLACES a member by basename on an archive it
|
|
72
|
+
# finds and KEEPS every other one, so a stale member from a removed source
|
|
73
|
+
# would outlive it; one cold `ar rcs` keeps exactly the current members
|
|
74
|
+
# (upstream sekreto's own Makefile deletes first for the same reason).
|
|
75
|
+
%.o: %.cpp
|
|
76
|
+
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
77
|
+
|
|
78
|
+
libsdkfeature.a: $(FEATURE_OBJS)
|
|
79
|
+
@rm -f $@
|
|
80
|
+
ar rcs $@ $(FEATURE_OBJS)
|
|
81
|
+
|
|
82
|
+
# $(FEATURE_ARCHIVE) and $(FEATURE_LIBS) are empty unless a gated feature is
|
|
83
|
+
# wired in, so this rule is byte-for-byte the header-only build otherwise.
|
|
84
|
+
test/%.out: test/%.cpp $(SDK_HDRS) $(FEATURE_ARCHIVE)
|
|
85
|
+
$(CXX) $(CXXFLAGS) $< -o $@ $(FEATURE_ARCHIVE) $(FEATURE_LIBS)
|
|
42
86
|
|
|
43
87
|
clean:
|
|
44
|
-
rm -f test/*.out
|
|
88
|
+
rm -f test/*.out test/*/*/*.out $(FEATURE_OBJS) libsdkfeature.a
|
|
45
89
|
|
|
46
90
|
# --- Release: tag cpp/vX.Y.Z (header-only; no registry) --------------------
|
|
47
91
|
VERSION := $(shell cat VERSION 2>/dev/null || echo 0.0.1)
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/capability.cpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Capabilities (§11.1). */
|
|
5
|
+
|
|
6
|
+
#include "capability.hpp"
|
|
7
|
+
|
|
8
|
+
#include <algorithm>
|
|
9
|
+
|
|
10
|
+
#include "version.hpp"
|
|
11
|
+
|
|
12
|
+
namespace plugin {
|
|
13
|
+
|
|
14
|
+
bool capmatchvalue(const V& want, const V& got) {
|
|
15
|
+
/* THIS FUNCTION IS WHAT "EVERY LEAF" MEANS, and an earlier draft of
|
|
16
|
+
* the canonical did not have it: the check was a scalar compare,
|
|
17
|
+
* which for any compound value is reference identity in JavaScript. A
|
|
18
|
+
* requirement and a capability are declared in different places and
|
|
19
|
+
* are never the same object, so `match: {limits: {max: 5}}` could not
|
|
20
|
+
* be satisfied by ANY provider — including one declaring exactly
|
|
21
|
+
* that. Invisible while every corpus entry is scalar, which is why
|
|
22
|
+
* the go port found it and P2 did not. */
|
|
23
|
+
if (ismap(want)) {
|
|
24
|
+
if (!ismap(got)) return false;
|
|
25
|
+
for (const auto& k : keys(want)) {
|
|
26
|
+
if (!has(got, k)) return false;
|
|
27
|
+
if (!capmatchvalue(get(want, k), get(got, k))) return false;
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
if (islist(want)) {
|
|
32
|
+
if (!islist(got) || len(want) != len(got)) return false;
|
|
33
|
+
for (size_t i = 0; i < len(want); i++) {
|
|
34
|
+
if (!capmatchvalue(at(want, i), at(got, i))) return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return same(want, got);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool capmatches(const V& req, const V& prov) {
|
|
42
|
+
if (!same(get(req, "name"), get(prov, "name"))) return false;
|
|
43
|
+
|
|
44
|
+
V range = get(req, "range");
|
|
45
|
+
if (!isnull(range)) {
|
|
46
|
+
V version = get(prov, "version");
|
|
47
|
+
if (isnull(version)) return false;
|
|
48
|
+
if (!satisfiesq(version, range)) return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* `match` is checked against the provider's `attrs`, key by key. A
|
|
52
|
+
* key the provider does not carry is a MISS, not a pass: a
|
|
53
|
+
* requirement asking for `transactional: true` must not be satisfied
|
|
54
|
+
* by a provider that never said. */
|
|
55
|
+
V match = get(req, "match");
|
|
56
|
+
if (!isnull(match)) {
|
|
57
|
+
V attrs = get(prov, "attrs");
|
|
58
|
+
if (isnull(attrs)) attrs = vmap();
|
|
59
|
+
for (const auto& k : keys(match)) {
|
|
60
|
+
if (!has(attrs, k)) return false;
|
|
61
|
+
if (!capmatchvalue(get(match, k), get(attrs, k))) return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* The rank, as a strict weak ordering over two candidates. Ordering is
|
|
69
|
+
* a TOTAL rank on purpose: without one, "any provider satisfies" is
|
|
70
|
+
* true of the GRAPH and useless to the PLUGIN — two ports could bind
|
|
71
|
+
* different `store` instances, both resolve green, and behave
|
|
72
|
+
* differently, which is precisely the divergence a shared corpus exists
|
|
73
|
+
* to catch. */
|
|
74
|
+
static bool better(const V& a, const V& b) {
|
|
75
|
+
V ap = get(a, "provides");
|
|
76
|
+
V bp = get(b, "provides");
|
|
77
|
+
|
|
78
|
+
V av = get(ap, "version");
|
|
79
|
+
V bv = get(bp, "version");
|
|
80
|
+
bool ahas = !isnull(av), bhas = !isnull(bv);
|
|
81
|
+
if (ahas != bhas) return ahas; /* a version beats none */
|
|
82
|
+
if (ahas && bhas) {
|
|
83
|
+
int c = 0;
|
|
84
|
+
try {
|
|
85
|
+
/* HIGHEST version first, so the comparison is reversed. */
|
|
86
|
+
c = vercmp(parseversion(bv), parseversion(av));
|
|
87
|
+
}
|
|
88
|
+
catch (const PluginError&) {
|
|
89
|
+
c = 0;
|
|
90
|
+
}
|
|
91
|
+
if (0 != c) return 0 > c;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
double apri = isnum(get(ap, "priority")) ? asnum(get(ap, "priority")) : 0.0;
|
|
95
|
+
double bpri = isnum(get(bp, "priority")) ? asnum(get(bp, "priority")) : 0.0;
|
|
96
|
+
if (apri != bpri) return apri < bpri; /* LOWEST priority first */
|
|
97
|
+
|
|
98
|
+
return asnum(get(a, "pos")) < asnum(get(b, "pos"));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
V resolvecapability(const V& req, const V& candidates) {
|
|
102
|
+
std::vector<V> hits;
|
|
103
|
+
for (size_t i = 0; i < len(candidates); i++) {
|
|
104
|
+
V c = at(candidates, i);
|
|
105
|
+
if (capmatches(req, get(c, "provides"))) hits.push_back(c);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* `std::sort` is not stable, and §6.3's tie rules make the order
|
|
109
|
+
* observable — so `better` is a TOTAL order (it falls through to
|
|
110
|
+
* `pos`, which is unique) and stability is not relied on. An earlier
|
|
111
|
+
* reading that stopped at `priority` would have left ties to the
|
|
112
|
+
* sort's discretion, which is exactly the per-port divergence the
|
|
113
|
+
* ranking exists to remove. */
|
|
114
|
+
std::sort(hits.begin(), hits.end(), better);
|
|
115
|
+
|
|
116
|
+
V out = vlist();
|
|
117
|
+
for (const auto& h : hits) push(out, h);
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
} // namespace plugin
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/capability.hpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Capabilities (§11.1).
|
|
5
|
+
*
|
|
6
|
+
* A DEPENDENCY IS ON A CAPABILITY, NOT ON A REF — because it is a
|
|
7
|
+
* dependency on something that can do the job, and which instance is
|
|
8
|
+
* doing it is exactly the configuration detail a plugin must not care
|
|
9
|
+
* about. (§11.1 makes one narrow exception for a ref, and `host.cpp`
|
|
10
|
+
* implements it; the ranking here is capabilities only.)
|
|
11
|
+
*
|
|
12
|
+
* But A BINDING IS TO AN INSTANCE, not to a capability, which is what
|
|
13
|
+
* decides behaviour when the bound provider leaves while another match
|
|
14
|
+
* remains. */
|
|
15
|
+
|
|
16
|
+
#ifndef VOXGIG_PLUGIN_CAPABILITY_HPP
|
|
17
|
+
#define VOXGIG_PLUGIN_CAPABILITY_HPP
|
|
18
|
+
|
|
19
|
+
#include "types.hpp"
|
|
20
|
+
#include "value.hpp"
|
|
21
|
+
|
|
22
|
+
namespace plugin {
|
|
23
|
+
|
|
24
|
+
/* Rank the matching providers best-first: highest `version`, then
|
|
25
|
+
* LOWEST `priority` (default 0), then declaration position `pos`
|
|
26
|
+
* ascending. `candidates` is a list of {ref, pos, provides}. */
|
|
27
|
+
V resolvecapability(const V& req, const V& candidates);
|
|
28
|
+
|
|
29
|
+
/* Does one provider satisfy one requirement? */
|
|
30
|
+
bool capmatches(const V& req, const V& prov);
|
|
31
|
+
|
|
32
|
+
/* PARTIAL MATCH, RECURSING INTO MAPS (§11.1): every leaf in the
|
|
33
|
+
* requirement must be present and equal in the capability, keys not
|
|
34
|
+
* mentioned are not checked. A LIST IS COMPARED LEAF-WISE AT THE SAME
|
|
35
|
+
* LENGTH, not as a subset — "the first two of your three regions" is
|
|
36
|
+
* not something `match` can say. */
|
|
37
|
+
bool capmatchvalue(const V& want, const V& got);
|
|
38
|
+
|
|
39
|
+
} // namespace plugin
|
|
40
|
+
|
|
41
|
+
#endif
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/catalog.cpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* The definition catalog (§10.1). */
|
|
5
|
+
|
|
6
|
+
#include "catalog.hpp"
|
|
7
|
+
|
|
8
|
+
#include "config.hpp"
|
|
9
|
+
#include "ref.hpp"
|
|
10
|
+
|
|
11
|
+
namespace plugin {
|
|
12
|
+
|
|
13
|
+
CatalogPtr makecatalog() { return std::make_shared<Catalog>(); }
|
|
14
|
+
|
|
15
|
+
void Catalog::add(const DefinitionPtr& def) {
|
|
16
|
+
if (!def || !checkname(vstr(def->name))) {
|
|
17
|
+
fail("plugin_definition_name",
|
|
18
|
+
"invalid definition name: " + (def ? def->name : std::string()));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Validate the shape HERE. Deferring it to resolution time means a
|
|
22
|
+
* malformed shape surfaces at a different moment in every host that
|
|
23
|
+
* loads it, which is the divergence the stated domain exists to
|
|
24
|
+
* prevent. */
|
|
25
|
+
if (!isnull(def->shape)) checkshape(def->shape);
|
|
26
|
+
|
|
27
|
+
for (auto& e : defs_) {
|
|
28
|
+
if (e.first == def->name) { e.second = def; return; }
|
|
29
|
+
}
|
|
30
|
+
defs_.emplace_back(def->name, def);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
DefinitionPtr Catalog::get(const std::string& name) const {
|
|
34
|
+
for (const auto& e : defs_) {
|
|
35
|
+
if (e.first == name) return e.second;
|
|
36
|
+
}
|
|
37
|
+
return nullptr;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
bool Catalog::has(const std::string& name) const { return nullptr != get(name); }
|
|
41
|
+
|
|
42
|
+
V Catalog::names() const {
|
|
43
|
+
V m = vmap();
|
|
44
|
+
for (const auto& e : defs_) set(m, e.first, vbool(true));
|
|
45
|
+
V out = vlist();
|
|
46
|
+
for (const auto& k : sortedkeys(m)) push(out, vstr(k));
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const Lifecycle* definitioncallback(const DefinitionPtr& d,
|
|
51
|
+
const std::string& at) {
|
|
52
|
+
if (!d) return nullptr;
|
|
53
|
+
if ("define" == at) return &d->define;
|
|
54
|
+
if ("activate" == at) return &d->activate;
|
|
55
|
+
if ("deactivate" == at) return &d->deactivate;
|
|
56
|
+
if ("close" == at) return &d->close;
|
|
57
|
+
return nullptr;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
} // namespace plugin
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (cpp/src/catalog.hpp)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* The definition catalog (§10.1).
|
|
5
|
+
*
|
|
6
|
+
* A definition is registered once and may back many instances. Option
|
|
7
|
+
* shapes are validated AT REGISTRATION, not when a document happens to
|
|
8
|
+
* exercise a key — so a malformed shape fails once, and in the same
|
|
9
|
+
* place everywhere (§9.4). `declare/shape` pins that timing. */
|
|
10
|
+
|
|
11
|
+
#ifndef VOXGIG_PLUGIN_CATALOG_HPP
|
|
12
|
+
#define VOXGIG_PLUGIN_CATALOG_HPP
|
|
13
|
+
|
|
14
|
+
#include <functional>
|
|
15
|
+
#include <memory>
|
|
16
|
+
#include <string>
|
|
17
|
+
#include <utility>
|
|
18
|
+
#include <vector>
|
|
19
|
+
|
|
20
|
+
#include "types.hpp"
|
|
21
|
+
#include "value.hpp"
|
|
22
|
+
|
|
23
|
+
namespace plugin {
|
|
24
|
+
|
|
25
|
+
class Inst;
|
|
26
|
+
|
|
27
|
+
/* A DEFINITION IS DATA WITH FUNCTIONS IN IT, not a class to extend. A
|
|
28
|
+
* document could produce one, which is the property that makes a
|
|
29
|
+
* catalog a data structure rather than a compile-time registry. */
|
|
30
|
+
using Lifecycle = std::function<void(Inst&)>;
|
|
31
|
+
using Reconfigure = std::function<void(Inst&, const V& now, const V& previous)>;
|
|
32
|
+
|
|
33
|
+
struct Definition {
|
|
34
|
+
std::string name;
|
|
35
|
+
V shape;
|
|
36
|
+
Lifecycle define;
|
|
37
|
+
Lifecycle activate;
|
|
38
|
+
Lifecycle deactivate;
|
|
39
|
+
Lifecycle close;
|
|
40
|
+
Reconfigure reconfigure;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
using DefinitionPtr = std::shared_ptr<Definition>;
|
|
44
|
+
|
|
45
|
+
class Catalog {
|
|
46
|
+
public:
|
|
47
|
+
void add(const DefinitionPtr& def);
|
|
48
|
+
DefinitionPtr get(const std::string& name) const;
|
|
49
|
+
bool has(const std::string& name) const;
|
|
50
|
+
V names() const;
|
|
51
|
+
|
|
52
|
+
private:
|
|
53
|
+
std::vector<std::pair<std::string, DefinitionPtr>> defs_;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
using CatalogPtr = std::shared_ptr<Catalog>;
|
|
57
|
+
|
|
58
|
+
CatalogPtr makecatalog();
|
|
59
|
+
|
|
60
|
+
/* The callback for a phase, by the name the log and the corpus use. */
|
|
61
|
+
const Lifecycle* definitioncallback(const DefinitionPtr& d,
|
|
62
|
+
const std::string& at);
|
|
63
|
+
|
|
64
|
+
} // namespace plugin
|
|
65
|
+
|
|
66
|
+
#endif
|