@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,312 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/src/Provider.cpp)
|
|
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
|
+
#include "Provider.hpp"
|
|
5
|
+
|
|
6
|
+
#include <map>
|
|
7
|
+
|
|
8
|
+
#include "../plugin/ref.hpp"
|
|
9
|
+
#include "../plugin/types.hpp"
|
|
10
|
+
|
|
11
|
+
namespace sekreto {
|
|
12
|
+
|
|
13
|
+
// ---------------------------------------------------------- the ordered map
|
|
14
|
+
|
|
15
|
+
bool Ordered::has(const std::string& key) const {
|
|
16
|
+
for (const auto& entry : pairs) {
|
|
17
|
+
if (key == entry.first) return true;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
std::optional<std::string> Ordered::get(const std::string& key) const {
|
|
23
|
+
for (const auto& entry : pairs) {
|
|
24
|
+
if (key == entry.first) return entry.second;
|
|
25
|
+
}
|
|
26
|
+
return std::nullopt;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
void Ordered::set(const std::string& key, const std::string& value) {
|
|
30
|
+
for (auto& entry : pairs) {
|
|
31
|
+
if (key == entry.first) {
|
|
32
|
+
entry.second = value;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
pairs.emplace_back(key, value);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ------------------------------------------------------------- the specs
|
|
40
|
+
|
|
41
|
+
namespace {
|
|
42
|
+
|
|
43
|
+
/// What a credential field reports about itself.
|
|
44
|
+
std::string setornot(const std::string& value) {
|
|
45
|
+
return value.empty() ? "[unset]" : "[set]";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
} // namespace
|
|
49
|
+
|
|
50
|
+
std::string AuthSpec::str() const {
|
|
51
|
+
return "AuthSpec(method=" + method + ", mount=" + mount + ", role=" + role +
|
|
52
|
+
", jwtfile=" + jwtfile + ", roleid=" + roleid + ", jwt=" + setornot(jwt) +
|
|
53
|
+
", secretid=" + setornot(secretid) + ")";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
std::string ProviderSpec::str() const {
|
|
57
|
+
return "ProviderSpec(kind=" + kind + ", name=" + name + ", addr=" + addr +
|
|
58
|
+
", token=" + setornot(token) + ", secret=" + setornot(secret) +
|
|
59
|
+
", clientsecret=" + setornot(clientsecret) +
|
|
60
|
+
", auth=" + (auth.has_value() ? auth.value().str() : "none") + ")";
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ------------------------------------------------ the spec as plugin options
|
|
64
|
+
|
|
65
|
+
namespace {
|
|
66
|
+
|
|
67
|
+
/// A string field, written only when it is set. "Not configured" and
|
|
68
|
+
/// "configured empty" are the same thing here, so an empty string is an
|
|
69
|
+
/// absent key and the options map reads like the configuration.
|
|
70
|
+
void setstr(const plugin::V& out, const std::string& key, const std::string& text) {
|
|
71
|
+
if (!text.empty()) plugin::set(out, key, plugin::vstr(text));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
std::string strof(const plugin::V& options, const std::string& key) {
|
|
75
|
+
plugin::V given = plugin::get(options, key);
|
|
76
|
+
return plugin::isstr(given) ? plugin::asstr(given) : "";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
} // namespace
|
|
80
|
+
|
|
81
|
+
plugin::V optionsof(const ProviderSpec& spec) {
|
|
82
|
+
plugin::V out = plugin::vmap();
|
|
83
|
+
|
|
84
|
+
setstr(out, "kind", spec.kind);
|
|
85
|
+
setstr(out, "name", spec.name);
|
|
86
|
+
setstr(out, "prefix", spec.prefix);
|
|
87
|
+
setstr(out, "file", spec.file);
|
|
88
|
+
setstr(out, "dir", spec.dir);
|
|
89
|
+
setstr(out, "addr", spec.addr);
|
|
90
|
+
setstr(out, "token", spec.token);
|
|
91
|
+
setstr(out, "mount", spec.mount);
|
|
92
|
+
setstr(out, "vaultnamespace", spec.vaultnamespace);
|
|
93
|
+
setstr(out, "command", spec.command);
|
|
94
|
+
setstr(out, "profile", spec.profile);
|
|
95
|
+
setstr(out, "backend", spec.backend);
|
|
96
|
+
setstr(out, "reason", spec.reason);
|
|
97
|
+
setstr(out, "namespace", spec.namespace_);
|
|
98
|
+
setstr(out, "home", spec.home);
|
|
99
|
+
setstr(out, "region", spec.region);
|
|
100
|
+
setstr(out, "keyid", spec.keyid);
|
|
101
|
+
setstr(out, "secret", spec.secret);
|
|
102
|
+
setstr(out, "session", spec.session);
|
|
103
|
+
setstr(out, "project", spec.project);
|
|
104
|
+
setstr(out, "vault", spec.vault);
|
|
105
|
+
setstr(out, "tenant", spec.tenant);
|
|
106
|
+
setstr(out, "clientid", spec.clientid);
|
|
107
|
+
setstr(out, "clientsecret", spec.clientsecret);
|
|
108
|
+
setstr(out, "loginaddr", spec.loginaddr);
|
|
109
|
+
setstr(out, "imdsaddr", spec.imdsaddr);
|
|
110
|
+
setstr(out, "metadataaddr", spec.metadataaddr);
|
|
111
|
+
setstr(out, "apiversion", spec.apiversion);
|
|
112
|
+
setstr(out, "config", spec.config);
|
|
113
|
+
setstr(out, "environment", spec.environment);
|
|
114
|
+
setstr(out, "path", spec.path);
|
|
115
|
+
|
|
116
|
+
if (spec.kv.has_value()) {
|
|
117
|
+
plugin::set(out, "kv", plugin::vnum(spec.kv.value()));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (!spec.values.empty()) {
|
|
121
|
+
plugin::V values = plugin::vmap();
|
|
122
|
+
// A plugin map keeps insertion order, so the literal values arrive in
|
|
123
|
+
// the order they were written - which the spec compares.
|
|
124
|
+
for (const auto& entry : spec.values.pairs) {
|
|
125
|
+
plugin::set(values, entry.first, plugin::vstr(entry.second));
|
|
126
|
+
}
|
|
127
|
+
plugin::set(out, "values", values);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (spec.auth.has_value()) {
|
|
131
|
+
const AuthSpec& auth = spec.auth.value();
|
|
132
|
+
plugin::V m = plugin::vmap();
|
|
133
|
+
setstr(m, "method", auth.method);
|
|
134
|
+
setstr(m, "mount", auth.mount);
|
|
135
|
+
setstr(m, "role", auth.role);
|
|
136
|
+
setstr(m, "jwt", auth.jwt);
|
|
137
|
+
setstr(m, "jwtfile", auth.jwtfile);
|
|
138
|
+
setstr(m, "roleid", auth.roleid);
|
|
139
|
+
setstr(m, "secretid", auth.secretid);
|
|
140
|
+
plugin::set(out, "auth", m);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
ProviderSpec specof(const plugin::V& options) {
|
|
147
|
+
ProviderSpec spec;
|
|
148
|
+
|
|
149
|
+
spec.kind = strof(options, "kind");
|
|
150
|
+
spec.name = strof(options, "name");
|
|
151
|
+
spec.prefix = strof(options, "prefix");
|
|
152
|
+
spec.file = strof(options, "file");
|
|
153
|
+
spec.dir = strof(options, "dir");
|
|
154
|
+
spec.addr = strof(options, "addr");
|
|
155
|
+
spec.token = strof(options, "token");
|
|
156
|
+
spec.mount = strof(options, "mount");
|
|
157
|
+
spec.vaultnamespace = strof(options, "vaultnamespace");
|
|
158
|
+
spec.command = strof(options, "command");
|
|
159
|
+
spec.profile = strof(options, "profile");
|
|
160
|
+
spec.backend = strof(options, "backend");
|
|
161
|
+
spec.reason = strof(options, "reason");
|
|
162
|
+
spec.namespace_ = strof(options, "namespace");
|
|
163
|
+
spec.home = strof(options, "home");
|
|
164
|
+
spec.region = strof(options, "region");
|
|
165
|
+
spec.keyid = strof(options, "keyid");
|
|
166
|
+
spec.secret = strof(options, "secret");
|
|
167
|
+
spec.session = strof(options, "session");
|
|
168
|
+
spec.project = strof(options, "project");
|
|
169
|
+
spec.vault = strof(options, "vault");
|
|
170
|
+
spec.tenant = strof(options, "tenant");
|
|
171
|
+
spec.clientid = strof(options, "clientid");
|
|
172
|
+
spec.clientsecret = strof(options, "clientsecret");
|
|
173
|
+
spec.loginaddr = strof(options, "loginaddr");
|
|
174
|
+
spec.imdsaddr = strof(options, "imdsaddr");
|
|
175
|
+
spec.metadataaddr = strof(options, "metadataaddr");
|
|
176
|
+
spec.apiversion = strof(options, "apiversion");
|
|
177
|
+
spec.config = strof(options, "config");
|
|
178
|
+
spec.environment = strof(options, "environment");
|
|
179
|
+
spec.path = strof(options, "path");
|
|
180
|
+
|
|
181
|
+
plugin::V kv = plugin::get(options, "kv");
|
|
182
|
+
if (plugin::isnum(kv)) spec.kv = static_cast<int>(plugin::asnum(kv));
|
|
183
|
+
|
|
184
|
+
plugin::V values = plugin::get(options, "values");
|
|
185
|
+
if (plugin::ismap(values)) {
|
|
186
|
+
for (const std::string& key : plugin::keys(values)) {
|
|
187
|
+
spec.values.set(key, plugin::asstr(plugin::get(values, key)));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
plugin::V auth = plugin::get(options, "auth");
|
|
192
|
+
if (plugin::ismap(auth)) {
|
|
193
|
+
AuthSpec use;
|
|
194
|
+
use.method = strof(auth, "method");
|
|
195
|
+
use.mount = strof(auth, "mount");
|
|
196
|
+
use.role = strof(auth, "role");
|
|
197
|
+
use.jwt = strof(auth, "jwt");
|
|
198
|
+
use.jwtfile = strof(auth, "jwtfile");
|
|
199
|
+
use.roleid = strof(auth, "roleid");
|
|
200
|
+
use.secretid = strof(auth, "secretid");
|
|
201
|
+
spec.auth = use;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return spec;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// ------------------------------------------------------- the provider slots
|
|
208
|
+
|
|
209
|
+
namespace {
|
|
210
|
+
|
|
211
|
+
struct Slots {
|
|
212
|
+
std::map<double, std::shared_ptr<Provider>> held;
|
|
213
|
+
double next = 1;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
Slots& slots() {
|
|
217
|
+
// thread_local, NOT a process-global. A provider is parked by `define`
|
|
218
|
+
// and claimed by `Sekreto::declare` in the same synchronous call on the
|
|
219
|
+
// same thread, so per-thread is the same table for every purpose this
|
|
220
|
+
// has - and it removes the sharing entirely. As a process-global it was
|
|
221
|
+
// shared mutable state on the construction path: four threads building
|
|
222
|
+
// 500 chains each aborted every run with
|
|
223
|
+
//
|
|
224
|
+
// malloc(): unaligned tcache chunk detected
|
|
225
|
+
//
|
|
226
|
+
// three of them inside providerslot -> _Rb_tree_insert_and_rebalance.
|
|
227
|
+
// The port documents that it claims no thread safety across concurrent
|
|
228
|
+
// constructions, but heap corruption is not what a disclaimer buys you,
|
|
229
|
+
// and the pre-refactor port had no shared construction state at all.
|
|
230
|
+
static thread_local Slots one;
|
|
231
|
+
return one;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
} // namespace
|
|
235
|
+
|
|
236
|
+
double providerslot(const std::shared_ptr<Provider>& provider) {
|
|
237
|
+
Slots& one = slots();
|
|
238
|
+
double ticket = one.next;
|
|
239
|
+
one.next = ticket + 1;
|
|
240
|
+
one.held[ticket] = provider;
|
|
241
|
+
return ticket;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
std::shared_ptr<Provider> takeprovider(double ticket) {
|
|
245
|
+
Slots& one = slots();
|
|
246
|
+
auto at = one.held.find(ticket);
|
|
247
|
+
if (one.held.end() == at) return nullptr;
|
|
248
|
+
|
|
249
|
+
std::shared_ptr<Provider> provider = at->second;
|
|
250
|
+
one.held.erase(at);
|
|
251
|
+
return provider;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
double providermark() { return slots().next; }
|
|
255
|
+
|
|
256
|
+
void providerdiscard(double mark) {
|
|
257
|
+
Slots& one = slots();
|
|
258
|
+
for (auto at = one.held.begin(); one.held.end() != at;) {
|
|
259
|
+
at = (mark <= at->first) ? one.held.erase(at) : std::next(at);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
size_t providerslots() { return slots().held.size(); }
|
|
264
|
+
|
|
265
|
+
// --------------------------------------------------------------- the bridge
|
|
266
|
+
|
|
267
|
+
const char* const PROVIDER_EXPORT = "provider";
|
|
268
|
+
const char* const ERROR_CODE = "sekreto_error";
|
|
269
|
+
|
|
270
|
+
Definition providerplugin(const std::string& kind, Make make) {
|
|
271
|
+
auto def = std::make_shared<plugin::Definition>();
|
|
272
|
+
|
|
273
|
+
def->name = kind;
|
|
274
|
+
def->define = [make](plugin::Inst& inst) {
|
|
275
|
+
std::shared_ptr<Provider> provider;
|
|
276
|
+
|
|
277
|
+
try {
|
|
278
|
+
provider = make(specof(inst.options()));
|
|
279
|
+
} catch (const SekretoError& err) {
|
|
280
|
+
// The spec pins this message byte for byte, so it travels under a
|
|
281
|
+
// code the host will not rewrite and `Sekreto` takes the code back
|
|
282
|
+
// off on the far side.
|
|
283
|
+
plugin::fail(ERROR_CODE, err.what(),
|
|
284
|
+
plugin::details2("ref", plugin::vstr(inst.ref()), "cause",
|
|
285
|
+
plugin::vstr(err.what())));
|
|
286
|
+
} catch (const plugin::PluginError&) {
|
|
287
|
+
// Already the host's own currency: it names the instance itself.
|
|
288
|
+
throw;
|
|
289
|
+
} catch (const std::exception& err) {
|
|
290
|
+
// ANYTHING ELSE IS THE HOST'S TO REPORT, and it can only report what
|
|
291
|
+
// reaches it as a PluginError: `Host::run` catches nothing else, so
|
|
292
|
+
// an escaping std::exception would leave the instance neither
|
|
293
|
+
// `loaded` nor `failed`. `plugin_bare` is this port's spelling of
|
|
294
|
+
// "an error with no code", which the host wraps as
|
|
295
|
+
// `plugin_define_failed` naming the instance and the cause.
|
|
296
|
+
plugin::fail("plugin_bare", err.what());
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (nullptr == provider) {
|
|
300
|
+
const std::string why = "sekreto: " + inst.name() + " built no provider";
|
|
301
|
+
plugin::fail(ERROR_CODE, why,
|
|
302
|
+
plugin::details2("ref", plugin::vstr(inst.ref()), "cause",
|
|
303
|
+
plugin::vstr(why)));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
inst.exportvalue(PROVIDER_EXPORT, plugin::vnum(providerslot(provider)));
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
return def;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
} // namespace sekreto
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/src/Provider.hpp)
|
|
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
|
+
// What a provider is, what its declarative form looks like, and how a
|
|
5
|
+
// provider kind becomes a voxgig/plugin definition.
|
|
6
|
+
//
|
|
7
|
+
// A provider answers one question: "do you have this secret?" It returns
|
|
8
|
+
// the value, or nothing to mean "ask the next one". Nothing else about a
|
|
9
|
+
// provider is visible to the caller - which is the point: an app reads
|
|
10
|
+
// `api.token` and never learns whether it came from the environment, a
|
|
11
|
+
// .env file, HashiCorp Vault, AWS, GCP, Azure or a boru vault.
|
|
12
|
+
//
|
|
13
|
+
// A MISS is `std::nullopt` and a FAILURE is a thrown SekretoError. They
|
|
14
|
+
// are never interchangeable: a store that could not answer must not read
|
|
15
|
+
// as a store that does not hold the secret, or the chain falls quietly
|
|
16
|
+
// through to a weaker one.
|
|
17
|
+
//
|
|
18
|
+
// This is the bottom of the core: the error, the ordered map every spec
|
|
19
|
+
// and every signature is written in, the provider interface, the
|
|
20
|
+
// declarative form of a provider, and the bridge to voxgig/plugin. It
|
|
21
|
+
// includes nothing of sekreto's, which is what lets everything else
|
|
22
|
+
// include it.
|
|
23
|
+
//
|
|
24
|
+
// A port of typescript/src/provider/support.ts, which is canonical.
|
|
25
|
+
|
|
26
|
+
#ifndef SEKRETO_PROVIDER_HPP
|
|
27
|
+
#define SEKRETO_PROVIDER_HPP
|
|
28
|
+
|
|
29
|
+
#include <functional>
|
|
30
|
+
#include <memory>
|
|
31
|
+
#include <optional>
|
|
32
|
+
#include <stdexcept>
|
|
33
|
+
#include <string>
|
|
34
|
+
#include <utility>
|
|
35
|
+
#include <vector>
|
|
36
|
+
|
|
37
|
+
// voxgig/plugin: the catalog a definition is registered in, and the
|
|
38
|
+
// dynamic value an instance carries its options as. AGENTS.md rule 3's
|
|
39
|
+
// one Voxgig dependency, and rule 4 is why the core takes it.
|
|
40
|
+
#include "../plugin/catalog.hpp"
|
|
41
|
+
#include "../plugin/host.hpp"
|
|
42
|
+
#include "../plugin/value.hpp"
|
|
43
|
+
|
|
44
|
+
namespace sekreto {
|
|
45
|
+
|
|
46
|
+
/// Anything sekreto refuses to do: a bad name, a missing secret, a
|
|
47
|
+
/// provider that could not be reached.
|
|
48
|
+
///
|
|
49
|
+
/// The message is the whole contract - no code, no fields, no cause - and
|
|
50
|
+
/// the shared spec pins it byte for byte.
|
|
51
|
+
class SekretoError : public std::runtime_error {
|
|
52
|
+
public:
|
|
53
|
+
explicit SekretoError(const std::string& message) : std::runtime_error(message) {}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/// An insertion-ordered string map.
|
|
57
|
+
///
|
|
58
|
+
/// `std::map` orders by key and `std::unordered_map` by nothing at all;
|
|
59
|
+
/// the spec compares whole maps, and a signed AWS payload's field order is
|
|
60
|
+
/// part of what was signed. So this is a vector of pairs.
|
|
61
|
+
class Ordered {
|
|
62
|
+
public:
|
|
63
|
+
std::vector<std::pair<std::string, std::string>> pairs;
|
|
64
|
+
|
|
65
|
+
bool has(const std::string& key) const;
|
|
66
|
+
/// The value, or nothing. Absence is nothing; an empty string is a value.
|
|
67
|
+
std::optional<std::string> get(const std::string& key) const;
|
|
68
|
+
/// Insert, or overwrite in place so the original position is kept.
|
|
69
|
+
void set(const std::string& key, const std::string& value);
|
|
70
|
+
bool empty() const { return pairs.empty(); }
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
class Provider {
|
|
74
|
+
public:
|
|
75
|
+
virtual ~Provider() = default;
|
|
76
|
+
|
|
77
|
+
/// The value, or nothing if this provider does not have it. May throw
|
|
78
|
+
/// SekretoError when the store could not answer at all.
|
|
79
|
+
virtual std::optional<std::string> lookup(const std::string& name) = 0;
|
|
80
|
+
|
|
81
|
+
/// A short description, shown by `Sekreto::sources()`. It must lead with
|
|
82
|
+
/// the kind: everything before the first `:` is the default store name.
|
|
83
|
+
virtual std::string describe() const = 0;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/// Logging in to a vault instead of being handed a token. `method` is
|
|
87
|
+
/// `kubernetes` or `approle`; `mount` defaults to the method name.
|
|
88
|
+
struct AuthSpec {
|
|
89
|
+
std::string method;
|
|
90
|
+
std::string mount;
|
|
91
|
+
/// kubernetes: the Vault role to log in as.
|
|
92
|
+
std::string role;
|
|
93
|
+
/// kubernetes: the service-account JWT itself (tests).
|
|
94
|
+
std::string jwt;
|
|
95
|
+
/// kubernetes: where the JWT lives; the conventional pod path by default.
|
|
96
|
+
std::string jwtfile;
|
|
97
|
+
/// approle: the role and secret ids.
|
|
98
|
+
std::string roleid;
|
|
99
|
+
std::string secretid;
|
|
100
|
+
|
|
101
|
+
/// Printed without its credentials. A derived printer would put the
|
|
102
|
+
/// service-account JWT and the AppRole secret id into
|
|
103
|
+
/// `log("bad chain: " + spec)`, which is what someone writes when a
|
|
104
|
+
/// chain will not build.
|
|
105
|
+
std::string str() const;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/// The declarative form of a provider, as used in config and in the shared
|
|
109
|
+
/// spec. `kind` names a built-in or a plugin; everything else is that
|
|
110
|
+
/// kind's own, and a plugin reads it back off its instance's options.
|
|
111
|
+
///
|
|
112
|
+
/// String fields default to the empty string rather than to an optional:
|
|
113
|
+
/// "not configured" and "configured empty" mean the same thing everywhere
|
|
114
|
+
/// in this library.
|
|
115
|
+
struct ProviderSpec {
|
|
116
|
+
std::string kind;
|
|
117
|
+
/// The store name `Sekreto::getfrom` addresses. Defaults to `kind`.
|
|
118
|
+
std::string name;
|
|
119
|
+
std::string prefix;
|
|
120
|
+
/// dotenv: the file to read. secretspec: the declaration to read.
|
|
121
|
+
std::string file;
|
|
122
|
+
/// memory: literal values, keyed like environment variables.
|
|
123
|
+
Ordered values;
|
|
124
|
+
/// file: the directory of one-secret-per-file entries.
|
|
125
|
+
std::string dir;
|
|
126
|
+
/// hashicorp / boru (wire) / gcp / 1password / doppler / infisical: the base URL.
|
|
127
|
+
std::string addr;
|
|
128
|
+
/// hashicorp / boru (wire) / gcp / azure / 1password / doppler / infisical: the token.
|
|
129
|
+
std::string token;
|
|
130
|
+
/// hashicorp / boru (wire): the KV mount (default `secret`).
|
|
131
|
+
std::string mount;
|
|
132
|
+
/// hashicorp: KV engine version, 1 or 2 (default 2).
|
|
133
|
+
std::optional<int> kv;
|
|
134
|
+
/// hashicorp: Vault Enterprise namespace (X-Vault-Namespace).
|
|
135
|
+
std::string vaultnamespace;
|
|
136
|
+
/// hashicorp: log in for a token instead of being handed one.
|
|
137
|
+
std::optional<AuthSpec> auth;
|
|
138
|
+
/// boru / secretspec: the executable to run.
|
|
139
|
+
std::string command;
|
|
140
|
+
/// secretspec: the profile to read (`--profile`).
|
|
141
|
+
std::string profile;
|
|
142
|
+
/// secretspec: which of ITS backends to read from (`--provider`). Named
|
|
143
|
+
/// `backend` here because `provider` already means a sekreto provider.
|
|
144
|
+
std::string backend;
|
|
145
|
+
/// secretspec: the audit reason recorded for the read (`--reason`).
|
|
146
|
+
std::string reason;
|
|
147
|
+
/// boru: the namespace qualifying the alias.
|
|
148
|
+
std::string namespace_;
|
|
149
|
+
/// boru: the vault home, passed as BORU_HOME.
|
|
150
|
+
std::string home;
|
|
151
|
+
/// aws: region and credentials; the standard AWS_* variables fill the rest.
|
|
152
|
+
std::string region;
|
|
153
|
+
std::string keyid;
|
|
154
|
+
std::string secret;
|
|
155
|
+
std::string session;
|
|
156
|
+
/// gcp / doppler / infisical: the project, however that store names it.
|
|
157
|
+
std::string project;
|
|
158
|
+
/// azure: the Key Vault name or full URL. 1password: the vault name or id.
|
|
159
|
+
std::string vault;
|
|
160
|
+
/// azure: client-credential login. infisical: universal-auth login.
|
|
161
|
+
std::string tenant;
|
|
162
|
+
std::string clientid;
|
|
163
|
+
std::string clientsecret;
|
|
164
|
+
/// azure: where to log in / where IMDS answers. gcp: the metadata server.
|
|
165
|
+
std::string loginaddr;
|
|
166
|
+
std::string imdsaddr;
|
|
167
|
+
std::string metadataaddr;
|
|
168
|
+
/// azure: the Key Vault API version (default 7.4).
|
|
169
|
+
std::string apiversion;
|
|
170
|
+
/// doppler: the config slug (with `project`).
|
|
171
|
+
std::string config;
|
|
172
|
+
/// infisical: the environment slug and secret path.
|
|
173
|
+
std::string environment;
|
|
174
|
+
std::string path;
|
|
175
|
+
|
|
176
|
+
/// Printed without its credentials. See AuthSpec::str.
|
|
177
|
+
std::string str() const;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// --- providers as voxgig/plugin definitions --------------------------
|
|
181
|
+
|
|
182
|
+
/// A provider kind, as voxgig/plugin holds it. A definition is data with
|
|
183
|
+
/// functions in it, so it is a value a calling project passes in - never
|
|
184
|
+
/// a class to extend and never a registry to fill.
|
|
185
|
+
using Definition = plugin::DefinitionPtr;
|
|
186
|
+
|
|
187
|
+
/// How a kind builds its provider from the spec its instance was declared
|
|
188
|
+
/// with. A refusal is a thrown SekretoError.
|
|
189
|
+
using Make = std::function<std::shared_ptr<Provider>(const ProviderSpec&)>;
|
|
190
|
+
|
|
191
|
+
/// The export key under which a provider definition publishes the
|
|
192
|
+
/// provider it built. `Sekreto` reads `<ref>/provider` off the host.
|
|
193
|
+
extern const char* const PROVIDER_EXPORT;
|
|
194
|
+
|
|
195
|
+
/// The voxgig/plugin error code a SekretoError travels under when it is
|
|
196
|
+
/// thrown inside a definition's `define`.
|
|
197
|
+
///
|
|
198
|
+
/// plugin wraps a code-less error raised by a callback as
|
|
199
|
+
/// `plugin_define_failed`, and keeps an error that already carries a
|
|
200
|
+
/// code. A provider that refuses its own configuration - `kv: 3`, a
|
|
201
|
+
/// missing project - throws a SekretoError, and that message is pinned by
|
|
202
|
+
/// the spec byte for byte, so it must come back out of the host exactly
|
|
203
|
+
/// as it went in. `providerplugin` gives it this code on the way in;
|
|
204
|
+
/// `Sekreto` turns it back into a SekretoError on the way out.
|
|
205
|
+
extern const char* const ERROR_CODE;
|
|
206
|
+
|
|
207
|
+
/// A provider kind, as a voxgig/plugin definition.
|
|
208
|
+
///
|
|
209
|
+
/// This is the whole bridge between the two libraries. The definition's
|
|
210
|
+
/// `name` is the `kind` a ProviderSpec names; its `define` reads the spec
|
|
211
|
+
/// off the instance's options, builds the provider with `make`, and
|
|
212
|
+
/// exports it. Nothing runs at `activate`: a provider opens nothing until
|
|
213
|
+
/// its first lookup, so there is nothing to capture - a provider that does
|
|
214
|
+
/// hold a resource acquires it there and lets the instance scope unwind
|
|
215
|
+
/// it.
|
|
216
|
+
///
|
|
217
|
+
/// Every built-in and every plugin is made this way, so a custom provider
|
|
218
|
+
/// kind is one call:
|
|
219
|
+
///
|
|
220
|
+
/// Definition mystore = providerplugin(
|
|
221
|
+
/// "mystore", [](const ProviderSpec& spec) {
|
|
222
|
+
/// return std::make_shared<MyStore>(spec.addr);
|
|
223
|
+
/// });
|
|
224
|
+
Definition providerplugin(const std::string& kind, Make make);
|
|
225
|
+
|
|
226
|
+
/// A spec as the options map a plugin instance carries: one key per field
|
|
227
|
+
/// that is set, named as the field is - the spec's own key names in every
|
|
228
|
+
/// port.
|
|
229
|
+
plugin::V optionsof(const ProviderSpec& spec);
|
|
230
|
+
|
|
231
|
+
/// The spec a plugin instance's options describe: the inverse of
|
|
232
|
+
/// `optionsof`, and what a definition's `define` hands to its `make`.
|
|
233
|
+
ProviderSpec specof(const plugin::V& options);
|
|
234
|
+
|
|
235
|
+
// --- the provider slots ----------------------------------------------
|
|
236
|
+
|
|
237
|
+
// voxgig/plugin's value model carries numbers, strings, lists and maps -
|
|
238
|
+
// not pointers - so a definition's `define` cannot export the provider it
|
|
239
|
+
// built. It leaves the provider HERE and exports the ticket; `Sekreto`
|
|
240
|
+
// reads the ticket back off the host and takes the provider, which empties
|
|
241
|
+
// the slot again. The same shape zig's port uses, for the same reason.
|
|
242
|
+
//
|
|
243
|
+
// A slot is claimed exactly once, so nothing accumulates: between two
|
|
244
|
+
// constructions the table is empty, and `providerslots()` says so. Two
|
|
245
|
+
// threads building chains at once would share it, and this port - like the
|
|
246
|
+
// plugin port under it - does not claim to support that.
|
|
247
|
+
|
|
248
|
+
/// Park a freshly built provider and answer its ticket.
|
|
249
|
+
double providerslot(const std::shared_ptr<Provider>& provider);
|
|
250
|
+
/// Take the provider a ticket names, emptying the slot. Nothing, if the
|
|
251
|
+
/// ticket names no slot.
|
|
252
|
+
std::shared_ptr<Provider> takeprovider(double ticket);
|
|
253
|
+
/// The next ticket that will be issued: a mark to discard back to when a
|
|
254
|
+
/// declaration fails after its `define` has already built something.
|
|
255
|
+
double providermark();
|
|
256
|
+
/// Drop every slot filled since `mark`.
|
|
257
|
+
void providerdiscard(double mark);
|
|
258
|
+
/// How many slots are filled. Zero everywhere except inside a `define`.
|
|
259
|
+
size_t providerslots();
|
|
260
|
+
|
|
261
|
+
} // namespace sekreto
|
|
262
|
+
|
|
263
|
+
#endif
|