@voxgig/sdkgen 4.20.0 → 4.21.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/dist/helpers/applicability.js +11 -6
- package/dist/helpers/applicability.js.map +1 -1
- package/dist/helpers/collectDeps.js +31 -6
- package/dist/helpers/collectDeps.js.map +1 -1
- package/dist/helpers/naming.js +2 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +49 -3
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +128 -0
- package/project/.sdk/model/feature/validate.aon +3 -2
- package/project/.sdk/model/target/c.aon +1 -1
- package/project/.sdk/model/target/clojure.aon +1 -1
- package/project/.sdk/model/target/cpp.aon +1 -1
- package/project/.sdk/model/target/csharp.aon +1 -1
- package/project/.sdk/model/target/elixir.aon +1 -1
- package/project/.sdk/model/target/go.aon +1 -1
- package/project/.sdk/model/target/java.aon +1 -1
- package/project/.sdk/model/target/kotlin.aon +1 -1
- package/project/.sdk/model/target/lua.aon +1 -1
- package/project/.sdk/model/target/ocaml.aon +1 -1
- package/project/.sdk/model/target/perl.aon +1 -1
- package/project/.sdk/model/target/php.aon +1 -1
- package/project/.sdk/model/target/py.aon +1 -1
- package/project/.sdk/model/target/rb.aon +1 -1
- package/project/.sdk/model/target/rust.aon +1 -1
- package/project/.sdk/model/target/scala.aon +1 -1
- package/project/.sdk/model/target/swift.aon +1 -1
- package/project/.sdk/model/target/zig.aon +1 -1
- package/project/.sdk/src/cmp/c/Main_c.ts +3 -0
- package/project/.sdk/src/cmp/c/Schema_c.ts +106 -0
- package/project/.sdk/src/cmp/clojure/Main_clojure.ts +2 -0
- package/project/.sdk/src/cmp/clojure/ReadmeExplanation_clojure.ts +1 -0
- package/project/.sdk/src/cmp/clojure/Schema_clojure.ts +73 -0
- package/project/.sdk/src/cmp/cpp/Main_cpp.ts +3 -0
- package/project/.sdk/src/cmp/cpp/Schema_cpp.ts +105 -0
- package/project/.sdk/src/cmp/csharp/Main_csharp.ts +3 -0
- package/project/.sdk/src/cmp/csharp/Schema_csharp.ts +85 -0
- package/project/.sdk/src/cmp/elixir/Main_elixir.ts +2 -0
- package/project/.sdk/src/cmp/elixir/ReadmeExplanation_elixir.ts +1 -0
- package/project/.sdk/src/cmp/elixir/Schema_elixir.ts +88 -0
- package/project/.sdk/src/cmp/go/Main_go.ts +2 -0
- package/project/.sdk/src/cmp/go/Schema_go.ts +93 -0
- package/project/.sdk/src/cmp/java/Main_java.ts +2 -0
- package/project/.sdk/src/cmp/java/Schema_java.ts +125 -0
- package/project/.sdk/src/cmp/kotlin/Main_kotlin.ts +2 -0
- package/project/.sdk/src/cmp/kotlin/Schema_kotlin.ts +111 -0
- package/project/.sdk/src/cmp/lua/Main_lua.ts +46 -9
- package/project/.sdk/src/cmp/lua/Package_lua.ts +1 -0
- package/project/.sdk/src/cmp/lua/ReadmeExplanation_lua.ts +1 -0
- package/project/.sdk/src/cmp/lua/Schema_lua.ts +72 -0
- package/project/.sdk/src/cmp/ocaml/Config_ocaml.ts +24 -1
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +34 -13
- package/project/.sdk/src/cmp/ocaml/ReadmeExplanation_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Schema_ocaml.ts +99 -0
- package/project/.sdk/src/cmp/perl/Main_perl.ts +2 -0
- package/project/.sdk/src/cmp/perl/ReadmeExplanation_perl.ts +1 -0
- package/project/.sdk/src/cmp/perl/Schema_perl.ts +107 -0
- package/project/.sdk/src/cmp/php/Main_php.ts +2 -0
- package/project/.sdk/src/cmp/php/Package_php.ts +1 -1
- package/project/.sdk/src/cmp/php/ReadmeExplanation_php.ts +1 -0
- package/project/.sdk/src/cmp/php/Schema_php.ts +129 -0
- package/project/.sdk/src/cmp/py/Main_py.ts +2 -0
- package/project/.sdk/src/cmp/py/ReadmeExplanation_py.ts +1 -0
- package/project/.sdk/src/cmp/py/Schema_py.ts +72 -0
- package/project/.sdk/src/cmp/rb/Main_rb.ts +2 -0
- package/project/.sdk/src/cmp/rb/ReadmeExplanation_rb.ts +1 -0
- package/project/.sdk/src/cmp/rb/Schema_rb.ts +70 -0
- package/project/.sdk/src/cmp/rust/Main_rust.ts +3 -0
- package/project/.sdk/src/cmp/rust/Schema_rust.ts +107 -0
- package/project/.sdk/src/cmp/scala/Main_scala.ts +3 -0
- package/project/.sdk/src/cmp/scala/Schema_scala.ts +108 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +3 -0
- package/project/.sdk/src/cmp/swift/Schema_swift.ts +92 -0
- package/project/.sdk/src/cmp/zig/Main_zig.ts +3 -0
- package/project/.sdk/src/cmp/zig/Schema_zig.ts +114 -0
- package/project/.sdk/tm/c/core/context.c +3 -0
- package/project/.sdk/tm/c/core/sdk.h +14 -0
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/capability.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/catalog.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/config.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/config.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/depend.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/env.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/env.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/export.c +3 -3
- package/project/.sdk/tm/c/feature/secrets/plugin/export.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/graph.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/host.c +25 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/host.h +3 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/order.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/order.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/point.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/point.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/ref.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/resolve.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/types.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/types.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/value.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/value.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/version.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugin/version.h +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/aws.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/azuresecrets.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/boru.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/clock.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/doppler.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/encode.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/gcpsecrets.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/hashicorp.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/httpjson.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/infisical.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/minivault.c +2072 -0
- package/project/.sdk/tm/c/feature/secrets/plugins/onepassword.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/proc.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/secretspec.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/sekretoplugins.h +151 -10
- package/project/.sdk/tm/c/feature/secrets/plugins/sha256.c +16 -10
- package/project/.sdk/tm/c/feature/secrets/plugins/sigv4.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/plugins/support.h +12 -8
- package/project/.sdk/tm/c/feature/secrets/plugins/tls.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/sekreto/internal.h +17 -2
- package/project/.sdk/tm/c/feature/secrets/sekreto/json.c +5 -5
- package/project/.sdk/tm/c/feature/secrets/sekreto/providers.c +37 -9
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.c +2 -2
- package/project/.sdk/tm/c/feature/secrets/sekreto/sekreto.h +17 -2
- package/project/.sdk/tm/c/feature/secrets/sekreto/util.c +16 -2
- package/project/.sdk/tm/c/feature/validate.c +364 -0
- package/project/.sdk/tm/c/feature/validate.h +29 -0
- package/project/.sdk/tm/c/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +2 -2
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +2 -2
- package/project/.sdk/tm/c/utility/make_options.c +12 -24
- package/project/.sdk/tm/c/utility/make_spec.c +8 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/capability.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/catalog.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/config.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/depend.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/env.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/export.clj +3 -3
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/graph.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/host.clj +17 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/json.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/order.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/point.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/ref.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/resolve.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/types.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin/version.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/plugin.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/addr.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/chain.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/core.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/json.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/aws.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/azuresecrets.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/boru.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/doppler.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/gcpsecrets.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/hashicorp.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/httpjson.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/infisical.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/minivault.clj +837 -0
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/onepassword.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/proc.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/secretspec.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/plugins/sigv4.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/provider.clj +2 -2
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto/providers.clj +6 -4
- package/project/.sdk/tm/clojure/feature/secrets/voxgig/sekreto.clj +2 -2
- package/project/.sdk/tm/clojure/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/clojure/src/sdk/core.clj +31 -41
- package/project/.sdk/tm/clojure/src/sdk/features.clj +202 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +2 -2
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +2 -2
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +2 -2
- package/project/.sdk/tm/cpp/core/types.hpp +4 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/capability.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/catalog.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/config.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/depend.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/env.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.cpp +3 -3
- package/project/.sdk/tm/cpp/feature/secrets/plugin/export.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/graph.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.cpp +21 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/host.hpp +3 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/order.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/point.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/ref.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/resolve.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/types.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/value.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugin/version.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Aws.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Azuresecrets.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Boru.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Crypto.hpp +9 -7
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Doppler.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Gcpsecrets.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Hashicorp.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Httpjson.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Infisical.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Minivault.cpp +1345 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Minivault.hpp +219 -0
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Onepassword.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Proc.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Secretspec.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Sigv4.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/plugins/Tls.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Json.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.cpp +22 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Provider.hpp +12 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.cpp +3 -3
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Providers.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.cpp +2 -2
- package/project/.sdk/tm/cpp/feature/secrets/sekreto/Sekreto.hpp +2 -2
- package/project/.sdk/tm/cpp/feature/validate.hpp +301 -0
- package/project/.sdk/tm/cpp/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +2 -2
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +2 -2
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +2 -2
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +24 -41
- package/project/.sdk/tm/csharp/feature/ValidateFeature.cs +343 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Capability.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Catalog.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Config.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Definition.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Depend.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Entry.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Env.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Export.cs +3 -3
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Graph.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Host.cs +9 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Inst.cs +21 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Json.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Order.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Plugin.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Point.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Refs.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Resolve.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Types.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugin/Version.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Aws.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/AzureSecrets.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Boru.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Child.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Doppler.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/GcpSecrets.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Hashicorp.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/HttpJson.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Infisical.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/MiniVault.cs +1572 -0
- package/project/.sdk/tm/csharp/feature/secrets/plugins/OnePassword.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/SecretSpec.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/plugins/Sigv4.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Json.cs +2 -2
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Providers.cs +3 -2
- package/project/.sdk/tm/csharp/feature/secrets/sekreto/Sekreto.cs +2 -2
- package/project/.sdk/tm/csharp/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +2 -2
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +2 -2
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +12 -85
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +24 -3
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/capability.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/catalog.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/config.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/depend.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/env.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/error.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/export.ex +7 -4
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/graph.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/host.ex +13 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/inst.ex +15 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/json.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/order.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/point.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/ref.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/resolve.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/types.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/version.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/plugin/voxgig_plugin.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/json.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/aws.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/azuresecrets.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/boru.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/doppler.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/gcpsecrets.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/hashicorp.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/http.ex +3 -3
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/httpjson.ex +3 -3
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/infisical.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/minivault.ex +1033 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/onepassword.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/proc.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/secretspec.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/plugins/sigv4.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/provider.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/providers.ex +17 -5
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets/sekreto/sekreto.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/validate.ex +320 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +10 -46
- package/project/.sdk/tm/elixir/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +2 -2
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +2 -2
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +25 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +1 -1
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/minivault/format.go +493 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/minivault/minivault.go +1131 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +2 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +14 -2
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +2 -2
- package/project/.sdk/tm/go/feature/validate_feature.go +346 -0
- package/project/.sdk/tm/go/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/omni/omni.go +2 -2
- package/project/.sdk/tm/go/test/omni/util.go +2 -2
- package/project/.sdk/tm/go/utility/make_options.go +13 -54
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +24 -8
- package/project/.sdk/tm/java/feature/ValidateFeature.java +330 -0
- package/project/.sdk/tm/java/feature/secrets/plugin/Capability.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Catalog.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Config.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Definition.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Depend.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Entry.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Env.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Export.java +3 -3
- package/project/.sdk/tm/java/feature/secrets/plugin/Graph.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Host.java +3 -3
- package/project/.sdk/tm/java/feature/secrets/plugin/Inst.java +21 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Json.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Order.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Plugin.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/PluginException.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Point.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Refs.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Resolve.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Types.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/plugin/Version.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/Addr.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/Builtins.java +4 -3
- package/project/.sdk/tm/java/feature/secrets/sekreto/Json.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/Provider.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/Sekreto.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/Support.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Aws.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Azuresecrets.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Boru.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Doppler.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Gcpsecrets.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Hashicorp.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Httpjson.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Infisical.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Minivault.java +1448 -0
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Onepassword.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Proc.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Secretspec.java +2 -2
- package/project/.sdk/tm/java/feature/secrets/sekreto/plugins/Sigv4.java +2 -2
- package/project/.sdk/tm/java/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +2 -2
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +2 -2
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +2 -2
- package/project/.sdk/tm/java/utility/MakeOptions.java +13 -45
- package/project/.sdk/tm/java/utility/struct/Struct.java +1 -1
- package/project/.sdk/tm/js/src/feature/secrets/plugin/capability.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/catalog.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/config.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/depend.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/env.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/export.js +3 -3
- package/project/.sdk/tm/js/src/feature/secrets/plugin/graph.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/host.js +17 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/index.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/order.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/point.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/ref.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/resolve.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/types.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/plugin/version.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/Sekreto.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/index.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/aws.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/azuresecrets.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/boru.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/doppler.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/gcpsecrets.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/hashicorp.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/httpjson.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/infisical.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/minivault.js +866 -0
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/onepassword.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/secretspec.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/plugins/sigv4.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/addr.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/builtin.js +3 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/dotenv.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/env.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/file.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/memory.js +2 -2
- package/project/.sdk/tm/js/src/feature/secrets/sekreto/provider/support.js +2 -2
- package/project/.sdk/tm/js/src/utility/StructUtility.js +1 -1
- package/project/.sdk/tm/js/test/vendor/omni/index.js +1 -1
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +1 -1
- package/project/.sdk/tm/js/test/vendor/omni/util.js +1 -1
- package/project/.sdk/tm/kotlin/feature/ValidateFeature.kt +297 -0
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Capability.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Catalog.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Config.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Depend.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Env.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Export.kt +3 -3
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Graph.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Host.kt +21 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Json.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Order.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Plugin.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Point.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Refs.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Resolve.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Types.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/plugin/Version.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Json.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Provider.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Providers.kt +3 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Sekreto.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Spec.kt +14 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/Support.kt +10 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Aws.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Azuresecrets.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Boru.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Doppler.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Gcpsecrets.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Hashicorp.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Httpjson.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Infisical.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Minivault.kt +1095 -0
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Onepassword.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Secretspec.kt +2 -2
- package/project/.sdk/tm/kotlin/feature/secrets/sekreto/plugins/Sigv4.kt +2 -2
- package/project/.sdk/tm/kotlin/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +2 -2
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +2 -2
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +2 -2
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +13 -35
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -0
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +1 -1
- package/project/.sdk/tm/lua/feature/secrets/native/sekretonet.c +2 -2
- package/project/.sdk/tm/lua/feature/secrets/native/sekretovault.c +240 -0
- package/project/.sdk/tm/lua/feature/secrets/plugin/capability.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/catalog.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/config.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/depend.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/env.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/export.lua +12 -3
- package/project/.sdk/tm/lua/feature/secrets/plugin/graph.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/host.lua +18 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/json.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/order.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/point.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/ref.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/resolve.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/types.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin/version.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/plugin.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/addr.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/err.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/name.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/aws.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/azuresecrets.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/boru.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/crypto.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/doppler.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/gcpsecrets.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/hashicorp.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/httpjson.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/infisical.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/json.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/minivault.lua +1227 -0
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/net.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/onepassword.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/secretspec.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/sigv4.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/plugins/support.lua +2 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto/providers.lua +3 -2
- package/project/.sdk/tm/lua/feature/secrets/sekreto.lua +2 -2
- package/project/.sdk/tm/lua/feature/validate_feature.lua +333 -0
- package/project/.sdk/tm/lua/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +2 -2
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +2 -2
- package/project/.sdk/tm/lua/utility/make_options.lua +74 -55
- package/project/.sdk/tm/lua/utility/make_spec.lua +8 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +1 -1
- package/project/.sdk/tm/lua/utility/struct/struct.lua +1 -1
- package/project/.sdk/tm/ocaml/Makefile +12 -7
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/capability.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/catalog.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/config.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/defs.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/depend.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/env.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/export.ml +5 -3
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/graph.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/host.ml +18 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/order.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/point.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/ref.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/resolve.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/types.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/value.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugin/version.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/aws.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/azuresecrets.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/boru.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/crypto.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/doppler.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/gcpsecrets.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/hashicorp.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/http.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/httpjson.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/infisical.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/minivault.ml +1086 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/minivault_stubs.c +222 -0
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/onepassword.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/runcmd.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/secretspec.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/sigv4.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/plugins/tls_stubs.c +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/json.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/provider.ml +33 -3
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/secret.ml +2 -2
- package/project/.sdk/tm/ocaml/feature/secrets/sekreto/sekreto.ml +4 -3
- package/project/.sdk/tm/ocaml/sdk_features.ml +174 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +12 -37
- package/project/.sdk/tm/ocaml/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +2 -2
- package/project/.sdk/tm/perl/core/helpers.pm +64 -16
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Capability.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Catalog.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Config.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Depend.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Env.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Export.pm +3 -3
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Graph.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Host.pm +19 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Order.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Point.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Ref.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Resolve.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Types.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin/Version.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugin/Voxgig/Plugin.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Aws.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Azuresecrets.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Boru.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Doppler.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Gcpsecrets.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Hashicorp.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Httpjson.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Infisical.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Minivault.pm +1380 -0
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Onepassword.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Proc.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Secretspec.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/plugins/Voxgig/Sekreto/Plugins/Sigv4.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto/Addr.pm +2 -2
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto/Providers.pm +4 -3
- package/project/.sdk/tm/perl/feature/secrets/sekreto/Voxgig/Sekreto.pm +2 -2
- package/project/.sdk/tm/perl/feature/validate_feature.pm +319 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +1 -1
- package/project/.sdk/tm/perl/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +1 -1
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +1 -1
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +1 -1
- package/project/.sdk/tm/perl/utility/make_options.pm +25 -43
- package/project/.sdk/tm/php/feature/ValidateFeature.php +361 -0
- package/project/.sdk/tm/php/feature/secrets/plugin/Capability.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Catalog.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Config.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Depend.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Env.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Export.php +3 -3
- package/project/.sdk/tm/php/feature/secrets/plugin/Graph.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Host.php +26 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Order.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Point.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Ref.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Resolve.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Types.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/Version.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/plugin/plugin.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/aws.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/azuresecrets.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/boru.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/doppler.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/gcpsecrets.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/hashicorp.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/httpjson.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/infisical.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/minivault.php +1250 -0
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/onepassword.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/runcmd.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/secretspec.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/plugins/sigv4.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Addr.php +2 -2
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Providers.php +5 -3
- package/project/.sdk/tm/php/feature/secrets/sekreto/src/Sekreto.php +2 -2
- package/project/.sdk/tm/php/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +2 -2
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +2 -2
- package/project/.sdk/tm/php/utility/MakeOptions.php +15 -31
- package/project/.sdk/tm/php/utility/struct/Struct.php +56 -7
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +2 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +17 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/minivault.py +1202 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +2 -1
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +1 -1
- package/project/.sdk/tm/py/pkg/feature/validate_feature.py +273 -0
- package/project/.sdk/tm/py/pkg/utility/make_options.py +14 -53
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +1 -1
- package/project/.sdk/tm/py/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +1 -1
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +1 -1
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +1 -1
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/capability.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/catalog.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/config.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/depend.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/env.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/export.rb +3 -3
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/graph.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/host.rb +16 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/order.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/point.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/ref.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/resolve.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/types.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin/version.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_plugin.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/addr.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/aws.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/azuresecrets.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/boru.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/doppler.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/hashicorp.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/httpjson.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/infisical.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/minivault.rb +979 -0
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/onepassword.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/secretspec.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/plugins/sigv4.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/providers.rb +6 -5
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto/sekreto.rb +2 -2
- package/project/.sdk/tm/rb/feature/secrets/voxgig_sekreto.rb +2 -2
- package/project/.sdk/tm/rb/feature/validate_feature.rb +265 -0
- package/project/.sdk/tm/rb/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +2 -2
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +2 -2
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +2 -2
- package/project/.sdk/tm/rb/utility/make_options.rb +15 -32
- package/project/.sdk/tm/rb/utility/struct/voxgig_struct.rb +24 -1
- package/project/.sdk/tm/rust/core/mod.rs +3 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/capability.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/catalog.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/config.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/depend.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/env.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/export.rs +3 -3
- package/project/.sdk/tm/rust/feature/secrets/plugin/graph.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/host.rs +24 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/mod.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/order.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/point.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/refs.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/resolve.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/types.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/value.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugin/version.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws/crypto.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws/sigv4.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/aws.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/azuresecrets.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/boru.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/doppler.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/gcpsecrets.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/hashicorp.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson/http.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson/json.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/httpjson.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/infisical.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/minivault/format.rs +425 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/minivault.rs +1076 -0
- package/project/.sdk/tm/rust/feature/secrets/plugins/onepassword.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/plugins/secretspec.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/sekreto/addr.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/sekreto/mod.rs +2 -2
- package/project/.sdk/tm/rust/feature/secrets/sekreto/providers.rs +30 -4
- package/project/.sdk/tm/rust/feature/secrets/sekreto/sekreto.rs +2 -2
- package/project/.sdk/tm/rust/feature/validate.rs +387 -0
- package/project/.sdk/tm/rust/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +2 -2
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +2 -2
- package/project/.sdk/tm/rust/utility/make_options.rs +12 -63
- package/project/.sdk/tm/rust/utility/make_spec.rs +10 -3
- package/project/.sdk/tm/scala/feature/ValidateFeature.scala +286 -0
- package/project/.sdk/tm/scala/feature/secrets/plugin/Capability.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Config.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Depend.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Env.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Export.scala +3 -3
- package/project/.sdk/tm/scala/feature/secrets/plugin/Graph.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Host.scala +19 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Json.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Order.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Plugin.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Point.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Refs.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Resolve.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Types.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Value.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/plugin/Version.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Json.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Provider.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Providers.scala +3 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Sekreto.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Spec.scala +13 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/Support.scala +11 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Aws.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Azuresecrets.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Boru.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Doppler.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Gcpsecrets.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Hashicorp.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Httpjson.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Infisical.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Minivault.scala +979 -0
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Onepassword.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Secretspec.scala +2 -2
- package/project/.sdk/tm/scala/feature/secrets/sekreto/plugins/Sigv4.scala +2 -2
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +2 -2
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +2 -2
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +2 -2
- package/project/.sdk/tm/scala/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/scala/utility/Make.scala +12 -41
- package/project/.sdk/tm/scala/utility/MakeSpec.scala +8 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ValidateFeature.swift +273 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Capability.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Catalog.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Config.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Depend.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Env.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Export.swift +3 -3
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Graph.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Host.swift +17 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Json.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Order.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Point.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Refs.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Resolve.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Types.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Value.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugin/Version.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Aws.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Azuresecrets.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Boru.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Crypto.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Doppler.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Gcpsecrets.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Hashicorp.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Httpjson.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Infisical.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Onepassword.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Proc.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Secretspec.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/plugins/Sigv4.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Addr.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Json.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Provider.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Providers.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/secrets/sekreto/Sekreto.swift +2 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Make.swift +9 -3
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +12 -87
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +3 -3
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +2 -2
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +2 -2
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +2 -2
- package/project/.sdk/tm/swift/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +13 -2
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +27 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/aws.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/azuresecrets.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/boru.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/doppler.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/gcpsecrets.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/hashicorp.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/infisical.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/minivault.ts +1034 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/onepassword.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/sigv4.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +2 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +1 -1
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +11 -1
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +1 -1
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +1 -1
- package/project/.sdk/tm/zig/core/utility.zig +20 -44
- package/project/.sdk/tm/zig/feature/secrets/plugin/capability.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/catalog.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/config.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/depend.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/env.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/export.zig +3 -3
- package/project/.sdk/tm/zig/feature/secrets/plugin/graph.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/host.zig +18 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/inst.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/order.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/plugin.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/point.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/ref.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/resolve.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/types.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/value.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugin/version.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/aws.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/azuresecrets.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/boru.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/doppler.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/gcpsecrets.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/hashicorp.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/httpjson.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/infisical.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/minivault.zig +1930 -0
- package/project/.sdk/tm/zig/feature/secrets/plugins/onepassword.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/secretspec.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/plugins/sigv4.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/sekreto/addr.zig +2 -2
- package/project/.sdk/tm/zig/feature/secrets/sekreto/builtins.zig +3 -2
- package/project/.sdk/tm/zig/feature/secrets/sekreto/provider.zig +19 -2
- package/project/.sdk/tm/zig/feature/secrets/sekreto/sekreto.zig +2 -2
- package/project/.sdk/tm/zig/feature/validate.zig +293 -0
- package/project/.sdk/tm/zig/src/feature/validate/.gitkeep +0 -0
- package/project/.sdk/tm/zig/test/vendor/omni/omni.zig +2 -2
- package/project/.sdk/tm/zig/test/vendor/omni/regex.zig +2 -2
- package/project/.sdk/tm/zig/utility/voxgigstruct/regex.zig +2 -2
- package/project/.sdk/tm/zig/utility/voxgigstruct/struct.zig +2 -2
- package/project/sdkgen-package.json +1 -1
- package/src/helpers/applicability.ts +11 -6
- package/src/helpers/collectDeps.ts +30 -5
- package/src/helpers/naming.ts +2 -2
|
@@ -0,0 +1,1572 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260917-1242-0 (csharp/plugins/MiniVault.cs)
|
|
2
|
+
// Source: https://github.com/voxgig/sekreto @ 108c4a914bee7b6534c30d1c68c25cd1b9377696 [tag: sdk-20260917-1242-0]
|
|
3
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
// The mini vault, as a voxgig/plugin definition.
|
|
5
|
+
//
|
|
6
|
+
// A port of typescript/plugins/minivault.ts, which is canonical.
|
|
7
|
+
//
|
|
8
|
+
// PLUGIN CODE. This file is in the VoxgigSekretoPlugins assembly, which
|
|
9
|
+
// the core does not reference - so nothing here is linked into an
|
|
10
|
+
// application whose chain names only built-in kinds. It needs crypto,
|
|
11
|
+
// which is the line the four built-ins stay behind. See
|
|
12
|
+
// docs/design/plugin-providers.md.
|
|
13
|
+
//
|
|
14
|
+
// THE KEY DECIDES WHAT THE VAULT HOLDS. A master key reads and writes
|
|
15
|
+
// every name and mints restricted keys. A restricted key reads the names
|
|
16
|
+
// it was granted and CANNOT DERIVE ANY OTHER - the restriction is the
|
|
17
|
+
// cryptography rather than a check this code performs. What that does and
|
|
18
|
+
// does not protect is set out in DOCS.md under "What the mini vault
|
|
19
|
+
// protects".
|
|
20
|
+
//
|
|
21
|
+
// System.Security.Cryptography carries all four primitives, so nothing
|
|
22
|
+
// here is hand-rolled (AGENTS.md rule 3).
|
|
23
|
+
|
|
24
|
+
using System;
|
|
25
|
+
using System.Collections.Generic;
|
|
26
|
+
using System.IO;
|
|
27
|
+
using System.Linq;
|
|
28
|
+
using System.Security.Cryptography;
|
|
29
|
+
using System.Text;
|
|
30
|
+
|
|
31
|
+
using Definition = Voxgig.Plugin.Definition;
|
|
32
|
+
using Types = Voxgig.Plugin.Types;
|
|
33
|
+
using PluginException = Voxgig.Plugin.PluginException;
|
|
34
|
+
|
|
35
|
+
namespace Voxgig.Sekreto.Plugins
|
|
36
|
+
{
|
|
37
|
+
/// <summary>
|
|
38
|
+
/// A mini vault: every secret a project owns, encrypted, in ONE FILE.
|
|
39
|
+
///
|
|
40
|
+
/// <para>The format:</para>
|
|
41
|
+
/// <code>
|
|
42
|
+
/// magic 4 'SKMV'
|
|
43
|
+
/// version 1 FORMAT
|
|
44
|
+
/// kdf 1 1 = PBKDF2-HMAC-SHA256
|
|
45
|
+
/// cipher 1 1 = AES-256-GCM
|
|
46
|
+
/// reserved 1 0
|
|
47
|
+
/// keycount 4 uint32
|
|
48
|
+
/// per key:
|
|
49
|
+
/// id 1 + bytes the key id, PLAINTEXT
|
|
50
|
+
/// salt 1 + bytes
|
|
51
|
+
/// iters 4 PBKDF2 rounds for this key
|
|
52
|
+
/// ring 1 + iv, 4 + bytes sealed under the passphrase
|
|
53
|
+
/// meta 1 + iv, 4 + bytes sealed under the vault's meta key
|
|
54
|
+
/// entrycount 4 uint32
|
|
55
|
+
/// per entry:
|
|
56
|
+
/// id 1 + bytes the blinded lookup id
|
|
57
|
+
/// name 1 + iv, 4 + bytes sealed under the vault's name key
|
|
58
|
+
/// value 1 + iv, 4 + bytes sealed under that secret's own key
|
|
59
|
+
/// </code>
|
|
60
|
+
///
|
|
61
|
+
/// <para>Integers are big-endian, and every length precedes its bytes.
|
|
62
|
+
/// A file one port writes is read by every other; `test/fixture` pins
|
|
63
|
+
/// that with a committed vault rather than with agreement.</para>
|
|
64
|
+
/// </summary>
|
|
65
|
+
public static class MiniVault
|
|
66
|
+
{
|
|
67
|
+
internal const string Magic = "SKMV";
|
|
68
|
+
internal const int Format = 1;
|
|
69
|
+
internal const int KdfPbkdf2 = 1;
|
|
70
|
+
internal const int CipherAesGcm = 1;
|
|
71
|
+
|
|
72
|
+
/// <summary>AES-256-GCM: 32-byte keys, 12-byte nonces, 16-byte tags.</summary>
|
|
73
|
+
internal const int KeyLen = 32;
|
|
74
|
+
|
|
75
|
+
internal const int IvLen = 12;
|
|
76
|
+
internal const int TagLen = 16;
|
|
77
|
+
internal const int SaltLen = 16;
|
|
78
|
+
|
|
79
|
+
/// <summary>PBKDF2-HMAC-SHA256 rounds when a caller names none.</summary>
|
|
80
|
+
public const int Iterations = 210000;
|
|
81
|
+
|
|
82
|
+
/// <summary>The key id a vault gets when a caller names none.</summary>
|
|
83
|
+
public const string MasterKey = "master";
|
|
84
|
+
|
|
85
|
+
/// <summary>
|
|
86
|
+
/// The lock every handle on one file shares.
|
|
87
|
+
///
|
|
88
|
+
/// <para>Each <c>Vault</c> is its own object, so two handles on one
|
|
89
|
+
/// path did not coordinate: both could finish <c>Load()</c> before
|
|
90
|
+
/// either saved, and the second <c>File.Move</c> then discarded the
|
|
91
|
+
/// first one's change while reporting success. Keyed by the ABSOLUTE
|
|
92
|
+
/// path, so two handles spelled differently still meet.</para>
|
|
93
|
+
///
|
|
94
|
+
/// <para>A guarantee WITHIN one process, which is what DOCS.md
|
|
95
|
+
/// promises and what the go port arranges the same way. Two
|
|
96
|
+
/// processes still race, and the format's answer to that is the
|
|
97
|
+
/// exclusive create and the atomic rename.</para>
|
|
98
|
+
/// </summary>
|
|
99
|
+
private static readonly System.Collections.Concurrent.ConcurrentDictionary<string, object>
|
|
100
|
+
Locks = new System.Collections.Concurrent.ConcurrentDictionary<string, object>();
|
|
101
|
+
|
|
102
|
+
internal static object LockFor(string file)
|
|
103
|
+
{
|
|
104
|
+
string key;
|
|
105
|
+
try
|
|
106
|
+
{
|
|
107
|
+
key = Path.GetFullPath(file);
|
|
108
|
+
}
|
|
109
|
+
catch (Exception)
|
|
110
|
+
{
|
|
111
|
+
key = file;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return Locks.GetOrAdd(key, _ => new object());
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// <summary>
|
|
118
|
+
/// The key a caller asked for, or <c>master</c>: an EMPTY key is no
|
|
119
|
+
/// key. The canonical's <c>opts.key || MASTERKEY</c> answers for
|
|
120
|
+
/// both null and empty, where <c>??</c> answers for null alone - and
|
|
121
|
+
/// a CLI reaches this with SEKRETO_VAULT_KEY set and empty, which is
|
|
122
|
+
/// what an unset shell variable expands to.
|
|
123
|
+
/// </summary>
|
|
124
|
+
internal static string WantKey(string? value)
|
|
125
|
+
{
|
|
126
|
+
return string.IsNullOrEmpty(value) ? MasterKey : value;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Additional authenticated data. Every blob is bound to its PLACE in
|
|
130
|
+
// the file, so no ciphertext can be moved.
|
|
131
|
+
internal const string AadRing = "skmv1:ring:";
|
|
132
|
+
internal const string AadMeta = "skmv1:meta:";
|
|
133
|
+
internal const string AadName = "skmv1:name";
|
|
134
|
+
internal const string AadSecret = "skmv1:secret:";
|
|
135
|
+
|
|
136
|
+
// Everything a master can reach is derived from the root key, so a
|
|
137
|
+
// rotation is one new random value rather than a re-wrap of each part.
|
|
138
|
+
internal const string LabelNames = "skmv1:names";
|
|
139
|
+
internal const string LabelMeta = "skmv1:meta";
|
|
140
|
+
internal const string LabelId = "skmv1:id";
|
|
141
|
+
|
|
142
|
+
/// <summary>
|
|
143
|
+
/// The largest key id the format can record.
|
|
144
|
+
///
|
|
145
|
+
/// <para>`Small` writes a length in ONE byte. A longer id wrapped
|
|
146
|
+
/// that byte and the writer then appended the whole thing, so every
|
|
147
|
+
/// field after it shifted. Checked where an id is ACCEPTED, so the
|
|
148
|
+
/// refusal names the id rather than the file.</para>
|
|
149
|
+
/// </summary>
|
|
150
|
+
internal const int IdMax = 255;
|
|
151
|
+
|
|
152
|
+
/// <summary>
|
|
153
|
+
/// The export key the vault API is published under, beside the
|
|
154
|
+
/// `provider` key every kind publishes.
|
|
155
|
+
/// </summary>
|
|
156
|
+
public const string VaultExport = "vault";
|
|
157
|
+
|
|
158
|
+
internal static SekretoError Fail(string text)
|
|
159
|
+
{
|
|
160
|
+
return new SekretoError("sekreto: minivault: " + text);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
internal static string CheckId(object id, string what)
|
|
164
|
+
{
|
|
165
|
+
var text = id as string;
|
|
166
|
+
|
|
167
|
+
if (null == text || 0 == text.Length)
|
|
168
|
+
{
|
|
169
|
+
throw Fail(what);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (Utf8(text).Length > IdMax)
|
|
173
|
+
{
|
|
174
|
+
throw Fail("key id is longer than " + IdMax + " bytes: "
|
|
175
|
+
+ text.Substring(0, Math.Min(32, text.Length)) + "...");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return text;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
internal static byte[] Utf8(string text)
|
|
182
|
+
{
|
|
183
|
+
return Encoding.UTF8.GetBytes(text);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// --- keys --------------------------------------------------------
|
|
187
|
+
|
|
188
|
+
internal static byte[] Hmac(byte[] key, string text)
|
|
189
|
+
{
|
|
190
|
+
using (var mac = new HMACSHA256(key))
|
|
191
|
+
{
|
|
192
|
+
return mac.ComputeHash(Utf8(text));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/// <summary>The key-encryption key a passphrase unwraps a ring with.</summary>
|
|
197
|
+
internal static byte[] Kek(string passphrase, byte[] salt, int iters)
|
|
198
|
+
{
|
|
199
|
+
return Rfc2898DeriveBytes.Pbkdf2(
|
|
200
|
+
Utf8(passphrase), salt, iters, HashAlgorithmName.SHA256, KeyLen);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/// <summary>
|
|
204
|
+
/// The key one named secret's value is encrypted with.
|
|
205
|
+
///
|
|
206
|
+
/// <para>DERIVED, never stored, for a master: it holds the root key
|
|
207
|
+
/// and so reaches every name, including ones written after it was
|
|
208
|
+
/// made. A restricted key holds the derived keys it was granted and
|
|
209
|
+
/// nothing that produces another.</para>
|
|
210
|
+
/// </summary>
|
|
211
|
+
internal static byte[] SecretKey(byte[] root, string name)
|
|
212
|
+
{
|
|
213
|
+
return Hmac(root, AadSecret + name);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/// <summary>
|
|
217
|
+
/// Where a secret lives in the file, derived from its own key so that
|
|
218
|
+
/// finding it needs no plaintext name.
|
|
219
|
+
/// </summary>
|
|
220
|
+
internal static byte[] EntryId(byte[] key)
|
|
221
|
+
{
|
|
222
|
+
return Hmac(key, LabelId);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
internal static byte[] Random(int len)
|
|
226
|
+
{
|
|
227
|
+
return RandomNumberGenerator.GetBytes(len);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// --- sealing ------------------------------------------------------
|
|
231
|
+
|
|
232
|
+
/// <summary>A nonce and the ciphertext with its tag appended.</summary>
|
|
233
|
+
internal sealed class Sealed
|
|
234
|
+
{
|
|
235
|
+
internal byte[] Iv;
|
|
236
|
+
internal byte[] Blob;
|
|
237
|
+
|
|
238
|
+
internal Sealed(byte[] iv, byte[] blob)
|
|
239
|
+
{
|
|
240
|
+
Iv = iv;
|
|
241
|
+
Blob = blob;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
internal static Sealed Seal(byte[] key, byte[] plain, string aad)
|
|
246
|
+
{
|
|
247
|
+
var iv = Random(IvLen);
|
|
248
|
+
var body = new byte[plain.Length];
|
|
249
|
+
var tag = new byte[TagLen];
|
|
250
|
+
|
|
251
|
+
using (var gcm = new AesGcm(key, TagLen))
|
|
252
|
+
{
|
|
253
|
+
gcm.Encrypt(iv, plain, body, tag, Utf8(aad));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
var blob = new byte[body.Length + TagLen];
|
|
257
|
+
Buffer.BlockCopy(body, 0, blob, 0, body.Length);
|
|
258
|
+
Buffer.BlockCopy(tag, 0, blob, body.Length, TagLen);
|
|
259
|
+
|
|
260
|
+
return new Sealed(iv, blob);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/// <summary>
|
|
264
|
+
/// The plaintext, or a refusal. A GCM tag that fails to verify is the
|
|
265
|
+
/// only evidence there is, and it cannot tell a wrong passphrase from
|
|
266
|
+
/// a damaged file, so `what` names the attempt and the message admits
|
|
267
|
+
/// both.
|
|
268
|
+
/// </summary>
|
|
269
|
+
internal static byte[] Unseal(byte[] key, Sealed sealedvalue, string aad, string what)
|
|
270
|
+
{
|
|
271
|
+
if (sealedvalue.Blob.Length < TagLen || IvLen != sealedvalue.Iv.Length)
|
|
272
|
+
{
|
|
273
|
+
throw Fail(what + ": truncated");
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
var bodylen = sealedvalue.Blob.Length - TagLen;
|
|
277
|
+
var body = new byte[bodylen];
|
|
278
|
+
var tag = new byte[TagLen];
|
|
279
|
+
Buffer.BlockCopy(sealedvalue.Blob, 0, body, 0, bodylen);
|
|
280
|
+
Buffer.BlockCopy(sealedvalue.Blob, bodylen, tag, 0, TagLen);
|
|
281
|
+
|
|
282
|
+
var plain = new byte[bodylen];
|
|
283
|
+
|
|
284
|
+
// The WHOLE round-trip is guarded, not only the tag check: a key
|
|
285
|
+
// of the wrong length makes the constructor itself raise, and a
|
|
286
|
+
// damaged file reaching a caller as a raw ArgumentException is a
|
|
287
|
+
// refusal nobody can act on.
|
|
288
|
+
try
|
|
289
|
+
{
|
|
290
|
+
using (var gcm = new AesGcm(key, TagLen))
|
|
291
|
+
{
|
|
292
|
+
gcm.Decrypt(sealedvalue.Iv, body, tag, plain, Utf8(aad));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
catch (Exception err) when (err is CryptographicException || err is ArgumentException)
|
|
296
|
+
{
|
|
297
|
+
throw Fail(what);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return plain;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
internal static Dictionary<string, object> JsonOf(byte[] plain, string what)
|
|
304
|
+
{
|
|
305
|
+
object parsed;
|
|
306
|
+
|
|
307
|
+
if (!Json.TryParse(Encoding.UTF8.GetString(plain), out parsed))
|
|
308
|
+
{
|
|
309
|
+
throw Fail("unreadable " + what);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
var map = parsed as Dictionary<string, object>;
|
|
313
|
+
|
|
314
|
+
if (null == map)
|
|
315
|
+
{
|
|
316
|
+
throw Fail("unreadable " + what);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return map;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
internal static string B64(byte[] bytes)
|
|
323
|
+
{
|
|
324
|
+
return Convert.ToBase64String(bytes);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
internal static byte[] UnB64(object text, string what)
|
|
328
|
+
{
|
|
329
|
+
var encoded = text as string;
|
|
330
|
+
|
|
331
|
+
if (null == encoded)
|
|
332
|
+
{
|
|
333
|
+
throw Fail("missing " + what);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
try
|
|
337
|
+
{
|
|
338
|
+
return Convert.FromBase64String(encoded);
|
|
339
|
+
}
|
|
340
|
+
catch (FormatException)
|
|
341
|
+
{
|
|
342
|
+
throw Fail("missing " + what);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// --- the file -----------------------------------------------------
|
|
347
|
+
|
|
348
|
+
internal sealed class KeyRecord
|
|
349
|
+
{
|
|
350
|
+
internal string Id;
|
|
351
|
+
internal byte[] Salt;
|
|
352
|
+
internal int Iters;
|
|
353
|
+
internal Sealed Ring;
|
|
354
|
+
internal Sealed Meta;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
internal sealed class EntryRecord
|
|
358
|
+
{
|
|
359
|
+
internal byte[] Id;
|
|
360
|
+
internal Sealed Name;
|
|
361
|
+
internal Sealed Value;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
internal sealed class VaultFile
|
|
365
|
+
{
|
|
366
|
+
internal readonly List<KeyRecord> Keys = new List<KeyRecord>();
|
|
367
|
+
internal readonly List<EntryRecord> Entries = new List<EntryRecord>();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/// <summary>
|
|
371
|
+
/// A cursor, so that every length check is in one place: a truncated
|
|
372
|
+
/// vault is refused rather than read as a short one.
|
|
373
|
+
/// </summary>
|
|
374
|
+
internal sealed class Reader
|
|
375
|
+
{
|
|
376
|
+
private readonly byte[] bytes;
|
|
377
|
+
private int at;
|
|
378
|
+
|
|
379
|
+
internal Reader(byte[] bytes)
|
|
380
|
+
{
|
|
381
|
+
this.bytes = bytes;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
internal byte[] Take(int len)
|
|
385
|
+
{
|
|
386
|
+
if (len < 0 || bytes.Length < at + len)
|
|
387
|
+
{
|
|
388
|
+
throw Fail("the vault file is truncated");
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
var out_ = new byte[len];
|
|
392
|
+
Buffer.BlockCopy(bytes, at, out_, 0, len);
|
|
393
|
+
at += len;
|
|
394
|
+
return out_;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
internal int U8()
|
|
398
|
+
{
|
|
399
|
+
return Take(1)[0];
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
internal int U32()
|
|
403
|
+
{
|
|
404
|
+
var four = Take(4);
|
|
405
|
+
// A length over int.MaxValue cannot address an array, and
|
|
406
|
+
// reading it as a negative int is what turned a damaged file
|
|
407
|
+
// into a crash instead of a refusal.
|
|
408
|
+
var value = ((uint)four[0] << 24) | ((uint)four[1] << 16)
|
|
409
|
+
| ((uint)four[2] << 8) | four[3];
|
|
410
|
+
|
|
411
|
+
if (value > int.MaxValue)
|
|
412
|
+
{
|
|
413
|
+
throw Fail("the vault file is truncated");
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return (int)value;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
internal byte[] Small()
|
|
420
|
+
{
|
|
421
|
+
return Take(U8());
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
internal byte[] Large()
|
|
425
|
+
{
|
|
426
|
+
return Take(U32());
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
internal string MagicWord()
|
|
430
|
+
{
|
|
431
|
+
return Encoding.Latin1.GetString(Take(4));
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
internal Sealed SealedValue()
|
|
435
|
+
{
|
|
436
|
+
return new Sealed(Small(), Large());
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
internal bool Done()
|
|
440
|
+
{
|
|
441
|
+
return at == bytes.Length;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
internal static VaultFile ReadFile(byte[] bytes)
|
|
446
|
+
{
|
|
447
|
+
var read = new Reader(bytes);
|
|
448
|
+
|
|
449
|
+
if (Magic != read.MagicWord())
|
|
450
|
+
{
|
|
451
|
+
throw Fail("not a vault file");
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
var version = read.U8();
|
|
455
|
+
if (Format != version)
|
|
456
|
+
{
|
|
457
|
+
throw Fail("unsupported format version: " + version);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
var kdf = read.U8();
|
|
461
|
+
var cipher = read.U8();
|
|
462
|
+
if (KdfPbkdf2 != kdf || CipherAesGcm != cipher)
|
|
463
|
+
{
|
|
464
|
+
throw Fail("unsupported kdf or cipher: " + kdf + "/" + cipher);
|
|
465
|
+
}
|
|
466
|
+
read.U8();
|
|
467
|
+
|
|
468
|
+
var vault = new VaultFile();
|
|
469
|
+
|
|
470
|
+
var keycount = read.U32();
|
|
471
|
+
for (var index = 0; index < keycount; index++)
|
|
472
|
+
{
|
|
473
|
+
vault.Keys.Add(new KeyRecord
|
|
474
|
+
{
|
|
475
|
+
Id = Encoding.UTF8.GetString(read.Small()),
|
|
476
|
+
Salt = read.Small(),
|
|
477
|
+
Iters = read.U32(),
|
|
478
|
+
Ring = read.SealedValue(),
|
|
479
|
+
Meta = read.SealedValue(),
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var entrycount = read.U32();
|
|
484
|
+
for (var index = 0; index < entrycount; index++)
|
|
485
|
+
{
|
|
486
|
+
vault.Entries.Add(new EntryRecord
|
|
487
|
+
{
|
|
488
|
+
Id = read.Small(),
|
|
489
|
+
Name = read.SealedValue(),
|
|
490
|
+
Value = read.SealedValue(),
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
if (!read.Done())
|
|
495
|
+
{
|
|
496
|
+
throw Fail("the vault file has trailing bytes");
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return vault;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
internal static byte[] WriteFile(VaultFile vault)
|
|
503
|
+
{
|
|
504
|
+
var out_ = new MemoryStream();
|
|
505
|
+
|
|
506
|
+
Action<byte[]> raw = bytes => out_.Write(bytes, 0, bytes.Length);
|
|
507
|
+
Action<int> u8 = value => out_.WriteByte((byte)value);
|
|
508
|
+
Action<int> u32 = value => raw(new[]
|
|
509
|
+
{
|
|
510
|
+
(byte)((value >> 24) & 0xff), (byte)((value >> 16) & 0xff),
|
|
511
|
+
(byte)((value >> 8) & 0xff), (byte)(value & 0xff),
|
|
512
|
+
});
|
|
513
|
+
Action<byte[]> small = bytes => { u8(bytes.Length); raw(bytes); };
|
|
514
|
+
Action<byte[]> large = bytes => { u32(bytes.Length); raw(bytes); };
|
|
515
|
+
Action<Sealed> sealedvalue = value => { small(value.Iv); large(value.Blob); };
|
|
516
|
+
|
|
517
|
+
raw(Encoding.Latin1.GetBytes(Magic));
|
|
518
|
+
u8(Format);
|
|
519
|
+
u8(KdfPbkdf2);
|
|
520
|
+
u8(CipherAesGcm);
|
|
521
|
+
u8(0);
|
|
522
|
+
|
|
523
|
+
u32(vault.Keys.Count);
|
|
524
|
+
foreach (var key in vault.Keys)
|
|
525
|
+
{
|
|
526
|
+
small(Utf8(key.Id));
|
|
527
|
+
small(key.Salt);
|
|
528
|
+
u32(key.Iters);
|
|
529
|
+
sealedvalue(key.Ring);
|
|
530
|
+
sealedvalue(key.Meta);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// SORTED BY ID, which is a blinded value: the file therefore
|
|
534
|
+
// records nothing about the order secrets were written in.
|
|
535
|
+
var entries = new List<EntryRecord>(vault.Entries);
|
|
536
|
+
entries.Sort((left, right) => Compare(left.Id, right.Id));
|
|
537
|
+
|
|
538
|
+
u32(entries.Count);
|
|
539
|
+
foreach (var entry in entries)
|
|
540
|
+
{
|
|
541
|
+
small(entry.Id);
|
|
542
|
+
sealedvalue(entry.Name);
|
|
543
|
+
sealedvalue(entry.Value);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
return out_.ToArray();
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/// <summary>Unsigned, byte by byte, the way every other port sorts.</summary>
|
|
550
|
+
internal static int Compare(byte[] left, byte[] right)
|
|
551
|
+
{
|
|
552
|
+
var len = Math.Min(left.Length, right.Length);
|
|
553
|
+
|
|
554
|
+
for (var index = 0; index < len; index++)
|
|
555
|
+
{
|
|
556
|
+
if (left[index] != right[index])
|
|
557
|
+
{
|
|
558
|
+
return left[index] < right[index] ? -1 : 1;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
return left.Length.CompareTo(right.Length);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
internal static bool Same(byte[] left, byte[] right)
|
|
566
|
+
{
|
|
567
|
+
return null != left && null != right && 0 == Compare(left, right);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
internal static bool SameSeal(Sealed left, Sealed right)
|
|
571
|
+
{
|
|
572
|
+
return Same(left.Iv, right.Iv) && Same(left.Blob, right.Blob);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// --- what a key is -------------------------------------------------
|
|
576
|
+
|
|
577
|
+
/// <summary>
|
|
578
|
+
/// What a key may do. `Grants` is empty for a master key.
|
|
579
|
+
///
|
|
580
|
+
/// <para>Read-only, so what a caller is handed cannot become what the
|
|
581
|
+
/// vault believes: `vault.Open().Write = true` does not compile.</para>
|
|
582
|
+
/// </summary>
|
|
583
|
+
public sealed class KeyInfo
|
|
584
|
+
{
|
|
585
|
+
public string Key { get; }
|
|
586
|
+
|
|
587
|
+
public bool Master { get; }
|
|
588
|
+
|
|
589
|
+
public bool Write { get; }
|
|
590
|
+
|
|
591
|
+
public IReadOnlyList<string> Grants { get; }
|
|
592
|
+
|
|
593
|
+
internal KeyInfo(string key, bool master, bool write, List<string> grants)
|
|
594
|
+
{
|
|
595
|
+
Key = key;
|
|
596
|
+
Master = master;
|
|
597
|
+
Write = write;
|
|
598
|
+
Grants = grants.AsReadOnly();
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
public override string ToString()
|
|
602
|
+
{
|
|
603
|
+
return Key + "/" + (Master ? "true" : "false") + "/"
|
|
604
|
+
+ (Write ? "true" : "false") + "/[" + string.Join(", ", Grants) + "]";
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/// <summary>What a caller asks for when minting a restricted key.</summary>
|
|
609
|
+
public sealed class Grant
|
|
610
|
+
{
|
|
611
|
+
public string Key { get; set; }
|
|
612
|
+
|
|
613
|
+
public string Passphrase { get; set; }
|
|
614
|
+
|
|
615
|
+
public List<string> Names { get; set; } = new List<string>();
|
|
616
|
+
|
|
617
|
+
public bool Write { get; set; }
|
|
618
|
+
|
|
619
|
+
public int? Iterations { get; set; }
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/// <summary>How a vault handle is configured.</summary>
|
|
623
|
+
public sealed class Options
|
|
624
|
+
{
|
|
625
|
+
public string File { get; set; }
|
|
626
|
+
|
|
627
|
+
public string Key { get; set; } = MasterKey;
|
|
628
|
+
|
|
629
|
+
public string Passphrase { get; set; }
|
|
630
|
+
|
|
631
|
+
public int Iterations { get; set; } = MiniVault.Iterations;
|
|
632
|
+
|
|
633
|
+
public bool Create { get; set; }
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
internal sealed class Opened
|
|
637
|
+
{
|
|
638
|
+
internal KeyInfo Info;
|
|
639
|
+
internal byte[] Root;
|
|
640
|
+
internal Dictionary<string, byte[]> Grants = new Dictionary<string, byte[]>();
|
|
641
|
+
internal Sealed Ring;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// --- creating ------------------------------------------------------
|
|
645
|
+
|
|
646
|
+
internal static VaultFile NewVault(string keyid, string passphrase, int iterations)
|
|
647
|
+
{
|
|
648
|
+
var root = Random(KeyLen);
|
|
649
|
+
var salt = Random(SaltLen);
|
|
650
|
+
|
|
651
|
+
var ring = new Dictionary<string, object>
|
|
652
|
+
{
|
|
653
|
+
{ "v", (double)Format }, { "write", true }, { "root", B64(root) },
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
var meta = new Dictionary<string, object>
|
|
657
|
+
{
|
|
658
|
+
{ "v", (double)Format }, { "master", true }, { "write", true },
|
|
659
|
+
{ "grants", new List<object>() },
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
var vault = new VaultFile();
|
|
663
|
+
vault.Keys.Add(new KeyRecord
|
|
664
|
+
{
|
|
665
|
+
Id = keyid,
|
|
666
|
+
Salt = salt,
|
|
667
|
+
Iters = iterations,
|
|
668
|
+
Ring = Seal(Kek(passphrase, salt, iterations),
|
|
669
|
+
Utf8(Json.Stringify(ring)), AadRing + keyid),
|
|
670
|
+
Meta = Seal(Hmac(root, LabelMeta),
|
|
671
|
+
Utf8(Json.Stringify(meta)), AadMeta + keyid),
|
|
672
|
+
});
|
|
673
|
+
|
|
674
|
+
return vault;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/// <summary>
|
|
678
|
+
/// Write a vault file that is not there yet, and REFUSE one that is.
|
|
679
|
+
///
|
|
680
|
+
/// <para>Straight to the target with CreateNew rather than through a
|
|
681
|
+
/// temporary and a rename. A rename REPLACES its destination, so two
|
|
682
|
+
/// processes creating the same vault both succeeded and the second
|
|
683
|
+
/// discarded the first one's secrets.</para>
|
|
684
|
+
/// </summary>
|
|
685
|
+
internal static void PutNew(string file, VaultFile vault)
|
|
686
|
+
{
|
|
687
|
+
try
|
|
688
|
+
{
|
|
689
|
+
using (var handle = new FileStream(file, FileMode.CreateNew, FileAccess.Write))
|
|
690
|
+
{
|
|
691
|
+
var bytes = WriteFile(vault);
|
|
692
|
+
handle.Write(bytes, 0, bytes.Length);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
OwnerOnly(file);
|
|
696
|
+
}
|
|
697
|
+
catch (IOException err) when (File.Exists(file))
|
|
698
|
+
{
|
|
699
|
+
throw Fail("vault file already exists: " + file);
|
|
700
|
+
}
|
|
701
|
+
catch (Exception err) when (err is IOException || err is UnauthorizedAccessException)
|
|
702
|
+
{
|
|
703
|
+
throw Fail("cannot write " + file + ": " + err.Message);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
internal static void OwnerOnly(string file)
|
|
708
|
+
{
|
|
709
|
+
try
|
|
710
|
+
{
|
|
711
|
+
if (!OperatingSystem.IsWindows())
|
|
712
|
+
{
|
|
713
|
+
File.SetUnixFileMode(file, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
catch (Exception err) when (err is IOException || err is PlatformNotSupportedException)
|
|
717
|
+
{
|
|
718
|
+
// A filesystem with no POSIX permissions is not a reason to
|
|
719
|
+
// refuse a write that otherwise succeeded.
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/// <summary>
|
|
724
|
+
/// A handle on one vault file, opened as ONE key.
|
|
725
|
+
///
|
|
726
|
+
/// <para>Every method answers as that key: `List` shows the names it
|
|
727
|
+
/// may read, `Get` answers for those and misses on the rest, and the
|
|
728
|
+
/// master-only methods refuse for any other key. Nothing is read or
|
|
729
|
+
/// derived until the first call that needs the file.</para>
|
|
730
|
+
/// </summary>
|
|
731
|
+
public sealed class Vault
|
|
732
|
+
{
|
|
733
|
+
private readonly string file;
|
|
734
|
+
private readonly string keyid;
|
|
735
|
+
private readonly string passphrase;
|
|
736
|
+
private readonly int iterations;
|
|
737
|
+
private readonly bool create;
|
|
738
|
+
|
|
739
|
+
private Opened opened;
|
|
740
|
+
|
|
741
|
+
internal Vault(Options options)
|
|
742
|
+
{
|
|
743
|
+
var opts = options ?? new Options();
|
|
744
|
+
|
|
745
|
+
if (string.IsNullOrEmpty(opts.File))
|
|
746
|
+
{
|
|
747
|
+
throw Fail("a vault needs a file");
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
if (string.IsNullOrEmpty(opts.Passphrase))
|
|
751
|
+
{
|
|
752
|
+
throw Fail("a vault needs a passphrase");
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
file = opts.File;
|
|
756
|
+
passphrase = opts.Passphrase;
|
|
757
|
+
keyid = CheckId(WantKey(opts.Key), "a vault needs a key id");
|
|
758
|
+
iterations = opts.Iterations;
|
|
759
|
+
create = opts.Create;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/// <summary>The file this handle reads.</summary>
|
|
763
|
+
public string File()
|
|
764
|
+
{
|
|
765
|
+
return file;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/// <summary>The key id this handle opens with.</summary>
|
|
769
|
+
public string Key()
|
|
770
|
+
{
|
|
771
|
+
return keyid;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/// <summary>Derive the key and read the file NOW rather than at first use.</summary>
|
|
775
|
+
public KeyInfo Open()
|
|
776
|
+
{
|
|
777
|
+
VaultFile vault;
|
|
778
|
+
return Load(out vault).Info;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/// <summary>Forget the derived keys. The next call opens again.</summary>
|
|
782
|
+
public void Close()
|
|
783
|
+
{
|
|
784
|
+
opened = null;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/// <summary>The names this key can read, sorted.</summary>
|
|
788
|
+
public List<string> List()
|
|
789
|
+
{
|
|
790
|
+
VaultFile vault;
|
|
791
|
+
var open = Load(out vault);
|
|
792
|
+
|
|
793
|
+
var out_ = new List<string>();
|
|
794
|
+
|
|
795
|
+
if (null != open.Root)
|
|
796
|
+
{
|
|
797
|
+
var namekey = Hmac(open.Root, LabelNames);
|
|
798
|
+
|
|
799
|
+
foreach (var entry in vault.Entries)
|
|
800
|
+
{
|
|
801
|
+
out_.Add(Encoding.UTF8.GetString(
|
|
802
|
+
Unseal(namekey, entry.Name, AadName, "a secret name is damaged")));
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
out_.Sort(StringComparer.Ordinal);
|
|
806
|
+
return out_;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
// A restricted key has no name key, so it reports the grants
|
|
810
|
+
// it can actually find: the vault never tells it what else is
|
|
811
|
+
// in there.
|
|
812
|
+
foreach (var name in open.Info.Grants)
|
|
813
|
+
{
|
|
814
|
+
if (null != FindEntry(vault, open.Grants[name]))
|
|
815
|
+
{
|
|
816
|
+
out_.Add(name);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
out_.Sort(StringComparer.Ordinal);
|
|
821
|
+
return out_;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
public bool Has(string name)
|
|
825
|
+
{
|
|
826
|
+
return null != Get(name);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/// <summary>
|
|
830
|
+
/// The value, or null when the vault does not hold that name or
|
|
831
|
+
/// this key was not granted it.
|
|
832
|
+
/// </summary>
|
|
833
|
+
public string Get(string name)
|
|
834
|
+
{
|
|
835
|
+
Names.CheckName(name);
|
|
836
|
+
|
|
837
|
+
VaultFile vault;
|
|
838
|
+
var open = Load(out vault);
|
|
839
|
+
|
|
840
|
+
var key = KeyFor(open, name);
|
|
841
|
+
|
|
842
|
+
if (null == key)
|
|
843
|
+
{
|
|
844
|
+
// OUTSIDE THE GRANT IS A MISS, deliberately. The vault
|
|
845
|
+
// answers as the key that opened it, so a name this key
|
|
846
|
+
// cannot read is a name this store does not hold for this
|
|
847
|
+
// caller.
|
|
848
|
+
return null;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
var entry = FindEntry(vault, key);
|
|
852
|
+
|
|
853
|
+
if (null == entry)
|
|
854
|
+
{
|
|
855
|
+
return null;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
return Encoding.UTF8.GetString(Unseal(
|
|
859
|
+
key, entry.Value, AadSecret + name, "the value of " + name + " is damaged"));
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/// <summary>
|
|
863
|
+
/// Write a value. A master writes any name; a restricted key
|
|
864
|
+
/// holding `write` overwrites the names it was granted, and
|
|
865
|
+
/// creates none.
|
|
866
|
+
/// </summary>
|
|
867
|
+
public void Set(string name, string value)
|
|
868
|
+
{
|
|
869
|
+
// Every write on this file, from any handle in this process,
|
|
870
|
+
// serializes here; see LockFor.
|
|
871
|
+
lock (LockFor(file))
|
|
872
|
+
{
|
|
873
|
+
Names.CheckName(name);
|
|
874
|
+
|
|
875
|
+
if (null == value)
|
|
876
|
+
{
|
|
877
|
+
throw Fail("a secret value must be text: " + name);
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
VaultFile vault;
|
|
881
|
+
var open = Load(out vault);
|
|
882
|
+
|
|
883
|
+
if (!open.Info.Write)
|
|
884
|
+
{
|
|
885
|
+
throw Fail("key " + open.Info.Key + " is read-only");
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
var key = KeyFor(open, name);
|
|
889
|
+
|
|
890
|
+
if (null == key)
|
|
891
|
+
{
|
|
892
|
+
throw Fail("key " + open.Info.Key + " was not granted " + name);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
var sealedvalue = Seal(key, Utf8(value), AadSecret + name);
|
|
896
|
+
var found = FindEntry(vault, key);
|
|
897
|
+
|
|
898
|
+
if (null != found)
|
|
899
|
+
{
|
|
900
|
+
found.Value = sealedvalue;
|
|
901
|
+
}
|
|
902
|
+
else
|
|
903
|
+
{
|
|
904
|
+
// A NEW NAME NEEDS THE NAME KEY, which only a master
|
|
905
|
+
// holds. So a restricted key with `write` updates what it
|
|
906
|
+
// was granted and cannot grow the vault.
|
|
907
|
+
var root = RootOf(open, "creating the secret " + name);
|
|
908
|
+
|
|
909
|
+
vault.Entries.Add(new EntryRecord
|
|
910
|
+
{
|
|
911
|
+
Id = EntryId(key),
|
|
912
|
+
Name = Seal(Hmac(root, LabelNames), Utf8(name), AadName),
|
|
913
|
+
Value = sealedvalue,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
Save(vault);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
/// <summary>Drop a name. Master only.</summary>
|
|
922
|
+
public void Remove(string name)
|
|
923
|
+
{
|
|
924
|
+
// Every write on this file, from any handle in this process,
|
|
925
|
+
// serializes here; see LockFor.
|
|
926
|
+
lock (LockFor(file))
|
|
927
|
+
{
|
|
928
|
+
Names.CheckName(name);
|
|
929
|
+
|
|
930
|
+
VaultFile vault;
|
|
931
|
+
var open = Load(out vault);
|
|
932
|
+
var root = RootOf(open, "removing a secret");
|
|
933
|
+
|
|
934
|
+
var wanted = EntryId(SecretKey(root, name));
|
|
935
|
+
var found = vault.Entries.FirstOrDefault(entry => Same(entry.Id, wanted));
|
|
936
|
+
|
|
937
|
+
if (null == found)
|
|
938
|
+
{
|
|
939
|
+
throw Fail("no such secret: " + name);
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
vault.Entries.Remove(found);
|
|
943
|
+
Save(vault);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
/// <summary>Every key in the file, with what it may do. Master only.</summary>
|
|
948
|
+
public List<KeyInfo> Keys()
|
|
949
|
+
{
|
|
950
|
+
VaultFile vault;
|
|
951
|
+
var open = Load(out vault);
|
|
952
|
+
RootOf(open, "listing the keys");
|
|
953
|
+
|
|
954
|
+
var out_ = new List<KeyInfo>();
|
|
955
|
+
|
|
956
|
+
foreach (var record in vault.Keys)
|
|
957
|
+
{
|
|
958
|
+
var meta = MetaOf(open, record);
|
|
959
|
+
|
|
960
|
+
if (null == meta)
|
|
961
|
+
{
|
|
962
|
+
out_.Add(new KeyInfo(record.Id, false, false, new List<string>()));
|
|
963
|
+
continue;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
var grants = new List<string>();
|
|
967
|
+
var raw = meta.TryGetValue("grants", out var value) ? value : null;
|
|
968
|
+
|
|
969
|
+
if (raw is List<object> names)
|
|
970
|
+
{
|
|
971
|
+
foreach (var name in names)
|
|
972
|
+
{
|
|
973
|
+
grants.Add(Convert.ToString(name));
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
grants.Sort(StringComparer.Ordinal);
|
|
978
|
+
|
|
979
|
+
out_.Add(new KeyInfo(
|
|
980
|
+
record.Id, True(meta, "master"), True(meta, "write"), grants));
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
return out_;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/// <summary>Mint a restricted key. Master only.</summary>
|
|
987
|
+
public void Grant(Grant spec)
|
|
988
|
+
{
|
|
989
|
+
// Every write on this file, from any handle in this process,
|
|
990
|
+
// serializes here; see LockFor.
|
|
991
|
+
lock (LockFor(file))
|
|
992
|
+
{
|
|
993
|
+
VaultFile vault;
|
|
994
|
+
var open = Load(out vault);
|
|
995
|
+
var root = RootOf(open, "granting a key");
|
|
996
|
+
|
|
997
|
+
var want = spec ?? new Grant();
|
|
998
|
+
var id = CheckId(want.Key, "a grant needs a key id");
|
|
999
|
+
|
|
1000
|
+
if (string.IsNullOrEmpty(want.Passphrase))
|
|
1001
|
+
{
|
|
1002
|
+
throw Fail("a grant needs a passphrase");
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
if (vault.Keys.Any(record => record.Id == id))
|
|
1006
|
+
{
|
|
1007
|
+
throw Fail("key already exists: " + id);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
var names = new List<string>(want.Names ?? new List<string>());
|
|
1011
|
+
names.Sort(StringComparer.Ordinal);
|
|
1012
|
+
|
|
1013
|
+
// A SortedDictionary, for a ring whose JSON is the same
|
|
1014
|
+
// text on every run. It is NOT an interop requirement -
|
|
1015
|
+
// the ring is sealed under a fresh nonce, so its
|
|
1016
|
+
// ciphertext differs per write whatever the key order is,
|
|
1017
|
+
// and a reader parses it back into a map. It is so that
|
|
1018
|
+
// two runs of this port over the same grant produce the
|
|
1019
|
+
// same plaintext.
|
|
1020
|
+
var grants = new SortedDictionary<string, object>(StringComparer.Ordinal);
|
|
1021
|
+
|
|
1022
|
+
foreach (var name in names)
|
|
1023
|
+
{
|
|
1024
|
+
Names.CheckName(name);
|
|
1025
|
+
grants[name] = B64(SecretKey(root, name));
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
var ring = new Dictionary<string, object>
|
|
1029
|
+
{
|
|
1030
|
+
{ "v", (double)Format }, { "write", want.Write },
|
|
1031
|
+
{ "grants", new Dictionary<string, object>(grants) },
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
var meta = new Dictionary<string, object>
|
|
1035
|
+
{
|
|
1036
|
+
{ "v", (double)Format }, { "master", false }, { "write", want.Write },
|
|
1037
|
+
{ "grants", names.Cast<object>().ToList() },
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
vault.Keys.Add(SealKey(root, id, want.Passphrase,
|
|
1041
|
+
want.Iterations ?? iterations, ring, meta));
|
|
1042
|
+
|
|
1043
|
+
Save(vault);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
/// <summary>
|
|
1048
|
+
/// Drop a key. Master only.
|
|
1049
|
+
///
|
|
1050
|
+
/// <para>Anyone who already copied the file keeps whatever that
|
|
1051
|
+
/// key could read, so revoking bars future reads of the LIVE file
|
|
1052
|
+
/// and `Rotate` is what takes a secret back.</para>
|
|
1053
|
+
/// </summary>
|
|
1054
|
+
public void Revoke(string key)
|
|
1055
|
+
{
|
|
1056
|
+
// Every write on this file, from any handle in this process,
|
|
1057
|
+
// serializes here; see LockFor.
|
|
1058
|
+
lock (LockFor(file))
|
|
1059
|
+
{
|
|
1060
|
+
VaultFile vault;
|
|
1061
|
+
var open = Load(out vault);
|
|
1062
|
+
RootOf(open, "revoking a key");
|
|
1063
|
+
|
|
1064
|
+
if (key == open.Info.Key)
|
|
1065
|
+
{
|
|
1066
|
+
throw Fail("a key cannot revoke itself: " + key);
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
var found = vault.Keys.FirstOrDefault(record => record.Id == key);
|
|
1070
|
+
|
|
1071
|
+
if (null == found)
|
|
1072
|
+
{
|
|
1073
|
+
throw Fail("no such key: " + key);
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
vault.Keys.Remove(found);
|
|
1077
|
+
Save(vault);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/// <summary>
|
|
1082
|
+
/// A new root key, every value re-encrypted under it, and EVERY
|
|
1083
|
+
/// OTHER KEY DROPPED. Master only.
|
|
1084
|
+
///
|
|
1085
|
+
/// <para>The other keys go because they must: their rings are
|
|
1086
|
+
/// sealed under passphrases this process does not have. Re-grant
|
|
1087
|
+
/// afterwards.</para>
|
|
1088
|
+
/// </summary>
|
|
1089
|
+
public void Rotate()
|
|
1090
|
+
{
|
|
1091
|
+
// Every write on this file, from any handle in this process,
|
|
1092
|
+
// serializes here; see LockFor.
|
|
1093
|
+
lock (LockFor(file))
|
|
1094
|
+
{
|
|
1095
|
+
VaultFile vault;
|
|
1096
|
+
var open = Load(out vault);
|
|
1097
|
+
RootOf(open, "rotating the vault");
|
|
1098
|
+
|
|
1099
|
+
// Read everything out under the old root before anything
|
|
1100
|
+
// changes: once the root is replaced the old derived keys are
|
|
1101
|
+
// unreachable.
|
|
1102
|
+
var plain = new List<KeyValuePair<string, string>>();
|
|
1103
|
+
|
|
1104
|
+
foreach (var name in List())
|
|
1105
|
+
{
|
|
1106
|
+
plain.Add(new KeyValuePair<string, string>(name, Get(name)));
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
var root = Random(KeyLen);
|
|
1110
|
+
var namekey = Hmac(root, LabelNames);
|
|
1111
|
+
|
|
1112
|
+
var fresh = new VaultFile();
|
|
1113
|
+
|
|
1114
|
+
foreach (var secret in plain)
|
|
1115
|
+
{
|
|
1116
|
+
var key = SecretKey(root, secret.Key);
|
|
1117
|
+
|
|
1118
|
+
fresh.Entries.Add(new EntryRecord
|
|
1119
|
+
{
|
|
1120
|
+
Id = EntryId(key),
|
|
1121
|
+
Name = Seal(namekey, Utf8(secret.Key), AadName),
|
|
1122
|
+
Value = Seal(key, Utf8(secret.Value), AadSecret + secret.Key),
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
var iters = iterations;
|
|
1127
|
+
|
|
1128
|
+
foreach (var record in vault.Keys)
|
|
1129
|
+
{
|
|
1130
|
+
if (record.Id == keyid)
|
|
1131
|
+
{
|
|
1132
|
+
iters = record.Iters;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
var ring = new Dictionary<string, object>
|
|
1137
|
+
{
|
|
1138
|
+
{ "v", (double)Format }, { "write", true }, { "root", B64(root) },
|
|
1139
|
+
};
|
|
1140
|
+
|
|
1141
|
+
var meta = new Dictionary<string, object>
|
|
1142
|
+
{
|
|
1143
|
+
{ "v", (double)Format }, { "master", true }, { "write", true },
|
|
1144
|
+
{ "grants", new List<object>() },
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
var record2 = SealKey(root, keyid, passphrase, iters, ring, meta);
|
|
1148
|
+
fresh.Keys.Add(record2);
|
|
1149
|
+
|
|
1150
|
+
// SAVE FIRST, adopt second. A handle holding the new root over
|
|
1151
|
+
// a file that still holds the old one reads nothing and says
|
|
1152
|
+
// the vault is damaged.
|
|
1153
|
+
Save(fresh);
|
|
1154
|
+
|
|
1155
|
+
opened = new Opened
|
|
1156
|
+
{
|
|
1157
|
+
Info = new KeyInfo(keyid, true, true, new List<string>()),
|
|
1158
|
+
Root = root,
|
|
1159
|
+
Ring = record2.Ring,
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
// --- the inside -------------------------------------------------
|
|
1165
|
+
|
|
1166
|
+
private static bool True(Dictionary<string, object> map, string key)
|
|
1167
|
+
{
|
|
1168
|
+
return map.TryGetValue(key, out var value) && value is bool flag && flag;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
private byte[] Bytes()
|
|
1172
|
+
{
|
|
1173
|
+
try
|
|
1174
|
+
{
|
|
1175
|
+
return System.IO.File.ReadAllBytes(file);
|
|
1176
|
+
}
|
|
1177
|
+
catch (FileNotFoundException)
|
|
1178
|
+
{
|
|
1179
|
+
return Make();
|
|
1180
|
+
}
|
|
1181
|
+
catch (DirectoryNotFoundException)
|
|
1182
|
+
{
|
|
1183
|
+
return Make();
|
|
1184
|
+
}
|
|
1185
|
+
catch (Exception err) when (err is IOException || err is UnauthorizedAccessException)
|
|
1186
|
+
{
|
|
1187
|
+
throw Fail("cannot read " + file + ": " + err.Message);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
private byte[] Make()
|
|
1192
|
+
{
|
|
1193
|
+
// A vault is configured deliberately, with a key. Its absence
|
|
1194
|
+
// is a broken deployment and never "no secrets here":
|
|
1195
|
+
// answering a miss would send the chain on to a weaker store.
|
|
1196
|
+
if (!create)
|
|
1197
|
+
{
|
|
1198
|
+
throw Fail("no vault file: " + file);
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
PutNew(file, NewVault(keyid, passphrase, iterations));
|
|
1202
|
+
|
|
1203
|
+
try
|
|
1204
|
+
{
|
|
1205
|
+
return System.IO.File.ReadAllBytes(file);
|
|
1206
|
+
}
|
|
1207
|
+
catch (IOException err)
|
|
1208
|
+
{
|
|
1209
|
+
throw Fail("cannot read " + file + ": " + err.Message);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
private Opened Load(out VaultFile vault)
|
|
1214
|
+
{
|
|
1215
|
+
vault = ReadFile(Bytes());
|
|
1216
|
+
|
|
1217
|
+
var record = vault.Keys.FirstOrDefault(key => key.Id == keyid);
|
|
1218
|
+
|
|
1219
|
+
if (null == record)
|
|
1220
|
+
{
|
|
1221
|
+
// REVOKED, or never there. Either way this handle is
|
|
1222
|
+
// finished, and dropping what it derived is what stops the
|
|
1223
|
+
// next call answering from memory.
|
|
1224
|
+
opened = null;
|
|
1225
|
+
throw Fail("no such key: " + keyid);
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
// The file still holds this key, and holds the SAME ring: a
|
|
1229
|
+
// key revoked and re-granted under another passphrase is a
|
|
1230
|
+
// different key wearing the id, and re-deriving is what
|
|
1231
|
+
// refuses it.
|
|
1232
|
+
if (null != opened && SameSeal(opened.Ring, record.Ring))
|
|
1233
|
+
{
|
|
1234
|
+
return opened;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
opened = null;
|
|
1238
|
+
|
|
1239
|
+
var plain = Unseal(
|
|
1240
|
+
Kek(passphrase, record.Salt, record.Iters), record.Ring, AadRing + keyid,
|
|
1241
|
+
"wrong passphrase for key " + keyid + ", or a damaged vault");
|
|
1242
|
+
|
|
1243
|
+
var ring = JsonOf(plain, "key ring for " + keyid);
|
|
1244
|
+
|
|
1245
|
+
var grants = new Dictionary<string, byte[]>();
|
|
1246
|
+
|
|
1247
|
+
if (ring.TryGetValue("grants", out var raw)
|
|
1248
|
+
&& raw is Dictionary<string, object> map)
|
|
1249
|
+
{
|
|
1250
|
+
foreach (var pair in map)
|
|
1251
|
+
{
|
|
1252
|
+
grants[pair.Key] = UnB64(pair.Value, "a granted key");
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
var names = new List<string>(grants.Keys);
|
|
1257
|
+
names.Sort(StringComparer.Ordinal);
|
|
1258
|
+
|
|
1259
|
+
var root = ring.TryGetValue("root", out var rootvalue) ? rootvalue : null;
|
|
1260
|
+
|
|
1261
|
+
opened = new Opened
|
|
1262
|
+
{
|
|
1263
|
+
Info = new KeyInfo(
|
|
1264
|
+
keyid, null != root, null != root || True(ring, "write"), names),
|
|
1265
|
+
Root = null == root ? null : UnB64(root, "the root key"),
|
|
1266
|
+
Grants = grants,
|
|
1267
|
+
Ring = record.Ring,
|
|
1268
|
+
};
|
|
1269
|
+
|
|
1270
|
+
return opened;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
private byte[] RootOf(Opened open, string what)
|
|
1274
|
+
{
|
|
1275
|
+
if (null == open.Root)
|
|
1276
|
+
{
|
|
1277
|
+
throw Fail(what + " needs a master key, and " + open.Info.Key
|
|
1278
|
+
+ " is restricted");
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
return open.Root;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/// <summary>The key for one name, or null when this key cannot reach it.</summary>
|
|
1285
|
+
private byte[] KeyFor(Opened open, string name)
|
|
1286
|
+
{
|
|
1287
|
+
if (null != open.Root)
|
|
1288
|
+
{
|
|
1289
|
+
return SecretKey(open.Root, name);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
return open.Grants.TryGetValue(name, out var key) ? key : null;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
private EntryRecord FindEntry(VaultFile vault, byte[] key)
|
|
1296
|
+
{
|
|
1297
|
+
if (null == key)
|
|
1298
|
+
{
|
|
1299
|
+
return null;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
var id = EntryId(key);
|
|
1303
|
+
return vault.Entries.FirstOrDefault(entry => Same(entry.Id, id));
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
private Dictionary<string, object> MetaOf(Opened open, KeyRecord record)
|
|
1307
|
+
{
|
|
1308
|
+
var root = RootOf(open, "reading key metadata");
|
|
1309
|
+
var what = "metadata for key " + record.Id;
|
|
1310
|
+
|
|
1311
|
+
try
|
|
1312
|
+
{
|
|
1313
|
+
return JsonOf(
|
|
1314
|
+
Unseal(Hmac(root, LabelMeta), record.Meta, AadMeta + record.Id, what),
|
|
1315
|
+
what);
|
|
1316
|
+
}
|
|
1317
|
+
catch (SekretoError)
|
|
1318
|
+
{
|
|
1319
|
+
// A record written under a root key this one has replaced.
|
|
1320
|
+
// The key is still in the file and still opens with its
|
|
1321
|
+
// own passphrase, so it is reported rather than hidden -
|
|
1322
|
+
// with what it can do unknown.
|
|
1323
|
+
return null;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
private KeyRecord SealKey(byte[] root, string id, string phrase, int iters,
|
|
1328
|
+
Dictionary<string, object> ring, Dictionary<string, object> meta)
|
|
1329
|
+
{
|
|
1330
|
+
var salt = Random(SaltLen);
|
|
1331
|
+
|
|
1332
|
+
return new KeyRecord
|
|
1333
|
+
{
|
|
1334
|
+
Id = id,
|
|
1335
|
+
Salt = salt,
|
|
1336
|
+
Iters = iters,
|
|
1337
|
+
Ring = Seal(Kek(phrase, salt, iters), Utf8(Json.Stringify(ring)),
|
|
1338
|
+
AadRing + id),
|
|
1339
|
+
Meta = Seal(Hmac(root, LabelMeta), Utf8(Json.Stringify(meta)),
|
|
1340
|
+
AadMeta + id),
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
/// <summary>
|
|
1345
|
+
/// Read, change, and REPLACE - never edit in place.
|
|
1346
|
+
///
|
|
1347
|
+
/// <para>THE TEMPORARY IS RANDOM AND EXCLUSIVE. `<vault>.<pid>.tmp` is a
|
|
1348
|
+
/// name anyone can predict, so anyone who can write the vault's
|
|
1349
|
+
/// directory could put a symlink there and have the next save
|
|
1350
|
+
/// truncate whatever it pointed at.</para>
|
|
1351
|
+
/// </summary>
|
|
1352
|
+
private void Save(VaultFile vault)
|
|
1353
|
+
{
|
|
1354
|
+
var temp = file + "." + Convert.ToHexString(Random(8)).ToLowerInvariant() + ".tmp";
|
|
1355
|
+
|
|
1356
|
+
try
|
|
1357
|
+
{
|
|
1358
|
+
using (var handle = new FileStream(temp, FileMode.CreateNew, FileAccess.Write))
|
|
1359
|
+
{
|
|
1360
|
+
var bytes = WriteFile(vault);
|
|
1361
|
+
handle.Write(bytes, 0, bytes.Length);
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
OwnerOnly(temp);
|
|
1365
|
+
System.IO.File.Move(temp, file, true);
|
|
1366
|
+
}
|
|
1367
|
+
catch (Exception err) when (err is IOException || err is UnauthorizedAccessException)
|
|
1368
|
+
{
|
|
1369
|
+
try
|
|
1370
|
+
{
|
|
1371
|
+
System.IO.File.Delete(temp);
|
|
1372
|
+
}
|
|
1373
|
+
catch (IOException)
|
|
1374
|
+
{
|
|
1375
|
+
// The vault is unchanged either way, and the write
|
|
1376
|
+
// error is what the caller needs to be told about.
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
throw Fail("cannot write " + file + ": " + err.Message);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/// <summary>
|
|
1385
|
+
/// Open a vault file as one key.
|
|
1386
|
+
///
|
|
1387
|
+
/// <para>The handle is lazy. Nothing is read, and no passphrase is
|
|
1388
|
+
/// stretched, until a method needs the file.</para>
|
|
1389
|
+
/// </summary>
|
|
1390
|
+
public static Vault OpenVault(Options options)
|
|
1391
|
+
{
|
|
1392
|
+
return new Vault(options);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
/// <summary>
|
|
1396
|
+
/// Make a vault file and return a handle on its master key.
|
|
1397
|
+
///
|
|
1398
|
+
/// <para>Refuses a file that is already there: a vault is created
|
|
1399
|
+
/// once, and overwriting one discards every secret in it.</para>
|
|
1400
|
+
/// </summary>
|
|
1401
|
+
public static Vault CreateVault(Options options)
|
|
1402
|
+
{
|
|
1403
|
+
var opts = options ?? new Options();
|
|
1404
|
+
|
|
1405
|
+
if (string.IsNullOrEmpty(opts.File))
|
|
1406
|
+
{
|
|
1407
|
+
throw Fail("a vault needs a file");
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
if (string.IsNullOrEmpty(opts.Passphrase))
|
|
1411
|
+
{
|
|
1412
|
+
throw Fail("a vault needs a passphrase");
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
var keyid = CheckId(WantKey(opts.Key), "a vault needs a key id");
|
|
1416
|
+
|
|
1417
|
+
// No existence check first: the check and the write would be two
|
|
1418
|
+
// steps, and `PutNew` refuses an existing file in ONE.
|
|
1419
|
+
PutNew(opts.File, NewVault(keyid, opts.Passphrase, opts.Iterations));
|
|
1420
|
+
|
|
1421
|
+
return new Vault(opts);
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
// --- the provider ---------------------------------------------------
|
|
1425
|
+
|
|
1426
|
+
/// <summary>
|
|
1427
|
+
/// Read a vault as one store in a chain.
|
|
1428
|
+
///
|
|
1429
|
+
/// <para>The provider is the READ half and nothing more: a chain
|
|
1430
|
+
/// resolves secrets, and writing one is a deliberate act with an API
|
|
1431
|
+
/// of its own.</para>
|
|
1432
|
+
/// </summary>
|
|
1433
|
+
private sealed class MiniVaultProvider : IProvider
|
|
1434
|
+
{
|
|
1435
|
+
private readonly Vault vault;
|
|
1436
|
+
|
|
1437
|
+
internal MiniVaultProvider(Vault vault)
|
|
1438
|
+
{
|
|
1439
|
+
this.vault = vault;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
public string Lookup(string name)
|
|
1443
|
+
{
|
|
1444
|
+
return vault.Get(name);
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
public string Describe()
|
|
1448
|
+
{
|
|
1449
|
+
return "minivault:" + vault.File();
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
public static IProvider ProviderOf(Vault vault)
|
|
1454
|
+
{
|
|
1455
|
+
return new MiniVaultProvider(vault);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/// <summary>A vault provider from options, for a chain built by hand.</summary>
|
|
1459
|
+
public static IProvider MiniVaultProviderOf(Options options)
|
|
1460
|
+
{
|
|
1461
|
+
return ProviderOf(OpenVault(options));
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
/// <summary>The vault options a provider spec describes.</summary>
|
|
1465
|
+
internal static Options VaultOptions(Dictionary<string, object> spec)
|
|
1466
|
+
{
|
|
1467
|
+
var out_ = new Options
|
|
1468
|
+
{
|
|
1469
|
+
File = Providers.TextOr(Get(spec, "file"), ""),
|
|
1470
|
+
Key = WantKey(Providers.Text(Get(spec, "vaultkey"))),
|
|
1471
|
+
Passphrase = Providers.TextOr(Get(spec, "passphrase"), ""),
|
|
1472
|
+
Create = Get(spec, "create") is bool flag && flag,
|
|
1473
|
+
};
|
|
1474
|
+
|
|
1475
|
+
if (Get(spec, "iterations") is double iterations)
|
|
1476
|
+
{
|
|
1477
|
+
out_.Iterations = (int)iterations;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
return out_;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
private static object Get(Dictionary<string, object> spec, string key)
|
|
1484
|
+
{
|
|
1485
|
+
return null != spec && spec.TryGetValue(key, out var value) ? value : null;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
/// <summary>
|
|
1489
|
+
/// The `minivault` provider kind, as a voxgig/plugin definition.
|
|
1490
|
+
///
|
|
1491
|
+
/// <para>Written out rather than built by `Providers.ProviderPlugin`,
|
|
1492
|
+
/// because this definition publishes TWO exports: `provider`, the read
|
|
1493
|
+
/// half every kind publishes, and `vault`, the programmatic API.</para>
|
|
1494
|
+
/// </summary>
|
|
1495
|
+
public static Definition Plugin
|
|
1496
|
+
{
|
|
1497
|
+
get
|
|
1498
|
+
{
|
|
1499
|
+
var definition = new Definition("minivault");
|
|
1500
|
+
|
|
1501
|
+
definition.Define = inst =>
|
|
1502
|
+
{
|
|
1503
|
+
var spec = inst.Options() as Dictionary<string, object>
|
|
1504
|
+
?? new Dictionary<string, object>();
|
|
1505
|
+
|
|
1506
|
+
Vault vault;
|
|
1507
|
+
|
|
1508
|
+
try
|
|
1509
|
+
{
|
|
1510
|
+
// `OpenVault` refuses bad configuration HERE, so a
|
|
1511
|
+
// mistyped chain fails at construction. Reaching the
|
|
1512
|
+
// FILE is not configuration: the handle is lazy.
|
|
1513
|
+
vault = OpenVault(VaultOptions(spec));
|
|
1514
|
+
}
|
|
1515
|
+
catch (SekretoError err)
|
|
1516
|
+
{
|
|
1517
|
+
throw new PluginException(
|
|
1518
|
+
Providers.ErrorCode, err.Message,
|
|
1519
|
+
Types.Details("ref", inst.Ref, "cause", err.Message));
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
inst.Export(Providers.ProviderExport, ProviderOf(vault));
|
|
1523
|
+
inst.Export(VaultExport, vault);
|
|
1524
|
+
};
|
|
1525
|
+
|
|
1526
|
+
return definition;
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
/// <summary>
|
|
1531
|
+
/// The vault behind a store in a chain, as its programmatic API.
|
|
1532
|
+
///
|
|
1533
|
+
/// <para>With no store named, the unqualified alias answers: one vault
|
|
1534
|
+
/// in the chain resolves whatever it is called, and two raise rather
|
|
1535
|
+
/// than picking one.</para>
|
|
1536
|
+
/// </summary>
|
|
1537
|
+
public static Vault VaultOf(Sekreto secrets)
|
|
1538
|
+
{
|
|
1539
|
+
var found = secrets.Host.Exports("minivault/" + VaultExport) as Vault;
|
|
1540
|
+
|
|
1541
|
+
if (null == found)
|
|
1542
|
+
{
|
|
1543
|
+
throw Fail("no minivault store in this chain");
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
return found;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
/// <summary>The vault behind one NAMED store in a chain.</summary>
|
|
1550
|
+
public static Vault VaultOf(Sekreto secrets, string store)
|
|
1551
|
+
{
|
|
1552
|
+
if (null == store)
|
|
1553
|
+
{
|
|
1554
|
+
return VaultOf(secrets);
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// A NAMED STORE MUST EXIST, and the alias must not stand in for
|
|
1558
|
+
// it. `Host.Exports` falls back to the alias when the exact ref
|
|
1559
|
+
// misses, so asking for `minivault` in a chain whose only vault is
|
|
1560
|
+
// named `app` used to hand back the `app` vault - and then write
|
|
1561
|
+
// to it.
|
|
1562
|
+
var eref = "minivault" == store ? "minivault" : "minivault$" + store;
|
|
1563
|
+
|
|
1564
|
+
if (null == secrets.Host.Instance(eref))
|
|
1565
|
+
{
|
|
1566
|
+
throw Fail("no minivault store named " + store + " in this chain");
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
return secrets.Host.Exports(eref + "/" + VaultExport) as Vault;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
}
|