@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,315 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (lua/src/sekreto/name.lua)
|
|
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
|
+
-- The pure name functions: everything sekreto knows about a secret's
|
|
5
|
+
-- name before any store is asked.
|
|
6
|
+
--
|
|
7
|
+
-- All synchronous, all pure, all accepting any Lua value - the shared
|
|
8
|
+
-- corpus feeds them numbers, booleans and nulls. All of them check the
|
|
9
|
+
-- name first, except `validname`, which never raises at all.
|
|
10
|
+
--
|
|
11
|
+
-- These live in their own module rather than in `sekreto.lua` because the
|
|
12
|
+
-- providers need them too, and `sekreto.lua` requires the providers: one
|
|
13
|
+
-- of the two edges has to be somewhere else.
|
|
14
|
+
--
|
|
15
|
+
-- A port of typescript/src/Sekreto.ts, which is canonical.
|
|
16
|
+
|
|
17
|
+
local err = require('feature.secrets.sekreto.err')
|
|
18
|
+
|
|
19
|
+
local M = {}
|
|
20
|
+
|
|
21
|
+
-- ASCII case folding, spelled out. `string.upper` goes through the C
|
|
22
|
+
-- library's toupper, which follows the machine's locale - and in a
|
|
23
|
+
-- Turkish locale `i` does not fold to `I`, which would silently change
|
|
24
|
+
-- every environment-variable key this library computes.
|
|
25
|
+
local function upperascii(text)
|
|
26
|
+
return (text:gsub('[a-z]', function(ch) return string.char(ch:byte() - 32) end))
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
--- Split on `.`, keeping empty segments (so `a..b` yields an empty one).
|
|
30
|
+
local function segments(name)
|
|
31
|
+
local out = {}
|
|
32
|
+
local at = 1
|
|
33
|
+
|
|
34
|
+
while true do
|
|
35
|
+
local stop = name:find('.', at, true)
|
|
36
|
+
if not stop then
|
|
37
|
+
out[#out + 1] = name:sub(at)
|
|
38
|
+
return out
|
|
39
|
+
end
|
|
40
|
+
out[#out + 1] = name:sub(at, stop - 1)
|
|
41
|
+
at = stop + 1
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
M.segments = segments
|
|
46
|
+
|
|
47
|
+
--- Is this a well-formed secret name? Never raises, whatever it is given.
|
|
48
|
+
---
|
|
49
|
+
--- Scanned byte by byte rather than matched against `^[a-z0-9_]+$`: in
|
|
50
|
+
--- several languages `$` also matches before a final newline, and four
|
|
51
|
+
--- ports accepted `api.token\n` because of it. A scan cannot make that
|
|
52
|
+
--- mistake, and the corpus pins all three newline forms as false.
|
|
53
|
+
function M.validname(name)
|
|
54
|
+
if 'string' ~= type(name) or '' == name then
|
|
55
|
+
return false
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
for _, part in ipairs(segments(name)) do
|
|
59
|
+
if '' == part then
|
|
60
|
+
return false
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
for index = 1, #part do
|
|
64
|
+
local byte = part:byte(index)
|
|
65
|
+
local okbyte = (97 <= byte and 122 >= byte) or
|
|
66
|
+
(48 <= byte and 57 >= byte) or
|
|
67
|
+
95 == byte
|
|
68
|
+
|
|
69
|
+
if not okbyte then
|
|
70
|
+
return false
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
return true
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
--- The name, or a SekretoError. Every entry point checks its name here.
|
|
79
|
+
function M.checkname(name)
|
|
80
|
+
if not M.validname(name) then
|
|
81
|
+
err.fail('sekreto: invalid name: ' .. ('string' == type(name) and name or
|
|
82
|
+
(nil == name and '' or tostring(name))))
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
return name
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
--- The environment-variable key for a name: `api.token` -> `API_TOKEN`.
|
|
89
|
+
--- The prefix is joined verbatim and is NOT uppercased.
|
|
90
|
+
function M.envkey(name, prefix)
|
|
91
|
+
local checked = M.checkname(name)
|
|
92
|
+
return (prefix or '') .. upperascii(table.concat(segments(checked), '_'))
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
--- Where a name lives in a KV vault: `api.token` -> `api` / `token`.
|
|
96
|
+
---
|
|
97
|
+
--- A single-segment name has no path of its own, so it becomes a secret
|
|
98
|
+
--- of that name with the conventional field `value`.
|
|
99
|
+
function M.vaultref(name)
|
|
100
|
+
local parts = segments(M.checkname(name))
|
|
101
|
+
|
|
102
|
+
if 1 == #parts then
|
|
103
|
+
return { path = parts[1], field = 'value' }
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
local field = parts[#parts]
|
|
107
|
+
table.remove(parts)
|
|
108
|
+
|
|
109
|
+
return { path = table.concat(parts, '/'), field = field }
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
--- A name flattened to one segment: `api.token` -> `api_token` (GCP
|
|
113
|
+
--- Secret Manager, `_`) or `api-token` (Azure Key Vault, `-`).
|
|
114
|
+
---
|
|
115
|
+
--- With `-` as the separator underscores flatten too: Key Vault's
|
|
116
|
+
--- alphabet is letters, digits and hyphens only, so `with_underscore`
|
|
117
|
+
--- must still be representable there.
|
|
118
|
+
function M.flatname(name, sep)
|
|
119
|
+
local usesep = sep or ''
|
|
120
|
+
local flat = table.concat(segments(M.checkname(name)), usesep)
|
|
121
|
+
|
|
122
|
+
if '-' == usesep then
|
|
123
|
+
return (flat:gsub('_', '-'))
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
return flat
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
--- The AWS SSM Parameter Store name: dots become the path hierarchy,
|
|
130
|
+
--- rooted at `/` or at a prefix. `db.pass.main` -> `/db/pass/main`.
|
|
131
|
+
function M.awsparam(name, prefix)
|
|
132
|
+
local checked = M.checkname(name)
|
|
133
|
+
|
|
134
|
+
local base = prefix or ''
|
|
135
|
+
if '' ~= base and '/' ~= base:sub(1, 1) then
|
|
136
|
+
base = '/' .. base
|
|
137
|
+
end
|
|
138
|
+
if '/' == base:sub(-1) then
|
|
139
|
+
base = base:sub(1, #base - 1)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
return base .. '/' .. table.concat(segments(checked), '/')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
local function trim(text)
|
|
146
|
+
return (text:gsub('^[ \t\r\n\f\v]+', ''):gsub('[ \t\r\n\f\v]+$', ''))
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
M.trim = trim
|
|
150
|
+
|
|
151
|
+
--- Unescape a double-quoted `.env` value.
|
|
152
|
+
---
|
|
153
|
+
--- `\n \r \t \\ \"` only. Any other escape is preserved as backslash plus
|
|
154
|
+
--- the character, and a trailing backslash is literal. A scan, not a
|
|
155
|
+
--- chain of replacements, so `\\n` cannot be read as a newline.
|
|
156
|
+
local function unescape(text)
|
|
157
|
+
local out = {}
|
|
158
|
+
local index = 1
|
|
159
|
+
|
|
160
|
+
while index <= #text do
|
|
161
|
+
local ch = text:sub(index, index)
|
|
162
|
+
|
|
163
|
+
if '\\' == ch and index < #text then
|
|
164
|
+
local next = text:sub(index + 1, index + 1)
|
|
165
|
+
index = index + 2
|
|
166
|
+
|
|
167
|
+
if 'n' == next then
|
|
168
|
+
out[#out + 1] = '\n'
|
|
169
|
+
elseif 'r' == next then
|
|
170
|
+
out[#out + 1] = '\r'
|
|
171
|
+
elseif 't' == next then
|
|
172
|
+
out[#out + 1] = '\t'
|
|
173
|
+
elseif '\\' == next then
|
|
174
|
+
out[#out + 1] = '\\'
|
|
175
|
+
elseif '"' == next then
|
|
176
|
+
out[#out + 1] = '"'
|
|
177
|
+
else
|
|
178
|
+
out[#out + 1] = '\\' .. next
|
|
179
|
+
end
|
|
180
|
+
else
|
|
181
|
+
out[#out + 1] = ch
|
|
182
|
+
index = index + 1
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
return table.concat(out)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
--- Parse `.env` text into raw keys and values.
|
|
190
|
+
---
|
|
191
|
+
--- There is no `.env` standard, so this function IS the specification:
|
|
192
|
+
--- `KEY=value`, an optional `export`, `#` comments on their own line, and
|
|
193
|
+
--- single- or double-quoted values (double quotes also unescape). A line
|
|
194
|
+
--- with no `=`, or with an empty key, is skipped silently rather than
|
|
195
|
+
--- aborting the rest of the file.
|
|
196
|
+
---
|
|
197
|
+
--- Returns a plain table of key to value, plus the key order under
|
|
198
|
+
--- `order` - Lua tables have no insertion order of their own.
|
|
199
|
+
function M.parsedotenv(text)
|
|
200
|
+
local values = {}
|
|
201
|
+
local order = {}
|
|
202
|
+
|
|
203
|
+
if 'string' ~= type(text) then
|
|
204
|
+
return values, order
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
local at = 1
|
|
208
|
+
|
|
209
|
+
while at <= #text + 1 do
|
|
210
|
+
local stop = text:find('\n', at, true)
|
|
211
|
+
local rawline = stop and text:sub(at, stop - 1) or text:sub(at)
|
|
212
|
+
at = (stop or #text) + 1
|
|
213
|
+
|
|
214
|
+
if '\r' == rawline:sub(-1) then
|
|
215
|
+
rawline = rawline:sub(1, #rawline - 1)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
local line = trim(rawline)
|
|
219
|
+
|
|
220
|
+
if '' ~= line and '#' ~= line:sub(1, 1) then
|
|
221
|
+
local body = line
|
|
222
|
+
if 'export ' == body:sub(1, 7) then
|
|
223
|
+
body = trim(body:sub(8))
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
local eq = body:find('=', 1, true)
|
|
227
|
+
|
|
228
|
+
-- `nil` is "no =", `1` is "empty key": both are skipped.
|
|
229
|
+
if nil ~= eq and 1 < eq then
|
|
230
|
+
local key = trim(body:sub(1, eq - 1))
|
|
231
|
+
local value = trim(body:sub(eq + 1))
|
|
232
|
+
|
|
233
|
+
if 2 <= #value and '"' == value:sub(1, 1) and '"' == value:sub(-1) then
|
|
234
|
+
value = unescape(value:sub(2, #value - 1))
|
|
235
|
+
elseif 2 <= #value and "'" == value:sub(1, 1) and "'" == value:sub(-1) then
|
|
236
|
+
value = value:sub(2, #value - 1)
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if nil == values[key] then
|
|
240
|
+
order[#order + 1] = key
|
|
241
|
+
end
|
|
242
|
+
values[key] = value
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
if not stop then
|
|
247
|
+
break
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
return values, order
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
--- Replace every occurrence of `needle` in `text` with `replacement`.
|
|
255
|
+
--- A literal search, never a pattern: a secret containing `%` or `-`
|
|
256
|
+
--- must not be interpreted as one.
|
|
257
|
+
local function replaceall(text, needle, replacement)
|
|
258
|
+
local out = {}
|
|
259
|
+
local at = 1
|
|
260
|
+
|
|
261
|
+
while true do
|
|
262
|
+
local start, stop = text:find(needle, at, true)
|
|
263
|
+
if not start then
|
|
264
|
+
out[#out + 1] = text:sub(at)
|
|
265
|
+
return table.concat(out)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
out[#out + 1] = text:sub(at, start - 1)
|
|
269
|
+
out[#out + 1] = replacement
|
|
270
|
+
at = stop + 1
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
--- Replace known secret values in text with `[redacted]`.
|
|
275
|
+
---
|
|
276
|
+
--- Only values of four characters or more: shorter ones are too likely to
|
|
277
|
+
--- appear in ordinary text, and redacting them would make logs unreadable
|
|
278
|
+
--- without making them safer.
|
|
279
|
+
---
|
|
280
|
+
--- Longest first, always, so `abcd1234` is replaced before `abcd` can eat
|
|
281
|
+
--- its prefix - the corpus pins both arrival orders of that pair. The
|
|
282
|
+
--- list is COPIED before sorting: `Sekreto.redact` passes its own live
|
|
283
|
+
--- redaction history, and an in-place sort would reorder it.
|
|
284
|
+
function M.redact(text, values)
|
|
285
|
+
local out = 'string' == type(text) and text or ''
|
|
286
|
+
|
|
287
|
+
local usable = {}
|
|
288
|
+
for _, value in ipairs(values or {}) do
|
|
289
|
+
if 'string' == type(value) and 4 <= #value then
|
|
290
|
+
usable[#usable + 1] = value
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
table.sort(usable, function(left, right) return #left > #right end)
|
|
295
|
+
|
|
296
|
+
for _, value in ipairs(usable) do
|
|
297
|
+
out = replaceall(out, value, '[redacted]')
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
return out
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
--- The store name a provider answers to when nothing says otherwise.
|
|
304
|
+
---
|
|
305
|
+
--- `describe()` opens with the provider's kind - `hashicorp:...`,
|
|
306
|
+
--- `dotenv:...`, plain `env` - so the kind is the natural default, and a
|
|
307
|
+
--- custom provider gets a sensible name without implementing anything
|
|
308
|
+
--- extra.
|
|
309
|
+
function M.storename(provider)
|
|
310
|
+
local text = provider.describe()
|
|
311
|
+
local mark = text:find(':', 1, true)
|
|
312
|
+
return mark and text:sub(1, mark - 1) or text
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
return M
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (lua/src/sekreto/plugins/aws.lua)
|
|
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
|
+
-- The aws plugin: Secrets Manager and SSM Parameter Store, two kinds in
|
|
5
|
+
-- one module because they share SigV4 request signing and one signed
|
|
6
|
+
-- call.
|
|
7
|
+
--
|
|
8
|
+
-- SIGV4 TRAVELS WITH THIS PLUGIN. It is the crypto edge - HMAC-SHA256 -
|
|
9
|
+
-- and the core of no port imports a hash function, so
|
|
10
|
+
-- sekreto.plugins.sigv4 and the SHA-256 in sekreto.plugins.crypto behind
|
|
11
|
+
-- it are reached from here and from nowhere else in the library.
|
|
12
|
+
--
|
|
13
|
+
-- A port of typescript/plugins/aws.ts, which is canonical.
|
|
14
|
+
|
|
15
|
+
local err = require('feature.secrets.sekreto.err')
|
|
16
|
+
local name = require('feature.secrets.sekreto.name')
|
|
17
|
+
local addr = require('feature.secrets.sekreto.addr')
|
|
18
|
+
local providers = require('feature.secrets.sekreto.providers')
|
|
19
|
+
local json = require('feature.secrets.sekreto.plugins.json')
|
|
20
|
+
local httpjson = require('feature.secrets.sekreto.plugins.httpjson')
|
|
21
|
+
local support = require('feature.secrets.sekreto.plugins.support')
|
|
22
|
+
local crypto = require('feature.secrets.sekreto.plugins.crypto')
|
|
23
|
+
local sigv4 = require('feature.secrets.sekreto.plugins.sigv4')
|
|
24
|
+
|
|
25
|
+
local fail = err.fail
|
|
26
|
+
local trimslash = providers.trimslash
|
|
27
|
+
local providerplugin = providers.providerplugin
|
|
28
|
+
local first = support.first
|
|
29
|
+
local awsnow = support.awsnow
|
|
30
|
+
local fetchjson = httpjson.fetchjson
|
|
31
|
+
|
|
32
|
+
local M = {}
|
|
33
|
+
|
|
34
|
+
--- Region and credentials, from config first and the standard AWS_*
|
|
35
|
+
--- environment variables second. Missing either is an error: an AWS store
|
|
36
|
+
--- with no credentials could not answer.
|
|
37
|
+
local function awsauth(region, keyid, secret, session)
|
|
38
|
+
local useregion = first(region, os.getenv('AWS_REGION'), os.getenv('AWS_DEFAULT_REGION'))
|
|
39
|
+
local usekeyid = first(keyid, os.getenv('AWS_ACCESS_KEY_ID'))
|
|
40
|
+
local usesecret = first(secret, os.getenv('AWS_SECRET_ACCESS_KEY'))
|
|
41
|
+
local usesession = first(session, os.getenv('AWS_SESSION_TOKEN'))
|
|
42
|
+
|
|
43
|
+
if '' == useregion then
|
|
44
|
+
fail('sekreto: aws: no region (set region or AWS_REGION)')
|
|
45
|
+
end
|
|
46
|
+
if '' == usekeyid or '' == usesecret then
|
|
47
|
+
fail('sekreto: aws: no credentials' ..
|
|
48
|
+
' (set keyid/secret or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)')
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
region = useregion,
|
|
53
|
+
keyid = usekeyid,
|
|
54
|
+
secret = usesecret,
|
|
55
|
+
session = ('' == usesession) and nil or usesession,
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
M.awsauth = awsauth
|
|
60
|
+
|
|
61
|
+
--- One signed call to an AWS JSON-1.1 API.
|
|
62
|
+
local function awscall(region, keyid, secret, session, useaddr, service, target, payload)
|
|
63
|
+
local auth = awsauth(region, keyid, secret, session)
|
|
64
|
+
|
|
65
|
+
-- The China partition lives under its own suffix; every other
|
|
66
|
+
-- commercial region is plain amazonaws.com.
|
|
67
|
+
local suffix = ('cn-' == auth.region:sub(1, 3)) and '.amazonaws.com.cn'
|
|
68
|
+
or '.amazonaws.com'
|
|
69
|
+
local address = first(useaddr, 'https://' .. service .. '.' .. auth.region .. suffix)
|
|
70
|
+
addr.checkaddr(address)
|
|
71
|
+
|
|
72
|
+
local url = trimslash(address) .. '/'
|
|
73
|
+
|
|
74
|
+
local extras = {
|
|
75
|
+
{ 'content-type', 'application/x-amz-json-1.1' },
|
|
76
|
+
{ 'x-amz-target', target },
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
local signed = sigv4.sigv4({
|
|
80
|
+
method = 'POST',
|
|
81
|
+
url = url,
|
|
82
|
+
service = service,
|
|
83
|
+
region = auth.region,
|
|
84
|
+
keyid = auth.keyid,
|
|
85
|
+
secret = auth.secret,
|
|
86
|
+
datetime = awsnow(),
|
|
87
|
+
headers = extras,
|
|
88
|
+
body = payload,
|
|
89
|
+
session = auth.session,
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
local headers = {}
|
|
93
|
+
for _, pair in ipairs(extras) do
|
|
94
|
+
headers[#headers + 1] = pair
|
|
95
|
+
end
|
|
96
|
+
for _, pair in ipairs(signed) do
|
|
97
|
+
headers[#headers + 1] = pair
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
return fetchjson('POST', url, headers, payload)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
--- Does this AWS error body name one of the not-found types? Those are a
|
|
104
|
+
--- miss; every other failure is a store that could not answer.
|
|
105
|
+
local function awsmiss(body, ...)
|
|
106
|
+
local errtype = json.asstr(json.dig(body, '__type'))
|
|
107
|
+
if nil == errtype then
|
|
108
|
+
return false
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
for _, want in ipairs({ ... }) do
|
|
112
|
+
if nil ~= errtype:find(want, 1, true) then
|
|
113
|
+
return true
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
return false
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
M.awsmiss = awsmiss
|
|
121
|
+
|
|
122
|
+
--- AWS Secrets Manager.
|
|
123
|
+
---
|
|
124
|
+
--- `api.token` reads the secret named `api` (the vaultref path) and takes
|
|
125
|
+
--- the `token` field of its JSON SecretString - the AWS idiom of one JSON
|
|
126
|
+
--- map per secret. A SecretString that is not JSON is the value itself,
|
|
127
|
+
--- under the conventional field `value`.
|
|
128
|
+
local function awssecrets(region, keyid, secret, session, useaddr)
|
|
129
|
+
return {
|
|
130
|
+
lookup = function(name_)
|
|
131
|
+
local ref = name.vaultref(name_)
|
|
132
|
+
|
|
133
|
+
local res = awscall(
|
|
134
|
+
region, keyid, secret, session, useaddr,
|
|
135
|
+
'secretsmanager', 'secretsmanager.GetSecretValue',
|
|
136
|
+
json.stringify(json.obj({ { 'SecretId', ref.path } }))
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
if 400 == res.status and awsmiss(res.body, 'ResourceNotFoundException') then
|
|
140
|
+
return nil
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if 200 ~= res.status then
|
|
144
|
+
fail('sekreto: aws secretsmanager error: ' .. res.status)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
local text = json.asstr(json.dig(res.body, 'SecretString'))
|
|
148
|
+
|
|
149
|
+
if nil == text then
|
|
150
|
+
-- A binary secret has no fields to address; only the conventional
|
|
151
|
+
-- `value` field can mean "the bytes themselves".
|
|
152
|
+
local bin = json.asstr(json.dig(res.body, 'SecretBinary'))
|
|
153
|
+
if nil ~= bin and 'value' == ref.field then
|
|
154
|
+
local decoded = crypto.unbase64(bin)
|
|
155
|
+
if nil == decoded then
|
|
156
|
+
fail('sekreto: aws secretsmanager: undecodable secret')
|
|
157
|
+
end
|
|
158
|
+
return decoded
|
|
159
|
+
end
|
|
160
|
+
return nil
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
local parsed = json.parse(text)
|
|
164
|
+
|
|
165
|
+
if json.isobj(parsed) then
|
|
166
|
+
return json.text(parsed.vals[ref.field])
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
-- A plain-string secret is the whole value; it has no named fields.
|
|
170
|
+
if 'value' == ref.field then
|
|
171
|
+
return text
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
return nil
|
|
175
|
+
end,
|
|
176
|
+
-- Config only, never the environment: describe() feeds the spec's
|
|
177
|
+
-- sources group, which must answer the same everywhere.
|
|
178
|
+
describe = function()
|
|
179
|
+
return 'awssecrets:' .. (region or '')
|
|
180
|
+
end,
|
|
181
|
+
}
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
--- AWS SSM Parameter Store.
|
|
185
|
+
---
|
|
186
|
+
--- `db.pass.main` reads the parameter `/db/pass/main` (under an optional
|
|
187
|
+
--- prefix path), decrypted. Parameter Store carries flat strings, so
|
|
188
|
+
--- there is no field indirection.
|
|
189
|
+
local function awsparams(region, keyid, secret, session, useaddr, prefix)
|
|
190
|
+
return {
|
|
191
|
+
lookup = function(name_)
|
|
192
|
+
local payload = json.obj({
|
|
193
|
+
{ 'Name', name.awsparam(name_, prefix) },
|
|
194
|
+
{ 'WithDecryption', true },
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
local res = awscall(
|
|
198
|
+
region, keyid, secret, session, useaddr,
|
|
199
|
+
'ssm', 'AmazonSSM.GetParameter', json.stringify(payload)
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
if 400 == res.status and awsmiss(res.body, 'ParameterNotFound') then
|
|
203
|
+
return nil
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
if 200 ~= res.status then
|
|
207
|
+
fail('sekreto: aws ssm error: ' .. res.status)
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
return json.text(json.dig(res.body, 'Parameter', 'Value'))
|
|
211
|
+
end,
|
|
212
|
+
describe = function()
|
|
213
|
+
return 'awsparams:' .. (region or '') .. (prefix or '')
|
|
214
|
+
end,
|
|
215
|
+
}
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
--- The two kinds, as voxgig/plugin definitions.
|
|
219
|
+
M.awssecrets = providerplugin('awssecrets', function(spec)
|
|
220
|
+
return awssecrets(spec.region, spec.keyid, spec.secret, spec.session, spec.addr)
|
|
221
|
+
end)
|
|
222
|
+
|
|
223
|
+
M.awsparams = providerplugin('awsparams', function(spec)
|
|
224
|
+
return awsparams(spec.region, spec.keyid, spec.secret, spec.session,
|
|
225
|
+
spec.addr, spec.prefix)
|
|
226
|
+
end)
|
|
227
|
+
|
|
228
|
+
return M
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
-- VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (lua/src/sekreto/plugins/azuresecrets.lua)
|
|
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
|
+
-- The azuresecrets plugin: Azure Key Vault, over HTTPS, with a
|
|
5
|
+
-- client-credentials login and the IMDS managed-identity endpoint.
|
|
6
|
+
--
|
|
7
|
+
-- A port of typescript/plugins/azuresecrets.ts, which is canonical.
|
|
8
|
+
|
|
9
|
+
local err = require('feature.secrets.sekreto.err')
|
|
10
|
+
local name = require('feature.secrets.sekreto.name')
|
|
11
|
+
local addr = require('feature.secrets.sekreto.addr')
|
|
12
|
+
local providers = require('feature.secrets.sekreto.providers')
|
|
13
|
+
local json = require('feature.secrets.sekreto.plugins.json')
|
|
14
|
+
local httpjson = require('feature.secrets.sekreto.plugins.httpjson')
|
|
15
|
+
local support = require('feature.secrets.sekreto.plugins.support')
|
|
16
|
+
|
|
17
|
+
local fail = err.fail
|
|
18
|
+
local nonempty = providers.nonempty
|
|
19
|
+
local trimslash = providers.trimslash
|
|
20
|
+
local providerplugin = providers.providerplugin
|
|
21
|
+
local first = support.first
|
|
22
|
+
local nowms = support.nowms
|
|
23
|
+
local renewtime = support.renewtime
|
|
24
|
+
local NEVER = support.NEVER
|
|
25
|
+
local fetchjson = httpjson.fetchjson
|
|
26
|
+
local uriescape = support.uriescape
|
|
27
|
+
|
|
28
|
+
local M = {}
|
|
29
|
+
|
|
30
|
+
local AZURERESOURCE = 'https://vault.azure.net'
|
|
31
|
+
|
|
32
|
+
--- Azure Key Vault.
|
|
33
|
+
---
|
|
34
|
+
--- `api.token` reads secret `api-token` (dots flattened to `-`; Key Vault
|
|
35
|
+
--- names allow nothing else), current version. The token comes from
|
|
36
|
+
--- config, then a client-credentials login when tenant/clientid/
|
|
37
|
+
--- clientsecret are given, then the IMDS managed-identity endpoint.
|
|
38
|
+
local function azuresecrets(vault, token, tenant, clientid, clientsecret,
|
|
39
|
+
loginaddr, imdsaddr, apiversion)
|
|
40
|
+
local livetoken = nil
|
|
41
|
+
local renewat = NEVER
|
|
42
|
+
|
|
43
|
+
local function login()
|
|
44
|
+
if nonempty(token) then
|
|
45
|
+
return token
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
if nonempty(tenant) and nonempty(clientid) and nonempty(clientsecret) then
|
|
49
|
+
local useloginaddr = first(loginaddr, 'https://login.microsoftonline.com')
|
|
50
|
+
addr.checkaddr(useloginaddr)
|
|
51
|
+
|
|
52
|
+
local url = trimslash(useloginaddr) .. '/' .. tenant .. '/oauth2/v2.0/token'
|
|
53
|
+
local form = 'grant_type=client_credentials&client_id=' ..
|
|
54
|
+
uriescape(clientid) ..
|
|
55
|
+
'&client_secret=' .. uriescape(clientsecret) ..
|
|
56
|
+
'&scope=' .. uriescape(AZURERESOURCE .. '/.default')
|
|
57
|
+
|
|
58
|
+
local res = fetchjson(
|
|
59
|
+
'POST', url,
|
|
60
|
+
{ { 'content-type', 'application/x-www-form-urlencoded' } },
|
|
61
|
+
form
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
local got = json.text(json.dig(res.body, 'access_token'))
|
|
65
|
+
if 200 ~= res.status or nil == got or '' == got then
|
|
66
|
+
fail('sekreto: azure login failed: ' .. res.status)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
renewat = renewtime(json.dig(res.body, 'expires_in'))
|
|
70
|
+
return got
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
local imds = trimslash(first(imdsaddr, 'http://169.254.169.254')) ..
|
|
74
|
+
'/metadata/identity/oauth2/token?api-version=2018-02-01&resource=' ..
|
|
75
|
+
uriescape(AZURERESOURCE)
|
|
76
|
+
|
|
77
|
+
local res = fetchjson('GET', imds, { { 'Metadata', 'true' } })
|
|
78
|
+
|
|
79
|
+
local got = json.text(json.dig(res.body, 'access_token'))
|
|
80
|
+
if 200 ~= res.status or nil == got or '' == got then
|
|
81
|
+
fail('sekreto: azure: no token, no client credentials, and IMDS did not answer')
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
-- IMDS sends expires_in as a STRING, unlike everyone else.
|
|
85
|
+
renewat = renewtime(json.dig(res.body, 'expires_in'))
|
|
86
|
+
return got
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
return {
|
|
90
|
+
lookup = function(secret)
|
|
91
|
+
local usevault = vault or ''
|
|
92
|
+
if '' == usevault then
|
|
93
|
+
fail('sekreto: azure: no vault')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
-- Only an explicit scheme is a URL; a vault NAMED httpvault must
|
|
97
|
+
-- still become https://httpvault.vault.azure.net.
|
|
98
|
+
local vaulturl
|
|
99
|
+
if 'http://' == usevault:sub(1, 7) or 'https://' == usevault:sub(1, 8) then
|
|
100
|
+
vaulturl = usevault
|
|
101
|
+
else
|
|
102
|
+
vaulturl = 'https://' .. usevault .. '.vault.azure.net'
|
|
103
|
+
end
|
|
104
|
+
addr.checkaddr(vaulturl)
|
|
105
|
+
|
|
106
|
+
if nil == livetoken or nowms() >= renewat then
|
|
107
|
+
livetoken = login()
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
local url = trimslash(vaulturl) .. '/secrets/' .. name.flatname(secret, '-') ..
|
|
111
|
+
'?api-version=' .. first(apiversion, '7.4')
|
|
112
|
+
|
|
113
|
+
local res = fetchjson('GET', url, { { 'authorization', 'Bearer ' .. livetoken } })
|
|
114
|
+
|
|
115
|
+
if 404 == res.status then
|
|
116
|
+
return nil
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if 200 ~= res.status then
|
|
120
|
+
fail('sekreto: azure error: ' .. res.status .. ': ' .. addr.bare(url))
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
return json.text(json.dig(res.body, 'value'))
|
|
124
|
+
end,
|
|
125
|
+
describe = function()
|
|
126
|
+
return 'azuresecrets:' .. (vault or '')
|
|
127
|
+
end,
|
|
128
|
+
}
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
--- The kind, as a voxgig/plugin definition.
|
|
132
|
+
M.azuresecrets = providerplugin('azuresecrets', function(spec)
|
|
133
|
+
return azuresecrets(spec.vault, spec.token, spec.tenant, spec.clientid,
|
|
134
|
+
spec.clientsecret, spec.loginaddr, spec.imdsaddr, spec.apiversion)
|
|
135
|
+
end)
|
|
136
|
+
|
|
137
|
+
return M
|