@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,135 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (c/src/value.h)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* The dynamic value, and the JSON reader that fills it (§16).
|
|
5
|
+
*
|
|
6
|
+
* NO DEPENDENCIES, not even a JSON library: §16 permits exactly one
|
|
7
|
+
* runtime dependency (voxgig/struct) and C has no port of it, so the
|
|
8
|
+
* corpus JSON is parsed here. A package graph is also a supply chain.
|
|
9
|
+
*
|
|
10
|
+
* ARENA ALLOCATION, and it is the design rather than a shortcut. Every
|
|
11
|
+
* Value this port makes lives in one arena and the whole arena is freed
|
|
12
|
+
* at once. The alternative — ownership per value, or refcounting — buys
|
|
13
|
+
* nothing a test-driven library needs and costs the thing C ports fail
|
|
14
|
+
* at: a `free` on a path the corpus does not exercise. Nothing here
|
|
15
|
+
* frees an individual value, so nothing here can double-free one.
|
|
16
|
+
*
|
|
17
|
+
* A MAP PRESERVES INSERTION ORDER AND SORTS ON DEMAND. §4 rule 4 makes
|
|
18
|
+
* order observable in several places (`keys` is sorted, `pos` is the
|
|
19
|
+
* sorted-ref index), so both orders have to be available and the code
|
|
20
|
+
* has to say which it means at each use.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef VOXGIG_PLUGIN_VALUE_H
|
|
24
|
+
#define VOXGIG_PLUGIN_VALUE_H
|
|
25
|
+
|
|
26
|
+
#include <stddef.h>
|
|
27
|
+
#include <stdbool.h>
|
|
28
|
+
|
|
29
|
+
typedef enum {
|
|
30
|
+
VNULL = 0,
|
|
31
|
+
VBOOL,
|
|
32
|
+
VNUM,
|
|
33
|
+
VSTR,
|
|
34
|
+
VLIST,
|
|
35
|
+
VMAP
|
|
36
|
+
} VKind;
|
|
37
|
+
|
|
38
|
+
typedef struct Value Value;
|
|
39
|
+
|
|
40
|
+
/* A map entry. Kept as a linked list rather than a hash table: the maps
|
|
41
|
+
* here hold a handful of keys, insertion order must survive, and a
|
|
42
|
+
* hashtable would add a growth path with nothing to gain. */
|
|
43
|
+
typedef struct VEntry {
|
|
44
|
+
const char *key;
|
|
45
|
+
Value *val;
|
|
46
|
+
struct VEntry *next;
|
|
47
|
+
} VEntry;
|
|
48
|
+
|
|
49
|
+
struct Value {
|
|
50
|
+
VKind kind;
|
|
51
|
+
bool boolean;
|
|
52
|
+
double num;
|
|
53
|
+
const char *str;
|
|
54
|
+
/* list */
|
|
55
|
+
Value **items;
|
|
56
|
+
size_t len;
|
|
57
|
+
size_t cap;
|
|
58
|
+
/* map */
|
|
59
|
+
VEntry *first;
|
|
60
|
+
VEntry *last;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/* --- arena ---------------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
/* Allocate zeroed bytes that live until `arena_reset`. Never returns
|
|
66
|
+
* NULL: allocation failure is fatal, because a library that limps on
|
|
67
|
+
* after it cannot be reasoned about and the corpus cannot express it. */
|
|
68
|
+
void *arena_alloc(size_t size);
|
|
69
|
+
char *arena_strdup(const char *s);
|
|
70
|
+
char *arena_strndup(const char *s, size_t n);
|
|
71
|
+
/* Free EVERYTHING. Call between corpus entries, never inside one. */
|
|
72
|
+
void arena_reset(void);
|
|
73
|
+
|
|
74
|
+
/* --- construction --------------------------------------------------- */
|
|
75
|
+
|
|
76
|
+
Value *vnull(void);
|
|
77
|
+
Value *vbool(bool b);
|
|
78
|
+
Value *vnum(double n);
|
|
79
|
+
Value *vstr(const char *s);
|
|
80
|
+
Value *vlist(void);
|
|
81
|
+
Value *vmap(void);
|
|
82
|
+
|
|
83
|
+
/* --- access --------------------------------------------------------- */
|
|
84
|
+
|
|
85
|
+
bool visnull(const Value *v);
|
|
86
|
+
bool vismap(const Value *v);
|
|
87
|
+
bool vislist(const Value *v);
|
|
88
|
+
bool visstr(const Value *v);
|
|
89
|
+
bool visnum(const Value *v);
|
|
90
|
+
bool visbool(const Value *v);
|
|
91
|
+
|
|
92
|
+
/* `get` answers NULL for a missing key AND for a key holding JSON null;
|
|
93
|
+
* `has` distinguishes them, which is what §9.1's "an authored null is
|
|
94
|
+
* not an absent key" needs. */
|
|
95
|
+
Value *vget(const Value *m, const char *key);
|
|
96
|
+
bool vhas(const Value *m, const char *key);
|
|
97
|
+
void vset(Value *m, const char *key, Value *val);
|
|
98
|
+
void vdel(Value *m, const char *key);
|
|
99
|
+
|
|
100
|
+
Value *vat(const Value *l, size_t i);
|
|
101
|
+
void vpush(Value *l, Value *item);
|
|
102
|
+
size_t vlen(const Value *v);
|
|
103
|
+
|
|
104
|
+
const char *vasstr(const Value *v);
|
|
105
|
+
double vasnum(const Value *v);
|
|
106
|
+
bool vasbool(const Value *v);
|
|
107
|
+
|
|
108
|
+
/* Keys in INSERTION order. */
|
|
109
|
+
size_t vkeys(const Value *m, const char ***out);
|
|
110
|
+
/* Keys SORTED by byte order — §4 rule 4's deterministic walk. */
|
|
111
|
+
size_t vsortedkeys(const Value *m, const char ***out);
|
|
112
|
+
|
|
113
|
+
/* §4 rule 4: truthiness is JSON's, not C's. */
|
|
114
|
+
bool vtruthy(const Value *v);
|
|
115
|
+
|
|
116
|
+
/* Deep equality INCLUDING JSON type, which is the half that matters:
|
|
117
|
+
* half the ports are written in languages whose `==` says `true == 1`,
|
|
118
|
+
* and `capability/match` exists to catch exactly that. */
|
|
119
|
+
bool vsame(const Value *a, const Value *b);
|
|
120
|
+
|
|
121
|
+
Value *vclone(const Value *v);
|
|
122
|
+
|
|
123
|
+
/* --- json ----------------------------------------------------------- */
|
|
124
|
+
|
|
125
|
+
/* Parse, or NULL with *err set to a message. */
|
|
126
|
+
Value *vparse(const char *text, const char **err);
|
|
127
|
+
/* Canonical JSON, keys in SORTED order so two values that are `vsame`
|
|
128
|
+
* render identically — the corpus compares rendered forms in places. */
|
|
129
|
+
const char *vjson(const Value *v);
|
|
130
|
+
|
|
131
|
+
/* Numbers render as integers when they are integral, which is what the
|
|
132
|
+
* corpus's expected values look like. */
|
|
133
|
+
const char *vnumstr(double n);
|
|
134
|
+
|
|
135
|
+
#endif
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (c/src/version.c)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Versions and ranges (§11.2). */
|
|
5
|
+
|
|
6
|
+
#include <stdio.h>
|
|
7
|
+
#include <string.h>
|
|
8
|
+
|
|
9
|
+
#include "version.h"
|
|
10
|
+
|
|
11
|
+
/* A COMPONENT IS BOUNDED, like a ref is (§4's 1024).
|
|
12
|
+
*
|
|
13
|
+
* The grammar admits an unbounded digit sequence, and every language
|
|
14
|
+
* then disagrees about what happens past its integer range: JavaScript
|
|
15
|
+
* silently loses precision, Go's Atoi errors (and a port ignoring that
|
|
16
|
+
* gets 0), C overflows, Python is exact. `satisfies("0",
|
|
17
|
+
* "9223372036854775808")` was false in the canonical and true in go,
|
|
18
|
+
* from the same corpus.
|
|
19
|
+
*
|
|
20
|
+
* 2^31-1 because every port has a signed 32-bit integer, and no real
|
|
21
|
+
* version has ever needed more. Stated rather than left to arithmetic
|
|
22
|
+
* nobody agrees on. Found by review of the go port. */
|
|
23
|
+
#define COMPONENT_MAX 2147483647L
|
|
24
|
+
|
|
25
|
+
/* `^(\d+)(?:\.(\d+))?(?:\.(\d+))?$`, by hand: three components, digits
|
|
26
|
+
* only, no leading sign, no empty component. Written out rather than
|
|
27
|
+
* handed to <regex.h> because the bound below has to be checked per
|
|
28
|
+
* component anyway, and a regex that matched then needed re-scanning
|
|
29
|
+
* would be the worse of both. */
|
|
30
|
+
static bool parse3(const char *s, long *out, bool *overflow) {
|
|
31
|
+
out[0] = out[1] = out[2] = 0;
|
|
32
|
+
*overflow = false;
|
|
33
|
+
if (NULL == s || '\0' == s[0]) return false;
|
|
34
|
+
|
|
35
|
+
size_t i = 0;
|
|
36
|
+
for (int part = 0; part < 3; part++) {
|
|
37
|
+
if ('\0' == s[i]) return 0 < part; /* fewer than three is fine */
|
|
38
|
+
if (0 < part) {
|
|
39
|
+
if ('.' != s[i]) return false;
|
|
40
|
+
i++;
|
|
41
|
+
}
|
|
42
|
+
size_t start = i;
|
|
43
|
+
long acc = 0;
|
|
44
|
+
while ('0' <= s[i] && '9' >= s[i]) {
|
|
45
|
+
if (!*overflow) {
|
|
46
|
+
acc = acc * 10 + (s[i] - '0');
|
|
47
|
+
if (COMPONENT_MAX < acc) *overflow = true;
|
|
48
|
+
}
|
|
49
|
+
i++;
|
|
50
|
+
}
|
|
51
|
+
if (start == i) return false; /* an empty component is not a number */
|
|
52
|
+
out[part] = acc;
|
|
53
|
+
}
|
|
54
|
+
return '\0' == s[i];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static Value *triple(const long *n) {
|
|
58
|
+
Value *out = vlist();
|
|
59
|
+
for (int i = 0; i < 3; i++) vpush(out, vnum((double)n[i]));
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Value *parserange(Value *range) {
|
|
64
|
+
if (!visstr(range) || '\0' == vasstr(range)[0]) {
|
|
65
|
+
const char *shown = visstr(range) ? vasstr(range) : "";
|
|
66
|
+
size_t sz = strlen(shown) + 32;
|
|
67
|
+
char *text = (char *)arena_alloc(sz);
|
|
68
|
+
snprintf(text, sz, "invalid range: %s", shown);
|
|
69
|
+
fail("plugin_bad_range", text,
|
|
70
|
+
details1("range", visnull(range) ? vnull() : range));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const char *s = vasstr(range);
|
|
74
|
+
/* Two forms and no more (§11.2):
|
|
75
|
+
* '2.1' >= 2.1.0 and < 3.0.0
|
|
76
|
+
* '~2.1' >= 2.1.0 and < 2.2.0 */
|
|
77
|
+
bool tilde = '~' == s[0];
|
|
78
|
+
const char *body = tilde ? s + 1 : s;
|
|
79
|
+
|
|
80
|
+
long n[3];
|
|
81
|
+
bool overflow = false;
|
|
82
|
+
if (!parse3(body, n, &overflow) || overflow) {
|
|
83
|
+
size_t sz = strlen(s) + 64;
|
|
84
|
+
char *text = (char *)arena_alloc(sz);
|
|
85
|
+
if (overflow) snprintf(text, sz, "version component out of range in %s", s);
|
|
86
|
+
else snprintf(text, sz, "invalid range: %s", s);
|
|
87
|
+
fail("plugin_bad_range", text, details1("range", range));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
long lo[3] = { n[0], n[1], n[2] };
|
|
91
|
+
long hi[3];
|
|
92
|
+
if (tilde) { hi[0] = n[0]; hi[1] = n[1] + 1; hi[2] = 0; }
|
|
93
|
+
else { hi[0] = n[0] + 1; hi[1] = 0; hi[2] = 0; }
|
|
94
|
+
|
|
95
|
+
Value *out = vmap();
|
|
96
|
+
vset(out, "lo", triple(lo));
|
|
97
|
+
vset(out, "hi", triple(hi));
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
Value *parseversion(Value *version) {
|
|
102
|
+
if (!visstr(version)) {
|
|
103
|
+
fail("plugin_bad_range", "invalid version",
|
|
104
|
+
details1("version", visnull(version) ? vnull() : version));
|
|
105
|
+
}
|
|
106
|
+
const char *s = vasstr(version);
|
|
107
|
+
long n[3];
|
|
108
|
+
bool overflow = false;
|
|
109
|
+
if (!parse3(s, n, &overflow) || overflow) {
|
|
110
|
+
size_t sz = strlen(s) + 64;
|
|
111
|
+
char *text = (char *)arena_alloc(sz);
|
|
112
|
+
/* `plugin_bad_range` either way — the same code the rest of the
|
|
113
|
+
* grammar's failures use, because "this is not a version I can
|
|
114
|
+
* compare" is one fact however it went wrong. */
|
|
115
|
+
if (overflow) snprintf(text, sz, "version component out of range in %s", s);
|
|
116
|
+
else snprintf(text, sz, "invalid version: %s", s);
|
|
117
|
+
fail("plugin_bad_range", text, details1("version", version));
|
|
118
|
+
}
|
|
119
|
+
return triple(n);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
int vercmp(Value *a, Value *b) {
|
|
123
|
+
for (size_t i = 0; i < 3; i++) {
|
|
124
|
+
double x = visnum(vat(a, i)) ? vasnum(vat(a, i)) : 0.0;
|
|
125
|
+
double y = visnum(vat(b, i)) ? vasnum(vat(b, i)) : 0.0;
|
|
126
|
+
if (x != y) return x < y ? -1 : 1;
|
|
127
|
+
}
|
|
128
|
+
return 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
bool satisfies(Value *version, Value *range) {
|
|
132
|
+
Value *v = parseversion(version);
|
|
133
|
+
Value *r = parserange(range);
|
|
134
|
+
return 0 <= vercmp(v, vget(r, "lo")) && 0 > vercmp(v, vget(r, "hi"));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
bool satisfiesq(Value *version, Value *range) {
|
|
138
|
+
/* `satisfies` for the internal callers that treat an unparseable
|
|
139
|
+
* version or range as "does not satisfy" — Capability and Graph, both
|
|
140
|
+
* of which run over data the corpus has already admitted. */
|
|
141
|
+
CatchFrame f;
|
|
142
|
+
bool out = false;
|
|
143
|
+
if (0 == PLUGIN_TRY(&f)) {
|
|
144
|
+
out = satisfies(version, range);
|
|
145
|
+
PLUGIN_END(&f);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
out = false;
|
|
149
|
+
}
|
|
150
|
+
return out;
|
|
151
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// VENDORED: @voxgig/plugin sdk-20260908-1556-0 (c/src/version.h)
|
|
2
|
+
// Source: https://github.com/voxgig/plugin @ 48392f5e2b6d1434ee9b1a4a9a11f4480aaeb46a [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* Versions and ranges (§11.2).
|
|
5
|
+
*
|
|
6
|
+
* TWO FIELDS AND ONE PREDICATE. A capability declares `version`, a
|
|
7
|
+
* concrete version. A requirement declares `range`. A requirement is
|
|
8
|
+
* satisfied when the names match, the `match` passes, and the
|
|
9
|
+
* provider's `version` falls inside the requirement's `range`. That is
|
|
10
|
+
* the whole rule — there is no third field and no second comparison. */
|
|
11
|
+
|
|
12
|
+
#ifndef VOXGIG_PLUGIN_VERSION_H
|
|
13
|
+
#define VOXGIG_PLUGIN_VERSION_H
|
|
14
|
+
|
|
15
|
+
#include <stdbool.h>
|
|
16
|
+
|
|
17
|
+
#include "types.h"
|
|
18
|
+
#include "value.h"
|
|
19
|
+
|
|
20
|
+
/* A parsed range is {lo:[3], hi:[3]} — the shape `version/range` asserts
|
|
21
|
+
* directly, so it is a Value rather than a struct. */
|
|
22
|
+
Value *parserange(Value *range);
|
|
23
|
+
/* [major, minor, patch]. */
|
|
24
|
+
Value *parseversion(Value *version);
|
|
25
|
+
|
|
26
|
+
/* The one satisfaction predicate: lo <= version < hi. */
|
|
27
|
+
bool satisfies(Value *version, Value *range);
|
|
28
|
+
/* The same, tolerant of a missing version — a bare ref carries none, so
|
|
29
|
+
* `graph` and `depend` ask this rather than raising. */
|
|
30
|
+
bool satisfiesq(Value *version, Value *range);
|
|
31
|
+
|
|
32
|
+
int vercmp(Value *a, Value *b);
|
|
33
|
+
|
|
34
|
+
#endif
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (c/plugins/aws.c)
|
|
2
|
+
// Source: https://github.com/voxgig/sekreto @ 1267ee2e5f49566bc92695bc9eb3a60ef4924998 [tag: sdk-20260908-1556-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
/* AWS Secrets Manager and SSM Parameter Store: two kinds, one file.
|
|
5
|
+
*
|
|
6
|
+
* They share the credential resolution and the SigV4 signing, which is
|
|
7
|
+
* the reason they are one translation unit rather than two - splitting
|
|
8
|
+
* them would put the signer in both links or in neither.
|
|
9
|
+
*
|
|
10
|
+
* THE ONLY KINDS IN THE LIBRARY THAT HASH ANYTHING. `sigv4.c` and the
|
|
11
|
+
* `sha256.c` under it are pulled into a link by this object and by
|
|
12
|
+
* nothing else; a chain of the other nine plugins carries no digest at
|
|
13
|
+
* all, and `make check-core` measures that rather than asserting it.
|
|
14
|
+
*
|
|
15
|
+
* A port of typescript/plugins/aws.ts, which is canonical.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
#define _POSIX_C_SOURCE 200809L
|
|
19
|
+
|
|
20
|
+
#include <stdlib.h>
|
|
21
|
+
#include <string.h>
|
|
22
|
+
|
|
23
|
+
#include "support.h"
|
|
24
|
+
|
|
25
|
+
typedef struct {
|
|
26
|
+
sek_pool *pool;
|
|
27
|
+
const char *region;
|
|
28
|
+
const char *keyid;
|
|
29
|
+
const char *secret;
|
|
30
|
+
const char *session;
|
|
31
|
+
const char *addr;
|
|
32
|
+
const char *prefix;
|
|
33
|
+
char *described;
|
|
34
|
+
} awsdata;
|
|
35
|
+
|
|
36
|
+
/* Region and credentials, from config first and the standard AWS_*
|
|
37
|
+
* environment variables second - those are AWS's own convention, and a
|
|
38
|
+
* pod or CI job that has them set should just work. Missing either is an
|
|
39
|
+
* error: an AWS store with no credentials could not answer. */
|
|
40
|
+
static sek_err awscall(awsdata *data, const char *service, const char *targetname,
|
|
41
|
+
const char *payload, sek_answer *out) {
|
|
42
|
+
sek_pool *pool = data->pool;
|
|
43
|
+
const char *region = sek_first3(data->region, getenv("AWS_REGION"), getenv("AWS_DEFAULT_REGION"));
|
|
44
|
+
const char *keyid = sek_first(data->keyid, getenv("AWS_ACCESS_KEY_ID"));
|
|
45
|
+
const char *secret = sek_first(data->secret, getenv("AWS_SECRET_ACCESS_KEY"));
|
|
46
|
+
const char *session = sek_first(data->session, getenv("AWS_SESSION_TOKEN"));
|
|
47
|
+
const char *addr;
|
|
48
|
+
char *url;
|
|
49
|
+
sek_map *extras;
|
|
50
|
+
sek_map *signed_;
|
|
51
|
+
sek_signing input;
|
|
52
|
+
sek_err err;
|
|
53
|
+
size_t index;
|
|
54
|
+
|
|
55
|
+
if (sek_empty(region)) {
|
|
56
|
+
return sek_strdup(pool, "sekreto: aws: no region (set region or AWS_REGION)");
|
|
57
|
+
}
|
|
58
|
+
if (sek_empty(keyid) || sek_empty(secret)) {
|
|
59
|
+
return sek_strdup(pool, "sekreto: aws: no credentials (set keyid/secret or "
|
|
60
|
+
"AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* The China partition lives under its own suffix; every other
|
|
64
|
+
* commercial region is plain amazonaws.com. */
|
|
65
|
+
addr = sek_first(data->addr, sek_fmt(pool, "https://%s.%s%s", service, region,
|
|
66
|
+
sek_has_prefix(region, "cn-") ? ".amazonaws.com.cn"
|
|
67
|
+
: ".amazonaws.com"));
|
|
68
|
+
|
|
69
|
+
err = sek_checkaddr(pool, addr);
|
|
70
|
+
if (NULL != err) {
|
|
71
|
+
return err;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
url = sek_fmt(pool, "%s/", sek_trimslash(pool, addr));
|
|
75
|
+
|
|
76
|
+
extras = sek_map_new(pool);
|
|
77
|
+
sek_map_set(extras, "content-type", "application/x-amz-json-1.1");
|
|
78
|
+
sek_map_set(extras, "x-amz-target", targetname);
|
|
79
|
+
|
|
80
|
+
memset(&input, 0, sizeof(input));
|
|
81
|
+
input.method = "POST";
|
|
82
|
+
input.url = url;
|
|
83
|
+
input.service = service;
|
|
84
|
+
input.region = region;
|
|
85
|
+
input.keyid = keyid;
|
|
86
|
+
input.secret = secret;
|
|
87
|
+
input.datetime = sek_awsnow(pool);
|
|
88
|
+
input.headers = extras;
|
|
89
|
+
input.body = payload;
|
|
90
|
+
input.session = sek_empty(session) ? NULL : session;
|
|
91
|
+
|
|
92
|
+
signed_ = sek_sigv4(pool, &input);
|
|
93
|
+
|
|
94
|
+
/* The signed headers go on top of the caller's. */
|
|
95
|
+
for (index = 0; index < signed_->len; index++) {
|
|
96
|
+
sek_map_set(extras, signed_->keys[index], signed_->vals[index]);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return sek_fetchjson(pool, "POST", url, extras, payload, out);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Does this AWS error body name the not-found type? AWS sends it fully
|
|
103
|
+
* qualified - `com.amazonaws...#ResourceNotFoundException` - so this is a
|
|
104
|
+
* containment test, and it is only ever consulted alongside a 400. */
|
|
105
|
+
static int awsmiss(sek_json *body, const char *type) {
|
|
106
|
+
const char *errtype = sek_json_asstr(sek_json_dig(body, "__type", NULL));
|
|
107
|
+
|
|
108
|
+
return NULL != errtype && sek_contains(errtype, type);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
static sek_err awssecrets_lookup(sek_provider *self, const char *name, char **out) {
|
|
112
|
+
awsdata *data = (awsdata *)self->data;
|
|
113
|
+
sek_pool *pool = data->pool;
|
|
114
|
+
sek_vaultref ref;
|
|
115
|
+
sek_json *payload;
|
|
116
|
+
sek_answer res;
|
|
117
|
+
sek_err err;
|
|
118
|
+
const char *text;
|
|
119
|
+
|
|
120
|
+
*out = NULL;
|
|
121
|
+
|
|
122
|
+
err = sek_vaultref_of(pool, name, &ref);
|
|
123
|
+
if (NULL != err) {
|
|
124
|
+
return err;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
payload = sek_json_obj(pool);
|
|
128
|
+
sek_json_set(pool, payload, "SecretId", sek_json_str(pool, ref.path));
|
|
129
|
+
|
|
130
|
+
err = awscall(data, "secretsmanager", "secretsmanager.GetSecretValue",
|
|
131
|
+
sek_json_stringify(pool, payload), &res);
|
|
132
|
+
if (NULL != err) {
|
|
133
|
+
return err;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (400 == res.status && awsmiss(res.body, "ResourceNotFoundException")) {
|
|
137
|
+
return NULL;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (200 != res.status) {
|
|
141
|
+
return sek_fmt(pool, "sekreto: aws secretsmanager error: %d", res.status);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
text = sek_json_asstr(sek_json_dig(res.body, "SecretString", NULL));
|
|
145
|
+
|
|
146
|
+
if (NULL == text) {
|
|
147
|
+
/* A binary secret has no fields to address, so only the conventional
|
|
148
|
+
* `value` field can mean "the bytes themselves". */
|
|
149
|
+
const char *bin = sek_json_asstr(sek_json_dig(res.body, "SecretBinary", NULL));
|
|
150
|
+
|
|
151
|
+
if (NULL != bin && 0 == strcmp(ref.field, "value")) {
|
|
152
|
+
size_t len = 0;
|
|
153
|
+
unsigned char *raw = sek_unbase64(pool, bin, &len);
|
|
154
|
+
|
|
155
|
+
if (NULL == raw) {
|
|
156
|
+
return sek_strdup(pool, "sekreto: aws secretsmanager: undecodable secret");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
*out = sek_strndup(pool, (const char *)raw, len);
|
|
160
|
+
return NULL;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return NULL;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
{
|
|
167
|
+
/* The AWS idiom is one JSON map per secret, so the secret's own value
|
|
168
|
+
* is parsed and the field taken out of it. */
|
|
169
|
+
sek_json *parsed = sek_json_parse(pool, text);
|
|
170
|
+
|
|
171
|
+
if (NULL != parsed && SEK_JSON_OBJ == parsed->type) {
|
|
172
|
+
const char *found = sek_json_text(pool, sek_json_dig(parsed, ref.field, NULL));
|
|
173
|
+
if (NULL != found) {
|
|
174
|
+
*out = sek_strdup(pool, found);
|
|
175
|
+
}
|
|
176
|
+
return NULL;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* A plain-string secret is the whole value; it has no named fields. */
|
|
181
|
+
if (0 == strcmp(ref.field, "value")) {
|
|
182
|
+
*out = sek_strdup(pool, text);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return NULL;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
static sek_err awsparams_lookup(sek_provider *self, const char *name, char **out) {
|
|
189
|
+
awsdata *data = (awsdata *)self->data;
|
|
190
|
+
sek_pool *pool = data->pool;
|
|
191
|
+
char *param = NULL;
|
|
192
|
+
sek_json *payload;
|
|
193
|
+
sek_answer res;
|
|
194
|
+
sek_err err = sek_awsparam(pool, name, data->prefix, ¶m);
|
|
195
|
+
const char *text;
|
|
196
|
+
|
|
197
|
+
*out = NULL;
|
|
198
|
+
|
|
199
|
+
if (NULL != err) {
|
|
200
|
+
return err;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
payload = sek_json_obj(pool);
|
|
204
|
+
sek_json_set(pool, payload, "Name", sek_json_str(pool, param));
|
|
205
|
+
sek_json_set(pool, payload, "WithDecryption", sek_json_bool(pool, 1));
|
|
206
|
+
|
|
207
|
+
err = awscall(data, "ssm", "AmazonSSM.GetParameter", sek_json_stringify(pool, payload), &res);
|
|
208
|
+
if (NULL != err) {
|
|
209
|
+
return err;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (400 == res.status && awsmiss(res.body, "ParameterNotFound")) {
|
|
213
|
+
return NULL;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (200 != res.status) {
|
|
217
|
+
return sek_fmt(pool, "sekreto: aws ssm error: %d", res.status);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Parameter Store carries flat strings: no field indirection. */
|
|
221
|
+
text = sek_json_text(pool, sek_json_dig(res.body, "Parameter", "Value", NULL));
|
|
222
|
+
if (NULL != text) {
|
|
223
|
+
*out = sek_strdup(pool, text);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return NULL;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
static const char *aws_describe(sek_provider *self) {
|
|
230
|
+
return ((awsdata *)self->data)->described;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* ---- the definitions ----------------------------------------------- */
|
|
234
|
+
|
|
235
|
+
/* One `make` for both kinds, taking the half that differs as an argument.
|
|
236
|
+
* They share every field of the spec and every byte of the signing; only
|
|
237
|
+
* the lookup and the description differ. */
|
|
238
|
+
static sek_err aws_make(sek_pool *pool, const sek_spec *spec, int params, sek_provider **out) {
|
|
239
|
+
awsdata *data = (awsdata *)sek_alloc(pool, sizeof(awsdata));
|
|
240
|
+
|
|
241
|
+
data->pool = pool;
|
|
242
|
+
data->region = sek_own(pool, spec->region);
|
|
243
|
+
data->keyid = sek_own(pool, spec->keyid);
|
|
244
|
+
data->secret = sek_own(pool, spec->secret);
|
|
245
|
+
data->session = sek_own(pool, spec->session);
|
|
246
|
+
data->addr = sek_own(pool, spec->addr);
|
|
247
|
+
data->prefix = sek_own(pool, spec->prefix);
|
|
248
|
+
|
|
249
|
+
/* Config only, never the environment: describe() feeds the spec's
|
|
250
|
+
* sources group, which must answer the same everywhere. */
|
|
251
|
+
if (params) {
|
|
252
|
+
data->described =
|
|
253
|
+
sek_fmt(pool, "awsparams:%s%s", sek_orempty(spec->region), sek_orempty(spec->prefix));
|
|
254
|
+
} else {
|
|
255
|
+
data->described = sek_fmt(pool, "awssecrets:%s", sek_orempty(spec->region));
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
*out = sek_provider_new(pool, params ? awsparams_lookup : awssecrets_lookup, aws_describe, data);
|
|
259
|
+
|
|
260
|
+
return NULL;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
static sek_err awssecrets_make(sek_pool *pool, const sek_spec *spec, sek_provider **out) {
|
|
264
|
+
return aws_make(pool, spec, 0, out);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
static sek_err awsparams_make(sek_pool *pool, const sek_spec *spec, sek_provider **out) {
|
|
268
|
+
return aws_make(pool, spec, 1, out);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
static sek_providerkind AWSSECRETS_KIND;
|
|
272
|
+
|
|
273
|
+
Definition *sek_plugin_awssecrets(void) {
|
|
274
|
+
return sek_providerplugin(&AWSSECRETS_KIND, "awssecrets", awssecrets_make);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
static sek_providerkind AWSPARAMS_KIND;
|
|
278
|
+
|
|
279
|
+
Definition *sek_plugin_awsparams(void) {
|
|
280
|
+
return sek_providerplugin(&AWSPARAMS_KIND, "awsparams", awsparams_make);
|
|
281
|
+
}
|