@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,476 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/src/Json.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 "Json.hpp"
|
|
5
|
+
|
|
6
|
+
#include <cmath>
|
|
7
|
+
#include <cstdio>
|
|
8
|
+
#include <cstdlib>
|
|
9
|
+
|
|
10
|
+
namespace sekreto {
|
|
11
|
+
|
|
12
|
+
namespace {
|
|
13
|
+
|
|
14
|
+
// A response body arrives before anything has been trusted, so `[[[[...`
|
|
15
|
+
// must not walk the stack off the end.
|
|
16
|
+
const int MAXDEPTH = 128;
|
|
17
|
+
|
|
18
|
+
struct Reader {
|
|
19
|
+
const std::string& text;
|
|
20
|
+
size_t pos = 0;
|
|
21
|
+
int depth = 0;
|
|
22
|
+
bool ok = true;
|
|
23
|
+
|
|
24
|
+
explicit Reader(const std::string& src) : text(src) {}
|
|
25
|
+
|
|
26
|
+
void skipws() {
|
|
27
|
+
while (pos < text.size()) {
|
|
28
|
+
char ch = text[pos];
|
|
29
|
+
if (' ' == ch || '\t' == ch || '\n' == ch || '\r' == ch) {
|
|
30
|
+
pos++;
|
|
31
|
+
} else {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
bool word(const std::string& want) {
|
|
38
|
+
// Matched WHOLE, never by first letter: `nul` and `truthy` are not
|
|
39
|
+
// JSON, and a first-letter dispatch would accept both.
|
|
40
|
+
if (text.compare(pos, want.size(), want)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
pos += want.size();
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Json value() {
|
|
48
|
+
skipws();
|
|
49
|
+
|
|
50
|
+
if (pos >= text.size() || MAXDEPTH < depth) {
|
|
51
|
+
ok = false;
|
|
52
|
+
return Json();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
char ch = text[pos];
|
|
56
|
+
|
|
57
|
+
if ('{' == ch) return object();
|
|
58
|
+
if ('[' == ch) return array();
|
|
59
|
+
if ('"' == ch) {
|
|
60
|
+
std::string out;
|
|
61
|
+
if (!string(out)) return Json();
|
|
62
|
+
return Json::str(out);
|
|
63
|
+
}
|
|
64
|
+
if ('t' == ch) {
|
|
65
|
+
if (word("true")) return Json::boolean(true);
|
|
66
|
+
ok = false;
|
|
67
|
+
return Json();
|
|
68
|
+
}
|
|
69
|
+
if ('f' == ch) {
|
|
70
|
+
if (word("false")) return Json::boolean(false);
|
|
71
|
+
ok = false;
|
|
72
|
+
return Json();
|
|
73
|
+
}
|
|
74
|
+
if ('n' == ch) {
|
|
75
|
+
if (word("null")) return Json::null();
|
|
76
|
+
ok = false;
|
|
77
|
+
return Json();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return number();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Json object() {
|
|
84
|
+
pos++;
|
|
85
|
+
depth++;
|
|
86
|
+
|
|
87
|
+
std::vector<std::pair<std::string, Json>> entries;
|
|
88
|
+
|
|
89
|
+
skipws();
|
|
90
|
+
if (pos < text.size() && '}' == text[pos]) {
|
|
91
|
+
pos++;
|
|
92
|
+
depth--;
|
|
93
|
+
return Json::obj(entries);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
while (ok) {
|
|
97
|
+
skipws();
|
|
98
|
+
|
|
99
|
+
std::string key;
|
|
100
|
+
if (!string(key)) return Json();
|
|
101
|
+
|
|
102
|
+
skipws();
|
|
103
|
+
if (pos >= text.size() || ':' != text[pos]) {
|
|
104
|
+
ok = false;
|
|
105
|
+
return Json();
|
|
106
|
+
}
|
|
107
|
+
pos++;
|
|
108
|
+
|
|
109
|
+
Json val = value();
|
|
110
|
+
if (!ok) return Json();
|
|
111
|
+
|
|
112
|
+
entries.emplace_back(key, val);
|
|
113
|
+
|
|
114
|
+
skipws();
|
|
115
|
+
if (pos >= text.size()) {
|
|
116
|
+
ok = false;
|
|
117
|
+
return Json();
|
|
118
|
+
}
|
|
119
|
+
if (',' == text[pos]) {
|
|
120
|
+
pos++;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if ('}' == text[pos]) {
|
|
124
|
+
pos++;
|
|
125
|
+
depth--;
|
|
126
|
+
return Json::obj(entries);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
ok = false;
|
|
130
|
+
return Json();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return Json();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
Json array() {
|
|
137
|
+
pos++;
|
|
138
|
+
depth++;
|
|
139
|
+
|
|
140
|
+
std::vector<Json> entries;
|
|
141
|
+
|
|
142
|
+
skipws();
|
|
143
|
+
if (pos < text.size() && ']' == text[pos]) {
|
|
144
|
+
pos++;
|
|
145
|
+
depth--;
|
|
146
|
+
return Json::arr(entries);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
while (ok) {
|
|
150
|
+
Json val = value();
|
|
151
|
+
if (!ok) return Json();
|
|
152
|
+
|
|
153
|
+
entries.push_back(val);
|
|
154
|
+
|
|
155
|
+
skipws();
|
|
156
|
+
if (pos >= text.size()) {
|
|
157
|
+
ok = false;
|
|
158
|
+
return Json();
|
|
159
|
+
}
|
|
160
|
+
if (',' == text[pos]) {
|
|
161
|
+
pos++;
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
if (']' == text[pos]) {
|
|
165
|
+
pos++;
|
|
166
|
+
depth--;
|
|
167
|
+
return Json::arr(entries);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
ok = false;
|
|
171
|
+
return Json();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return Json();
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// A UTF-16 code unit, appended as UTF-8. No surrogate-pair
|
|
178
|
+
// recombination, in this port or in any other: a lone surrogate is
|
|
179
|
+
// encoded as it stands rather than guessed at.
|
|
180
|
+
void utf8(unsigned int code, std::string& out) {
|
|
181
|
+
if (0x80 > code) {
|
|
182
|
+
out.push_back(static_cast<char>(code));
|
|
183
|
+
} else if (0x800 > code) {
|
|
184
|
+
out.push_back(static_cast<char>(0xc0 | (code >> 6)));
|
|
185
|
+
out.push_back(static_cast<char>(0x80 | (code & 0x3f)));
|
|
186
|
+
} else {
|
|
187
|
+
out.push_back(static_cast<char>(0xe0 | (code >> 12)));
|
|
188
|
+
out.push_back(static_cast<char>(0x80 | ((code >> 6) & 0x3f)));
|
|
189
|
+
out.push_back(static_cast<char>(0x80 | (code & 0x3f)));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
bool string(std::string& out) {
|
|
194
|
+
if (pos >= text.size() || '"' != text[pos]) {
|
|
195
|
+
ok = false;
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
pos++;
|
|
199
|
+
|
|
200
|
+
out.clear();
|
|
201
|
+
|
|
202
|
+
while (pos < text.size()) {
|
|
203
|
+
char ch = text[pos];
|
|
204
|
+
|
|
205
|
+
if ('"' == ch) {
|
|
206
|
+
pos++;
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if ('\\' != ch) {
|
|
211
|
+
out.push_back(ch);
|
|
212
|
+
pos++;
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
pos++;
|
|
217
|
+
if (pos >= text.size()) break;
|
|
218
|
+
|
|
219
|
+
char esc = text[pos];
|
|
220
|
+
pos++;
|
|
221
|
+
|
|
222
|
+
switch (esc) {
|
|
223
|
+
case '"': out.push_back('"'); break;
|
|
224
|
+
case '\\': out.push_back('\\'); break;
|
|
225
|
+
case '/': out.push_back('/'); break;
|
|
226
|
+
case 'b': out.push_back('\b'); break;
|
|
227
|
+
case 'f': out.push_back('\f'); break;
|
|
228
|
+
case 'n': out.push_back('\n'); break;
|
|
229
|
+
case 'r': out.push_back('\r'); break;
|
|
230
|
+
case 't': out.push_back('\t'); break;
|
|
231
|
+
case 'u': {
|
|
232
|
+
if (pos + 4 > text.size()) {
|
|
233
|
+
ok = false;
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
unsigned int code = 0;
|
|
237
|
+
for (int step = 0; step < 4; step++) {
|
|
238
|
+
char digit = text[pos + static_cast<size_t>(step)];
|
|
239
|
+
unsigned int val = 0;
|
|
240
|
+
if ('0' <= digit && '9' >= digit) {
|
|
241
|
+
val = static_cast<unsigned int>(digit - '0');
|
|
242
|
+
} else if ('a' <= digit && 'f' >= digit) {
|
|
243
|
+
val = static_cast<unsigned int>(digit - 'a' + 10);
|
|
244
|
+
} else if ('A' <= digit && 'F' >= digit) {
|
|
245
|
+
val = static_cast<unsigned int>(digit - 'A' + 10);
|
|
246
|
+
} else {
|
|
247
|
+
ok = false;
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
code = (code << 4) | val;
|
|
251
|
+
}
|
|
252
|
+
pos += 4;
|
|
253
|
+
utf8(code, out);
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
default:
|
|
257
|
+
ok = false;
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
ok = false;
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
Json number() {
|
|
267
|
+
size_t start = pos;
|
|
268
|
+
|
|
269
|
+
if (pos < text.size() && ('-' == text[pos] || '+' == text[pos])) pos++;
|
|
270
|
+
|
|
271
|
+
while (pos < text.size()) {
|
|
272
|
+
char ch = text[pos];
|
|
273
|
+
bool part = ('0' <= ch && '9' >= ch) || '.' == ch || 'e' == ch || 'E' == ch ||
|
|
274
|
+
'-' == ch || '+' == ch;
|
|
275
|
+
if (!part) break;
|
|
276
|
+
pos++;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (start == pos) {
|
|
280
|
+
ok = false;
|
|
281
|
+
return Json();
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
std::string span = text.substr(start, pos - start);
|
|
285
|
+
|
|
286
|
+
char* stop = nullptr;
|
|
287
|
+
double val = std::strtod(span.c_str(), &stop);
|
|
288
|
+
|
|
289
|
+
// A span the float parser did not consume whole is not a number, and
|
|
290
|
+
// 1e999 parses to infinity - which JSON has no literal for and which
|
|
291
|
+
// would blow up a token-expiry computation later.
|
|
292
|
+
if (nullptr == stop || '\0' != *stop || !std::isfinite(val)) {
|
|
293
|
+
ok = false;
|
|
294
|
+
return Json();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return Json::num(val);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
} // namespace
|
|
302
|
+
|
|
303
|
+
Json Json::null() { return Json(); }
|
|
304
|
+
|
|
305
|
+
Json Json::boolean(bool val) {
|
|
306
|
+
Json out;
|
|
307
|
+
out.type = Type::Bool;
|
|
308
|
+
out.boolval = val;
|
|
309
|
+
return out;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
Json Json::num(double val) {
|
|
313
|
+
Json out;
|
|
314
|
+
out.type = Type::Num;
|
|
315
|
+
out.numval = val;
|
|
316
|
+
return out;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
Json Json::str(const std::string& val) {
|
|
320
|
+
Json out;
|
|
321
|
+
out.type = Type::Str;
|
|
322
|
+
out.strval = val;
|
|
323
|
+
return out;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
Json Json::arr(std::vector<Json> entries) {
|
|
327
|
+
Json out;
|
|
328
|
+
out.type = Type::Arr;
|
|
329
|
+
out.arrval = std::move(entries);
|
|
330
|
+
return out;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
Json Json::obj(std::vector<std::pair<std::string, Json>> entries) {
|
|
334
|
+
Json out;
|
|
335
|
+
out.type = Type::Obj;
|
|
336
|
+
out.objval = std::move(entries);
|
|
337
|
+
return out;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
Json Json::get(const std::string& key) const {
|
|
341
|
+
if (Type::Obj != type) return Json();
|
|
342
|
+
|
|
343
|
+
for (const auto& entry : objval) {
|
|
344
|
+
if (key == entry.first) return entry.second;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
return Json();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
bool Json::asstr(std::string& out) const {
|
|
351
|
+
if (Type::Str != type) return false;
|
|
352
|
+
out = strval;
|
|
353
|
+
return true;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
bool Json::asnum(double& out) const {
|
|
357
|
+
if (Type::Num != type) return false;
|
|
358
|
+
out = numval;
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
bool Json::text(std::string& out) const {
|
|
363
|
+
switch (type) {
|
|
364
|
+
case Type::Str:
|
|
365
|
+
out = strval;
|
|
366
|
+
return true;
|
|
367
|
+
case Type::Num:
|
|
368
|
+
out = numstr(numval);
|
|
369
|
+
return true;
|
|
370
|
+
case Type::Bool:
|
|
371
|
+
out = boolval ? "true" : "false";
|
|
372
|
+
return true;
|
|
373
|
+
default:
|
|
374
|
+
// Null, and both containers: nothing printable, so a null field
|
|
375
|
+
// reads as a miss.
|
|
376
|
+
return false;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
bool Json::parse(const std::string& text, Json& out) {
|
|
381
|
+
if (text.empty()) return false;
|
|
382
|
+
|
|
383
|
+
Reader reader(text);
|
|
384
|
+
Json val = reader.value();
|
|
385
|
+
|
|
386
|
+
if (!reader.ok) return false;
|
|
387
|
+
|
|
388
|
+
reader.skipws();
|
|
389
|
+
|
|
390
|
+
// Trailing content after the top-level value is not one JSON document.
|
|
391
|
+
if (reader.pos != text.size()) return false;
|
|
392
|
+
|
|
393
|
+
out = val;
|
|
394
|
+
return true;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
std::string Json::quote(const std::string& text) {
|
|
398
|
+
std::string out = "\"";
|
|
399
|
+
|
|
400
|
+
for (unsigned char ch : text) {
|
|
401
|
+
switch (ch) {
|
|
402
|
+
case '"': out += "\\\""; break;
|
|
403
|
+
case '\\': out += "\\\\"; break;
|
|
404
|
+
case '\n': out += "\\n"; break;
|
|
405
|
+
case '\r': out += "\\r"; break;
|
|
406
|
+
case '\t': out += "\\t"; break;
|
|
407
|
+
default:
|
|
408
|
+
if (0x20 > ch) {
|
|
409
|
+
char buf[8];
|
|
410
|
+
std::snprintf(buf, sizeof(buf), "\\u%04x", ch);
|
|
411
|
+
out += buf;
|
|
412
|
+
} else {
|
|
413
|
+
// `/` is accepted on input and never escaped on output, and
|
|
414
|
+
// non-ASCII passes through as the UTF-8 it already is.
|
|
415
|
+
out.push_back(static_cast<char>(ch));
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
out += "\"";
|
|
421
|
+
return out;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
std::string Json::numstr(double val) {
|
|
425
|
+
if (!std::isfinite(val)) return "null";
|
|
426
|
+
|
|
427
|
+
if (val == std::floor(val) && 9007199254740992.0 > std::fabs(val)) {
|
|
428
|
+
char buf[32];
|
|
429
|
+
std::snprintf(buf, sizeof(buf), "%.0f", val);
|
|
430
|
+
return buf;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
char buf[40];
|
|
434
|
+
std::snprintf(buf, sizeof(buf), "%.17g", val);
|
|
435
|
+
|
|
436
|
+
// The shortest rendering that round-trips, which is what every other
|
|
437
|
+
// port's default float printer gives.
|
|
438
|
+
for (int digits = 1; digits < 17; digits++) {
|
|
439
|
+
char probe[40];
|
|
440
|
+
std::snprintf(probe, sizeof(probe), "%.*g", digits, val);
|
|
441
|
+
if (std::strtod(probe, nullptr) == val) return probe;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return buf;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
std::string Json::stringify(const Json& val) {
|
|
448
|
+
switch (val.type) {
|
|
449
|
+
case Type::Null: return "null";
|
|
450
|
+
case Type::Bool: return val.boolval ? "true" : "false";
|
|
451
|
+
case Type::Num: return numstr(val.numval);
|
|
452
|
+
case Type::Str: return quote(val.strval);
|
|
453
|
+
case Type::Arr: {
|
|
454
|
+
std::string out = "[";
|
|
455
|
+
for (size_t index = 0; index < val.arrval.size(); index++) {
|
|
456
|
+
if (0 < index) out += ",";
|
|
457
|
+
out += stringify(val.arrval[index]);
|
|
458
|
+
}
|
|
459
|
+
return out + "]";
|
|
460
|
+
}
|
|
461
|
+
case Type::Obj: {
|
|
462
|
+
std::string out = "{";
|
|
463
|
+
for (size_t index = 0; index < val.objval.size(); index++) {
|
|
464
|
+
if (0 < index) out += ",";
|
|
465
|
+
out += quote(val.objval[index].first);
|
|
466
|
+
out += ":";
|
|
467
|
+
out += stringify(val.objval[index].second);
|
|
468
|
+
}
|
|
469
|
+
return out + "}";
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return "null";
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
} // namespace sekreto
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260908-1556-0 (cpp/src/Json.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
|
+
// The JSON this port owns.
|
|
5
|
+
//
|
|
6
|
+
// C++ has no JSON in its standard library, and nlohmann/json, RapidJSON
|
|
7
|
+
// and Boost.PropertyTree are all packages - so the value model, the parser
|
|
8
|
+
// and the writer are here. What the providers need of JSON is small: read
|
|
9
|
+
// a field out of a vault's answer, and build a request body.
|
|
10
|
+
//
|
|
11
|
+
// Objects keep INSERTION order (a vector of pairs, not a std::map, which
|
|
12
|
+
// orders by key): a signed payload's field order is part of what was
|
|
13
|
+
// signed, and the shared spec compares whole maps.
|
|
14
|
+
//
|
|
15
|
+
// A port of typescript/src/Json.ts, which is canonical.
|
|
16
|
+
|
|
17
|
+
#ifndef SEKRETO_JSON_HPP
|
|
18
|
+
#define SEKRETO_JSON_HPP
|
|
19
|
+
|
|
20
|
+
#include <initializer_list>
|
|
21
|
+
#include <string>
|
|
22
|
+
#include <utility>
|
|
23
|
+
#include <vector>
|
|
24
|
+
|
|
25
|
+
namespace sekreto {
|
|
26
|
+
|
|
27
|
+
class Json {
|
|
28
|
+
public:
|
|
29
|
+
// Six cases, and numbers are doubles only: JSON has one number type, and
|
|
30
|
+
// an integer case here would round-trip differently from every other
|
|
31
|
+
// port. `numstr` puts an integral double back as an integer.
|
|
32
|
+
enum class Type { Null, Bool, Num, Str, Arr, Obj };
|
|
33
|
+
|
|
34
|
+
Type type = Type::Null;
|
|
35
|
+
bool boolval = false;
|
|
36
|
+
double numval = 0;
|
|
37
|
+
std::string strval;
|
|
38
|
+
std::vector<Json> arrval;
|
|
39
|
+
std::vector<std::pair<std::string, Json>> objval;
|
|
40
|
+
|
|
41
|
+
Json() = default;
|
|
42
|
+
|
|
43
|
+
static Json null();
|
|
44
|
+
static Json boolean(bool val);
|
|
45
|
+
static Json num(double val);
|
|
46
|
+
static Json str(const std::string& val);
|
|
47
|
+
static Json arr(std::vector<Json> entries);
|
|
48
|
+
static Json obj(std::vector<std::pair<std::string, Json>> entries);
|
|
49
|
+
|
|
50
|
+
bool isnull() const { return Type::Null == type; }
|
|
51
|
+
bool isbool() const { return Type::Bool == type; }
|
|
52
|
+
bool isnum() const { return Type::Num == type; }
|
|
53
|
+
bool isstr() const { return Type::Str == type; }
|
|
54
|
+
bool isarr() const { return Type::Arr == type; }
|
|
55
|
+
bool isobj() const { return Type::Obj == type; }
|
|
56
|
+
|
|
57
|
+
// One step down an object, for reading a vault's answer. A missing key,
|
|
58
|
+
// or a step through anything that is not an object, yields Null - which
|
|
59
|
+
// every caller reads as "no value", so a chain of steps needs no guards.
|
|
60
|
+
Json get(const std::string& key) const;
|
|
61
|
+
|
|
62
|
+
// Typed accessors. Each answers nothing for the wrong type: `__type`
|
|
63
|
+
// must be a string, a 1Password vault list an array, a Doppler config an
|
|
64
|
+
// object, or the value is not what the protocol promised.
|
|
65
|
+
bool asstr(std::string& out) const;
|
|
66
|
+
bool asnum(double& out) const;
|
|
67
|
+
|
|
68
|
+
// Printable text, or nothing. JSON Null yields NOTHING rather than the
|
|
69
|
+
// string "null", so a null field is a miss and never the four letters.
|
|
70
|
+
bool text(std::string& out) const;
|
|
71
|
+
|
|
72
|
+
// Parse. FAILURE IS NOT NULL: `false` means "this text is not JSON",
|
|
73
|
+
// which fetchjson has to tell apart from "this text is the literal
|
|
74
|
+
// null". No exception escapes.
|
|
75
|
+
static bool parse(const std::string& text, Json& out);
|
|
76
|
+
|
|
77
|
+
static std::string stringify(const Json& val);
|
|
78
|
+
|
|
79
|
+
// Public, because the CLI assembles its output line field by field.
|
|
80
|
+
static std::string quote(const std::string& text);
|
|
81
|
+
|
|
82
|
+
// An integral double below 2^53 prints as an integer, so a JSON 1
|
|
83
|
+
// round-trips as 1 and not 1.0.
|
|
84
|
+
static std::string numstr(double val);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace sekreto
|
|
88
|
+
|
|
89
|
+
#endif
|