@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,47 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Proc.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
|
+
// Running another program, and the environment it inherits.
|
|
5
|
+
//
|
|
6
|
+
// Two of the ten kinds read a secret out of a CLI - boru and secretspec -
|
|
7
|
+
// and a child process is exactly the sort of thing the split exists to
|
|
8
|
+
// keep out of the core: `fork` and `execve` are one `#include` away in any
|
|
9
|
+
// C++ file, and a chain of built-ins must link neither.
|
|
10
|
+
//
|
|
11
|
+
// The argument list is passed as an array, never through a shell, and no
|
|
12
|
+
// secret is ever put on a command line where the process table publishes
|
|
13
|
+
// it.
|
|
14
|
+
|
|
15
|
+
#ifndef SEKRETO_PLUGINS_PROC_HPP
|
|
16
|
+
#define SEKRETO_PLUGINS_PROC_HPP
|
|
17
|
+
|
|
18
|
+
#include <string>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
#include "../sekreto/Providers.hpp"
|
|
22
|
+
#include "../sekreto/Sekreto.hpp"
|
|
23
|
+
|
|
24
|
+
namespace sekreto {
|
|
25
|
+
|
|
26
|
+
/// What a finished child process left behind.
|
|
27
|
+
struct Ran {
|
|
28
|
+
std::string out;
|
|
29
|
+
std::string why;
|
|
30
|
+
int status = 0;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/// Run a child to completion and collect both its streams. Raises a
|
|
34
|
+
/// SekretoError when the program cannot be run at all.
|
|
35
|
+
Ran runcmd(const std::vector<std::string>& argv,
|
|
36
|
+
const std::vector<std::string>& environment, const std::string& command);
|
|
37
|
+
|
|
38
|
+
/// The process environment as `KEY=value` entries.
|
|
39
|
+
std::vector<std::string> processenv();
|
|
40
|
+
|
|
41
|
+
/// Set one variable in such a list, in place where it is already there.
|
|
42
|
+
void setenvvar(std::vector<std::string>& environment, const std::string& key,
|
|
43
|
+
const std::string& value);
|
|
44
|
+
|
|
45
|
+
} // namespace sekreto
|
|
46
|
+
|
|
47
|
+
#endif
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Secretspec.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 "Secretspec.hpp"
|
|
5
|
+
|
|
6
|
+
#include "Proc.hpp"
|
|
7
|
+
#include "../sekreto/Providers.hpp"
|
|
8
|
+
#include "../sekreto/Sekreto.hpp"
|
|
9
|
+
|
|
10
|
+
namespace sekreto {
|
|
11
|
+
|
|
12
|
+
namespace {
|
|
13
|
+
|
|
14
|
+
// ------------------------------------------------------------- secretspec
|
|
15
|
+
|
|
16
|
+
/// SecretSpec (https://secretspec.dev).
|
|
17
|
+
///
|
|
18
|
+
/// A declaration - a `secretspec.toml` naming the secrets a project needs
|
|
19
|
+
/// - plus a chain of its own backends to satisfy them from. `backend`
|
|
20
|
+
/// selects one of those (`--provider`) and is called `backend` here only
|
|
21
|
+
/// because `provider` already means something else in this library.
|
|
22
|
+
///
|
|
23
|
+
/// A reason is required, not optional: SecretSpec records every read in an
|
|
24
|
+
/// audit log and refuses to read at all without one.
|
|
25
|
+
class SecretspecProvider : public Provider {
|
|
26
|
+
public:
|
|
27
|
+
SecretspecProvider(const std::string& command, const std::string& file,
|
|
28
|
+
const std::string& profile, const std::string& backend,
|
|
29
|
+
const std::string& reason, const std::string& prefix)
|
|
30
|
+
: command_(first(command, "secretspec")),
|
|
31
|
+
file_(file),
|
|
32
|
+
profile_(profile),
|
|
33
|
+
backend_(backend),
|
|
34
|
+
reason_(reason),
|
|
35
|
+
prefix_(prefix) {}
|
|
36
|
+
|
|
37
|
+
std::optional<std::string> lookup(const std::string& name) override {
|
|
38
|
+
std::string key = envkey(name, prefix_);
|
|
39
|
+
|
|
40
|
+
// `--file` comes BEFORE the subcommand; everything else after it.
|
|
41
|
+
std::vector<std::string> argv{command_};
|
|
42
|
+
if (!file_.empty()) {
|
|
43
|
+
argv.push_back("--file");
|
|
44
|
+
argv.push_back(file_);
|
|
45
|
+
}
|
|
46
|
+
argv.push_back("get");
|
|
47
|
+
argv.push_back(key);
|
|
48
|
+
if (!backend_.empty()) {
|
|
49
|
+
argv.push_back("--provider");
|
|
50
|
+
argv.push_back(backend_);
|
|
51
|
+
}
|
|
52
|
+
if (!profile_.empty()) {
|
|
53
|
+
argv.push_back("--profile");
|
|
54
|
+
argv.push_back(profile_);
|
|
55
|
+
}
|
|
56
|
+
argv.push_back("--reason");
|
|
57
|
+
argv.push_back(first(reason_, "sekreto"));
|
|
58
|
+
|
|
59
|
+
Ran ran = runcmd(argv, processenv(), command_);
|
|
60
|
+
|
|
61
|
+
if (0 == ran.status) {
|
|
62
|
+
// The value and one newline, and nothing else.
|
|
63
|
+
return dropnewline(ran.out);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (secretspecmiss(ran.why, key)) return std::nullopt;
|
|
67
|
+
|
|
68
|
+
throw SekretoError("sekreto: secretspec error: " +
|
|
69
|
+
(ran.why.empty() ? "exit " + std::to_string(ran.status) : ran.why));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
std::string describe() const override {
|
|
73
|
+
return backend_.empty() ? "secretspec" : "secretspec:" + backend_;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private:
|
|
77
|
+
std::string command_;
|
|
78
|
+
std::string file_;
|
|
79
|
+
std::string profile_;
|
|
80
|
+
std::string backend_;
|
|
81
|
+
std::string reason_;
|
|
82
|
+
std::string prefix_;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
} // namespace
|
|
86
|
+
|
|
87
|
+
// MATCHED ON THE WHOLE PHRASE, NOT ON "not found". SecretSpec also says
|
|
88
|
+
// `Provider backend 'keyring' not found`, which is a store that could not
|
|
89
|
+
// answer at all - and reading that as a miss is the worst failure this
|
|
90
|
+
// library has, because the chain then falls through to a weaker store
|
|
91
|
+
// without saying so. The key is required to appear, so the two cannot be
|
|
92
|
+
// confused.
|
|
93
|
+
bool secretspecmiss(const std::string& why, const std::string& key) {
|
|
94
|
+
return std::string::npos != why.find("Secret '" + key + "' not found");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Definition secretspec() {
|
|
98
|
+
return providerplugin("secretspec", [](const ProviderSpec& spec) -> std::shared_ptr<Provider> {
|
|
99
|
+
return std::make_shared<SecretspecProvider>(spec.command, spec.file, spec.profile,
|
|
100
|
+
spec.backend, spec.reason, spec.prefix);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
} // namespace sekreto
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Secretspec.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
|
+
// SecretSpec, read through its own CLI.
|
|
5
|
+
//
|
|
6
|
+
// A PLUGIN, not a built-in: this kind opens a socket, signs a request or
|
|
7
|
+
// spawns a process, so a chain that does not name it links none of that.
|
|
8
|
+
// The calling project includes this header and passes what it declares to
|
|
9
|
+
// the Sekreto constructor (docs/design/plugin-providers.md).
|
|
10
|
+
|
|
11
|
+
#ifndef SEKRETO_PLUGINS_SECRETSPEC_HPP
|
|
12
|
+
#define SEKRETO_PLUGINS_SECRETSPEC_HPP
|
|
13
|
+
|
|
14
|
+
#include "../sekreto/Provider.hpp"
|
|
15
|
+
|
|
16
|
+
namespace sekreto {
|
|
17
|
+
|
|
18
|
+
/// The `secretspec` provider kind, as a voxgig/plugin definition.
|
|
19
|
+
Definition secretspec();
|
|
20
|
+
|
|
21
|
+
/// Does this SecretSpec failure mean "no such secret"? Matched on the
|
|
22
|
+
/// WHOLE phrase, key included.
|
|
23
|
+
bool secretspecmiss(const std::string& why, const std::string& key);
|
|
24
|
+
|
|
25
|
+
} // namespace sekreto
|
|
26
|
+
|
|
27
|
+
#endif
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Sigv4.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 "Sigv4.hpp"
|
|
5
|
+
|
|
6
|
+
#include <algorithm>
|
|
7
|
+
#include <cstdio>
|
|
8
|
+
|
|
9
|
+
#include "Crypto.hpp"
|
|
10
|
+
#include "Httpjson.hpp"
|
|
11
|
+
|
|
12
|
+
namespace sekreto {
|
|
13
|
+
|
|
14
|
+
std::string sha256hex(const std::string& text) {
|
|
15
|
+
return hex(sha256(tobytes(text)));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
namespace {
|
|
19
|
+
|
|
20
|
+
Bytes hmactext(const Bytes& key, const std::string& text) {
|
|
21
|
+
return hmacsha256(key, tobytes(text));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
} // namespace
|
|
25
|
+
|
|
26
|
+
std::string canonicalquery(const std::string& query) {
|
|
27
|
+
if (query.empty()) return "";
|
|
28
|
+
|
|
29
|
+
std::vector<std::pair<std::string, std::string>> pairs;
|
|
30
|
+
size_t start = 0;
|
|
31
|
+
|
|
32
|
+
while (true) {
|
|
33
|
+
size_t at = query.find('&', start);
|
|
34
|
+
std::string pair =
|
|
35
|
+
(std::string::npos == at) ? query.substr(start) : query.substr(start, at - start);
|
|
36
|
+
|
|
37
|
+
// Split on the FIRST `=`; a pair with none has an empty value and is
|
|
38
|
+
// still emitted with its `=`.
|
|
39
|
+
size_t eq = pair.find('=');
|
|
40
|
+
std::string key = (std::string::npos == eq) ? pair : pair.substr(0, eq);
|
|
41
|
+
std::string value = (std::string::npos == eq) ? "" : pair.substr(eq + 1);
|
|
42
|
+
|
|
43
|
+
pairs.emplace_back(uriescape(uridecode(key)), uriescape(uridecode(value)));
|
|
44
|
+
|
|
45
|
+
if (std::string::npos == at) break;
|
|
46
|
+
start = at + 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
std::stable_sort(pairs.begin(), pairs.end(),
|
|
50
|
+
[](const std::pair<std::string, std::string>& left,
|
|
51
|
+
const std::pair<std::string, std::string>& right) {
|
|
52
|
+
if (left.first != right.first) return left.first < right.first;
|
|
53
|
+
return left.second < right.second;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
std::string out;
|
|
57
|
+
for (size_t index = 0; index < pairs.size(); index++) {
|
|
58
|
+
if (0 < index) out += "&";
|
|
59
|
+
out += pairs[index].first + "=" + pairs[index].second;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
namespace {
|
|
66
|
+
|
|
67
|
+
/// A URL, split by hand.
|
|
68
|
+
///
|
|
69
|
+
/// Not a platform URL type: what SigV4 signs must match what checkaddr saw
|
|
70
|
+
/// and what the client will dial, and a URL parser is free to normalise
|
|
71
|
+
/// any of the three differently. `host` follows the WHATWG rule the AWS
|
|
72
|
+
/// SDKs use - lowercased, userinfo stripped, the port present only when it
|
|
73
|
+
/// is not the scheme's default.
|
|
74
|
+
struct Urlparts {
|
|
75
|
+
std::string scheme;
|
|
76
|
+
std::string host;
|
|
77
|
+
std::string path;
|
|
78
|
+
std::string query;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Urlparts urlparts(const std::string& url) {
|
|
82
|
+
Urlparts out;
|
|
83
|
+
|
|
84
|
+
std::string rest = url;
|
|
85
|
+
size_t mark = url.find("://");
|
|
86
|
+
|
|
87
|
+
if (std::string::npos != mark) {
|
|
88
|
+
out.scheme = asciilower(url.substr(0, mark));
|
|
89
|
+
rest = url.substr(mark + 3);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
std::string authority = rest;
|
|
93
|
+
std::string tail;
|
|
94
|
+
|
|
95
|
+
size_t stop = rest.find_first_of("/?#");
|
|
96
|
+
if (std::string::npos != stop) {
|
|
97
|
+
authority = rest.substr(0, stop);
|
|
98
|
+
tail = rest.substr(stop);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Userinfo is not part of the host, and never part of a signature.
|
|
102
|
+
size_t at = authority.rfind('@');
|
|
103
|
+
if (std::string::npos != at) authority = authority.substr(at + 1);
|
|
104
|
+
|
|
105
|
+
std::string hostname = authority;
|
|
106
|
+
std::string port;
|
|
107
|
+
|
|
108
|
+
if (!authority.empty() && '[' == authority[0]) {
|
|
109
|
+
size_t close = authority.find(']');
|
|
110
|
+
if (std::string::npos != close) {
|
|
111
|
+
hostname = authority.substr(0, close + 1);
|
|
112
|
+
std::string after = authority.substr(close + 1);
|
|
113
|
+
if (!after.empty() && ':' == after[0]) port = after.substr(1);
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
size_t colon = authority.rfind(':');
|
|
117
|
+
if (std::string::npos != colon) {
|
|
118
|
+
hostname = authority.substr(0, colon);
|
|
119
|
+
port = authority.substr(colon + 1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
hostname = asciilower(hostname);
|
|
124
|
+
|
|
125
|
+
// A default port is implicit: `Host: example.com:443` is not what an AWS
|
|
126
|
+
// SDK signs, and a signature over the wrong host is refused.
|
|
127
|
+
if (("https" == out.scheme && "443" == port) || ("http" == out.scheme && "80" == port)) {
|
|
128
|
+
port = "";
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
out.host = port.empty() ? hostname : hostname + ":" + port;
|
|
132
|
+
out.path = "/";
|
|
133
|
+
|
|
134
|
+
if (!tail.empty()) {
|
|
135
|
+
std::string pathpart = tail;
|
|
136
|
+
|
|
137
|
+
size_t hash = pathpart.find('#');
|
|
138
|
+
if (std::string::npos != hash) pathpart = pathpart.substr(0, hash);
|
|
139
|
+
|
|
140
|
+
size_t question = pathpart.find('?');
|
|
141
|
+
if (std::string::npos != question) {
|
|
142
|
+
out.query = pathpart.substr(question + 1);
|
|
143
|
+
pathpart = pathpart.substr(0, question);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (!pathpart.empty()) out.path = pathpart;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/// Trim, and collapse every internal run of spaces and tabs to one space.
|
|
153
|
+
///
|
|
154
|
+
/// AWS folds sequential whitespace before signing, so a header value like
|
|
155
|
+
/// `a b\tc` must sign as `a b c` or the service refuses the request.
|
|
156
|
+
std::string foldspace(const std::string& text) {
|
|
157
|
+
std::string out;
|
|
158
|
+
bool pending = false;
|
|
159
|
+
bool started = false;
|
|
160
|
+
|
|
161
|
+
for (char ch : text) {
|
|
162
|
+
if (' ' == ch || '\t' == ch || '\n' == ch || '\r' == ch) {
|
|
163
|
+
if (started) pending = true;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (pending) {
|
|
167
|
+
out.push_back(' ');
|
|
168
|
+
pending = false;
|
|
169
|
+
}
|
|
170
|
+
out.push_back(ch);
|
|
171
|
+
started = true;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return out;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
} // namespace
|
|
178
|
+
|
|
179
|
+
Ordered sigv4(const Signing& input) {
|
|
180
|
+
Urlparts parts = urlparts(input.url);
|
|
181
|
+
|
|
182
|
+
std::string date = input.datetime.substr(0, std::min<size_t>(8, input.datetime.size()));
|
|
183
|
+
|
|
184
|
+
// Every header that will be signed: the caller's extras, plus host and
|
|
185
|
+
// x-amz-date (and the session token when present). The built-in three go
|
|
186
|
+
// in AFTER the caller's, so they win over anything passed in.
|
|
187
|
+
Ordered headers;
|
|
188
|
+
|
|
189
|
+
for (const auto& entry : input.headers.pairs) {
|
|
190
|
+
headers.set(asciilower(entry.first), foldspace(entry.second));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
headers.set("host", parts.host);
|
|
194
|
+
headers.set("x-amz-date", input.datetime);
|
|
195
|
+
if (!input.session.empty()) headers.set("x-amz-security-token", input.session);
|
|
196
|
+
|
|
197
|
+
std::vector<std::pair<std::string, std::string>> sorted = headers.pairs;
|
|
198
|
+
std::stable_sort(sorted.begin(), sorted.end(),
|
|
199
|
+
[](const std::pair<std::string, std::string>& left,
|
|
200
|
+
const std::pair<std::string, std::string>& right) {
|
|
201
|
+
return left.first < right.first;
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
std::string canonicalheaders;
|
|
205
|
+
std::string signedheaders;
|
|
206
|
+
|
|
207
|
+
for (size_t index = 0; index < sorted.size(); index++) {
|
|
208
|
+
canonicalheaders += sorted[index].first + ":" + sorted[index].second + "\n";
|
|
209
|
+
if (0 < index) signedheaders += ";";
|
|
210
|
+
signedheaders += sorted[index].first;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Six lines. `canonicalheaders` already ends with a newline, which is
|
|
214
|
+
// what produces the blank line the algorithm calls for.
|
|
215
|
+
std::string canonicalrequest = asciiupper(input.method) + "\n" + parts.path + "\n" +
|
|
216
|
+
canonicalquery(parts.query) + "\n" + canonicalheaders + "\n" +
|
|
217
|
+
signedheaders + "\n" + sha256hex(input.body);
|
|
218
|
+
|
|
219
|
+
std::string scope = date + "/" + input.region + "/" + input.service + "/aws4_request";
|
|
220
|
+
|
|
221
|
+
std::string stringtosign = "AWS4-HMAC-SHA256\n" + input.datetime + "\n" + scope + "\n" +
|
|
222
|
+
sha256hex(canonicalrequest);
|
|
223
|
+
|
|
224
|
+
Bytes kdate = hmactext(tobytes("AWS4" + input.secret), date);
|
|
225
|
+
Bytes kregion = hmactext(kdate, input.region);
|
|
226
|
+
Bytes kservice = hmactext(kregion, input.service);
|
|
227
|
+
Bytes ksigning = hmactext(kservice, "aws4_request");
|
|
228
|
+
std::string signature = hex(hmactext(ksigning, stringtosign));
|
|
229
|
+
|
|
230
|
+
Ordered out;
|
|
231
|
+
|
|
232
|
+
out.set("authorization", "AWS4-HMAC-SHA256 Credential=" + input.keyid + "/" + scope +
|
|
233
|
+
", SignedHeaders=" + signedheaders +
|
|
234
|
+
", Signature=" + signature);
|
|
235
|
+
out.set("x-amz-date", input.datetime);
|
|
236
|
+
|
|
237
|
+
if (!input.session.empty()) out.set("x-amz-security-token", input.session);
|
|
238
|
+
|
|
239
|
+
return out;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
} // namespace sekreto
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/plugins/Sigv4.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
|
+
// AWS Signature Version 4, hand-rolled.
|
|
5
|
+
//
|
|
6
|
+
// The AWS providers need exactly one thing from the AWS SDK - request
|
|
7
|
+
// signing - and taking the SDK for it would break the no-dependency rule
|
|
8
|
+
// that keeps the ports honest. SigV4 is a stable, published algorithm
|
|
9
|
+
// built from HMAC-SHA256, which Crypto.cpp supplies.
|
|
10
|
+
//
|
|
11
|
+
// `sigv4` is pure: the caller passes the timestamp, so the same input
|
|
12
|
+
// yields the same signature everywhere. That is what lets the shared spec
|
|
13
|
+
// carry known-answer cases all ports reproduce bit for bit, and lets the
|
|
14
|
+
// integration mock recompute the signature server-side. The clock is never
|
|
15
|
+
// sampled here.
|
|
16
|
+
//
|
|
17
|
+
// A port of typescript/plugins/sigv4.ts, which is canonical.
|
|
18
|
+
|
|
19
|
+
#ifndef SEKRETO_PLUGINS_SIGV4_HPP
|
|
20
|
+
#define SEKRETO_PLUGINS_SIGV4_HPP
|
|
21
|
+
|
|
22
|
+
#include <string>
|
|
23
|
+
|
|
24
|
+
#include "Httpjson.hpp"
|
|
25
|
+
#include "../sekreto/Sekreto.hpp"
|
|
26
|
+
|
|
27
|
+
namespace sekreto {
|
|
28
|
+
|
|
29
|
+
/// One request to sign - the same declarative shape the shared spec uses.
|
|
30
|
+
/// `datetime` is `YYYYMMDDTHHMMSSZ`, and it is the caller's.
|
|
31
|
+
struct Signing {
|
|
32
|
+
std::string method;
|
|
33
|
+
std::string url;
|
|
34
|
+
std::string service;
|
|
35
|
+
std::string region;
|
|
36
|
+
std::string keyid;
|
|
37
|
+
std::string secret;
|
|
38
|
+
std::string datetime;
|
|
39
|
+
Ordered headers;
|
|
40
|
+
std::string body;
|
|
41
|
+
std::string session;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/// SHA-256 of some text, as lowercase hex.
|
|
45
|
+
std::string sha256hex(const std::string& text);
|
|
46
|
+
|
|
47
|
+
/// The canonical query string: each pair decoded then RFC 3986-escaped,
|
|
48
|
+
/// sorted by escaped key then escaped value.
|
|
49
|
+
std::string canonicalquery(const std::string& query);
|
|
50
|
+
|
|
51
|
+
/// Sign one request. Returns the headers to attach: authorization,
|
|
52
|
+
/// x-amz-date, and x-amz-security-token when a session token was given, in
|
|
53
|
+
/// that order - the spec compares the result as a JSON object.
|
|
54
|
+
Ordered sigv4(const Signing& input);
|
|
55
|
+
|
|
56
|
+
} // namespace sekreto
|
|
57
|
+
|
|
58
|
+
#endif
|