@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,1095 @@
|
|
|
1
|
+
// VENDORED: @voxgig/sekreto sdk-20260917-1242-0 (kotlin/plugins/Minivault.kt)
|
|
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, not core: it needs crypto, which is the line the four
|
|
9
|
+
// built-ins stay behind. See docs/design/plugin-providers.md.
|
|
10
|
+
//
|
|
11
|
+
// THE KEY DECIDES WHAT THE VAULT HOLDS. A master key reads and writes
|
|
12
|
+
// every name and mints restricted keys. A restricted key reads the names
|
|
13
|
+
// it was granted and CANNOT DERIVE ANY OTHER - the restriction is the
|
|
14
|
+
// cryptography rather than a check this code performs. What that does and
|
|
15
|
+
// does not protect is set out in DOCS.md under "What the mini vault
|
|
16
|
+
// protects".
|
|
17
|
+
//
|
|
18
|
+
// `javax.crypto` carries all four primitives, so nothing here is
|
|
19
|
+
// hand-rolled (AGENTS.md rule 3).
|
|
20
|
+
|
|
21
|
+
package KOTLINPACKAGE.feature.secrets.sekreto.plugins
|
|
22
|
+
|
|
23
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.Definition
|
|
24
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.ERROR_CODE
|
|
25
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.Json
|
|
26
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.PROVIDER_EXPORT
|
|
27
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.Provider
|
|
28
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.Sekreto
|
|
29
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.SekretoError
|
|
30
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.checkname
|
|
31
|
+
import KOTLINPACKAGE.feature.secrets.sekreto.specof
|
|
32
|
+
import KOTLINPACKAGE.feature.secrets.plugin.Inst
|
|
33
|
+
import KOTLINPACKAGE.feature.secrets.plugin.PluginError
|
|
34
|
+
import java.io.File
|
|
35
|
+
import java.io.IOException
|
|
36
|
+
import java.nio.ByteBuffer
|
|
37
|
+
import java.nio.charset.StandardCharsets
|
|
38
|
+
import java.nio.file.FileAlreadyExistsException
|
|
39
|
+
import java.nio.file.Files
|
|
40
|
+
import java.nio.file.NoSuchFileException
|
|
41
|
+
import java.nio.file.Path
|
|
42
|
+
import java.nio.file.StandardCopyOption
|
|
43
|
+
import java.nio.file.StandardOpenOption
|
|
44
|
+
import java.nio.file.attribute.PosixFilePermissions
|
|
45
|
+
import java.security.GeneralSecurityException
|
|
46
|
+
import java.security.SecureRandom
|
|
47
|
+
import java.util.Base64
|
|
48
|
+
import java.util.TreeMap
|
|
49
|
+
import javax.crypto.Cipher
|
|
50
|
+
import javax.crypto.Mac
|
|
51
|
+
import javax.crypto.SecretKeyFactory
|
|
52
|
+
import javax.crypto.spec.GCMParameterSpec
|
|
53
|
+
import javax.crypto.spec.PBEKeySpec
|
|
54
|
+
import javax.crypto.spec.SecretKeySpec
|
|
55
|
+
|
|
56
|
+
// --- the format ------------------------------------------------------
|
|
57
|
+
//
|
|
58
|
+
// magic 4 'SKMV'
|
|
59
|
+
// version 1 FORMAT
|
|
60
|
+
// kdf 1 1 = PBKDF2-HMAC-SHA256
|
|
61
|
+
// cipher 1 1 = AES-256-GCM
|
|
62
|
+
// reserved 1 0
|
|
63
|
+
// keycount 4 uint32
|
|
64
|
+
// per key:
|
|
65
|
+
// id 1 + bytes the key id, PLAINTEXT
|
|
66
|
+
// salt 1 + bytes
|
|
67
|
+
// iters 4 PBKDF2 rounds for this key
|
|
68
|
+
// ring 1 + iv, 4 + bytes sealed under the passphrase
|
|
69
|
+
// meta 1 + iv, 4 + bytes sealed under the vault's meta key
|
|
70
|
+
// entrycount 4 uint32
|
|
71
|
+
// per entry:
|
|
72
|
+
// id 1 + bytes the blinded lookup id
|
|
73
|
+
// name 1 + iv, 4 + bytes sealed under the vault's name key
|
|
74
|
+
// value 1 + iv, 4 + bytes sealed under that secret's own key
|
|
75
|
+
//
|
|
76
|
+
// Integers are big-endian, and every length precedes its bytes. A file one
|
|
77
|
+
// port writes is read by every other; `test/fixture` pins that with a
|
|
78
|
+
// committed vault rather than with agreement.
|
|
79
|
+
|
|
80
|
+
private const val MAGIC = "SKMV"
|
|
81
|
+
private const val FORMAT = 1
|
|
82
|
+
private const val KDF_PBKDF2 = 1
|
|
83
|
+
private const val CIPHER_AESGCM = 1
|
|
84
|
+
|
|
85
|
+
/** AES-256-GCM: 32-byte keys, 12-byte nonces, 16-byte tags. */
|
|
86
|
+
private const val KEYLEN = 32
|
|
87
|
+
private const val IVLEN = 12
|
|
88
|
+
private const val TAGLEN = 16
|
|
89
|
+
private const val SALTLEN = 16
|
|
90
|
+
|
|
91
|
+
/** PBKDF2-HMAC-SHA256 rounds when a caller names none. */
|
|
92
|
+
const val MINIVAULT_ITERATIONS = 210000
|
|
93
|
+
|
|
94
|
+
/** The key id a vault gets when a caller names none. */
|
|
95
|
+
const val MASTERKEY = "master"
|
|
96
|
+
|
|
97
|
+
// Additional authenticated data. Every blob is bound to its PLACE in the
|
|
98
|
+
// file, so no ciphertext can be moved.
|
|
99
|
+
private const val AAD_RING = "skmv1:ring:"
|
|
100
|
+
private const val AAD_META = "skmv1:meta:"
|
|
101
|
+
private const val AAD_NAME = "skmv1:name"
|
|
102
|
+
private const val AAD_SECRET = "skmv1:secret:"
|
|
103
|
+
|
|
104
|
+
// Everything a master can reach is derived from the root key, so a
|
|
105
|
+
// rotation is one new random value rather than a re-wrap of each part.
|
|
106
|
+
private const val LABEL_NAMES = "skmv1:names"
|
|
107
|
+
private const val LABEL_META = "skmv1:meta"
|
|
108
|
+
private const val LABEL_ID = "skmv1:id"
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The largest key id the format can record.
|
|
112
|
+
*
|
|
113
|
+
* `small` writes a length in ONE byte. A longer id wrapped that byte and
|
|
114
|
+
* the writer then appended the whole thing, so every field after it
|
|
115
|
+
* shifted. Checked where an id is ACCEPTED, so the refusal names the id
|
|
116
|
+
* rather than the file.
|
|
117
|
+
*/
|
|
118
|
+
private const val IDMAX = 255
|
|
119
|
+
|
|
120
|
+
/** The export key the vault API is published under, beside `provider`. */
|
|
121
|
+
const val VAULT_EXPORT = "vault"
|
|
122
|
+
|
|
123
|
+
private val RANDOM = SecureRandom()
|
|
124
|
+
|
|
125
|
+
private fun mvfail(text: String): Nothing = throw SekretoError("sekreto: minivault: $text")
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The key a caller asked for, or [MASTERKEY]: an EMPTY key is no key. The
|
|
129
|
+
* canonical's `opts.key || MASTERKEY` answers for both null and empty,
|
|
130
|
+
* where `?:` answers for null alone - and a CLI reaches this with
|
|
131
|
+
* SEKRETO_VAULT_KEY set and empty, which is what an unset shell variable
|
|
132
|
+
* expands to.
|
|
133
|
+
*/
|
|
134
|
+
/**
|
|
135
|
+
* The lock every handle on one file shares.
|
|
136
|
+
*
|
|
137
|
+
* Each [MiniVault] is its own object, so two handles on one path did not
|
|
138
|
+
* coordinate: both could finish `load()` before either saved, and the
|
|
139
|
+
* second rename then discarded the first one's change while reporting
|
|
140
|
+
* success. Keyed by the ABSOLUTE path, so two handles spelled differently
|
|
141
|
+
* still meet.
|
|
142
|
+
*
|
|
143
|
+
* A guarantee WITHIN one process, which is what DOCS.md promises and what
|
|
144
|
+
* the go port arranges the same way. Two processes still race, and the
|
|
145
|
+
* format's answer to that is the exclusive create and the atomic rename:
|
|
146
|
+
* a reader sees one whole vault or the other, never half of one.
|
|
147
|
+
*/
|
|
148
|
+
private val LOCKS = java.util.concurrent.ConcurrentHashMap<String, Any>()
|
|
149
|
+
|
|
150
|
+
private fun lockfor(file: String): Any {
|
|
151
|
+
val key = try {
|
|
152
|
+
File(file).absoluteFile.normalize().path
|
|
153
|
+
} catch (err: RuntimeException) {
|
|
154
|
+
file
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return LOCKS.computeIfAbsent(key) { Any() }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
private fun wantkey(value: String?): String =
|
|
161
|
+
if (value.isNullOrEmpty()) MASTERKEY else value
|
|
162
|
+
|
|
163
|
+
private fun checkid(id: String?, what: String): String {
|
|
164
|
+
if (null == id || id.isEmpty()) {
|
|
165
|
+
mvfail(what)
|
|
166
|
+
}
|
|
167
|
+
if (utf8(id).size > IDMAX) {
|
|
168
|
+
mvfail("key id is longer than $IDMAX bytes: ${id.take(32)}...")
|
|
169
|
+
}
|
|
170
|
+
return id
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
private fun utf8(text: String): ByteArray = text.toByteArray(StandardCharsets.UTF_8)
|
|
174
|
+
|
|
175
|
+
// --- keys ------------------------------------------------------------
|
|
176
|
+
|
|
177
|
+
private fun mvhmac(key: ByteArray, text: String): ByteArray = try {
|
|
178
|
+
Mac.getInstance("HmacSHA256").apply { init(SecretKeySpec(key, "HmacSHA256")) }
|
|
179
|
+
.doFinal(utf8(text))
|
|
180
|
+
} catch (err: GeneralSecurityException) {
|
|
181
|
+
mvfail("hmac: ${err.message}")
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** The key-encryption key a passphrase unwraps a ring with. */
|
|
185
|
+
private fun kek(passphrase: String, salt: ByteArray, iters: Int): ByteArray = try {
|
|
186
|
+
SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256")
|
|
187
|
+
.generateSecret(PBEKeySpec(passphrase.toCharArray(), salt, iters, KEYLEN * 8))
|
|
188
|
+
.encoded
|
|
189
|
+
} catch (err: GeneralSecurityException) {
|
|
190
|
+
mvfail("pbkdf2: ${err.message}")
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The key one named secret's value is encrypted with.
|
|
195
|
+
*
|
|
196
|
+
* DERIVED, never stored, for a master: it holds the root key and so
|
|
197
|
+
* reaches every name, including ones written after it was made. A
|
|
198
|
+
* restricted key holds the derived keys it was granted and nothing that
|
|
199
|
+
* produces another.
|
|
200
|
+
*/
|
|
201
|
+
private fun secretkey(root: ByteArray, name: String): ByteArray = mvhmac(root, AAD_SECRET + name)
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Where a secret lives in the file, derived from its own key so that
|
|
205
|
+
* finding it needs no plaintext name.
|
|
206
|
+
*/
|
|
207
|
+
private fun entryid(key: ByteArray): ByteArray = mvhmac(key, LABEL_ID)
|
|
208
|
+
|
|
209
|
+
private fun random(len: Int): ByteArray = ByteArray(len).also { RANDOM.nextBytes(it) }
|
|
210
|
+
|
|
211
|
+
// --- sealing ---------------------------------------------------------
|
|
212
|
+
|
|
213
|
+
/** A nonce and the ciphertext with its tag appended. */
|
|
214
|
+
private data class Sealed(val iv: ByteArray, val blob: ByteArray) {
|
|
215
|
+
override fun equals(other: Any?): Boolean =
|
|
216
|
+
other is Sealed && iv.contentEquals(other.iv) && blob.contentEquals(other.blob)
|
|
217
|
+
|
|
218
|
+
override fun hashCode(): Int = iv.contentHashCode() * 31 + blob.contentHashCode()
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
private fun seal(key: ByteArray, plain: ByteArray, aad: String): Sealed = try {
|
|
222
|
+
val iv = random(IVLEN)
|
|
223
|
+
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
|
|
224
|
+
cipher.init(Cipher.ENCRYPT_MODE, SecretKeySpec(key, "AES"), GCMParameterSpec(TAGLEN * 8, iv))
|
|
225
|
+
cipher.updateAAD(utf8(aad))
|
|
226
|
+
Sealed(iv, cipher.doFinal(plain))
|
|
227
|
+
} catch (err: GeneralSecurityException) {
|
|
228
|
+
mvfail("cannot seal: ${err.message}")
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* The plaintext, or a refusal. A GCM tag that fails to verify is the only
|
|
233
|
+
* evidence there is, and it cannot tell a wrong passphrase from a damaged
|
|
234
|
+
* file, so `what` names the attempt and the message admits both.
|
|
235
|
+
*/
|
|
236
|
+
private fun unseal(key: ByteArray, sealed: Sealed, aad: String, what: String): ByteArray {
|
|
237
|
+
if (sealed.blob.size < TAGLEN || IVLEN != sealed.iv.size) {
|
|
238
|
+
mvfail("$what: truncated")
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// The WHOLE round-trip is guarded, not only the tag check: a nonce of
|
|
242
|
+
// the wrong length makes `init` itself raise, and a damaged file
|
|
243
|
+
// reaching a caller as a raw GeneralSecurityException is a refusal
|
|
244
|
+
// nobody can act on.
|
|
245
|
+
return try {
|
|
246
|
+
val cipher = Cipher.getInstance("AES/GCM/NoPadding")
|
|
247
|
+
cipher.init(
|
|
248
|
+
Cipher.DECRYPT_MODE,
|
|
249
|
+
SecretKeySpec(key, "AES"),
|
|
250
|
+
GCMParameterSpec(TAGLEN * 8, sealed.iv),
|
|
251
|
+
)
|
|
252
|
+
cipher.updateAAD(utf8(aad))
|
|
253
|
+
cipher.doFinal(sealed.blob)
|
|
254
|
+
} catch (err: GeneralSecurityException) {
|
|
255
|
+
mvfail(what)
|
|
256
|
+
} catch (err: RuntimeException) {
|
|
257
|
+
mvfail(what)
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// THE JSON IS A SEALED CLASS HERE and a plain map everywhere else. This
|
|
262
|
+
// port's `Json` carries `Json.Obj` / `Json.Str` rather than `Any?`, so a
|
|
263
|
+
// ring crosses the boundary twice: `plainof` on the way in, `tagged` on
|
|
264
|
+
// the way out. The bytes are the same either way - the wrapper is this
|
|
265
|
+
// port's representation, not the format's.
|
|
266
|
+
private fun jsonof(plain: ByteArray, what: String): Map<String, Any?> {
|
|
267
|
+
val parsed = Json.parse(String(plain, StandardCharsets.UTF_8))
|
|
268
|
+
?: mvfail("unreadable $what")
|
|
269
|
+
val obj = parsed as? Json.Obj ?: mvfail("unreadable $what")
|
|
270
|
+
return obj.value.mapValues { plainof(it.value) }
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
private fun plainof(value: Json): Any? = when (value) {
|
|
274
|
+
is Json.Null -> null
|
|
275
|
+
is Json.Bool -> value.value
|
|
276
|
+
is Json.Num -> value.value
|
|
277
|
+
is Json.Str -> value.value
|
|
278
|
+
is Json.Arr -> value.value.map { plainof(it) }
|
|
279
|
+
is Json.Obj -> value.value.mapValues { plainof(it.value) }
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
private fun tagged(value: Any?): Json = when (value) {
|
|
283
|
+
null -> Json.Null
|
|
284
|
+
is Boolean -> Json.Bool(value)
|
|
285
|
+
is Double -> Json.Num(value)
|
|
286
|
+
is Int -> Json.Num(value.toDouble())
|
|
287
|
+
is String -> Json.Str(value)
|
|
288
|
+
is List<*> -> Json.Arr(value.map { tagged(it) })
|
|
289
|
+
is Map<*, *> -> Json.Obj(value.entries.associate { "${it.key}" to tagged(it.value) })
|
|
290
|
+
else -> mvfail("cannot encode $value")
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
private fun stringify(value: Map<String, Any?>): String = Json.stringify(tagged(value))
|
|
294
|
+
|
|
295
|
+
private fun b64(bytes: ByteArray): String = Base64.getEncoder().encodeToString(bytes)
|
|
296
|
+
|
|
297
|
+
private fun unb64(text: Any?, what: String): ByteArray {
|
|
298
|
+
if (text !is String) {
|
|
299
|
+
mvfail("missing $what")
|
|
300
|
+
}
|
|
301
|
+
return try {
|
|
302
|
+
Base64.getDecoder().decode(text)
|
|
303
|
+
} catch (err: IllegalArgumentException) {
|
|
304
|
+
mvfail("missing $what")
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// --- the file --------------------------------------------------------
|
|
309
|
+
|
|
310
|
+
private class KeyRecord(
|
|
311
|
+
val id: String,
|
|
312
|
+
val salt: ByteArray,
|
|
313
|
+
val iters: Int,
|
|
314
|
+
val ring: Sealed,
|
|
315
|
+
val meta: Sealed,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
private class EntryRecord(val id: ByteArray, val name: Sealed, var value: Sealed)
|
|
319
|
+
|
|
320
|
+
private class VaultFile(
|
|
321
|
+
val keys: MutableList<KeyRecord> = mutableListOf(),
|
|
322
|
+
val entries: MutableList<EntryRecord> = mutableListOf(),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* A cursor, so that every length check is in one place: a truncated vault
|
|
327
|
+
* is refused rather than read as a short one.
|
|
328
|
+
*/
|
|
329
|
+
private class Reader(private val bytes: ByteArray) {
|
|
330
|
+
private var at = 0
|
|
331
|
+
|
|
332
|
+
fun take(len: Int): ByteArray {
|
|
333
|
+
if (len < 0 || bytes.size < at + len) {
|
|
334
|
+
mvfail("the vault file is truncated")
|
|
335
|
+
}
|
|
336
|
+
val out = bytes.copyOfRange(at, at + len)
|
|
337
|
+
at += len
|
|
338
|
+
return out
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
fun u8(): Int = take(1)[0].toInt() and 0xff
|
|
342
|
+
|
|
343
|
+
fun u32(): Int {
|
|
344
|
+
// A length over Int.MAX_VALUE cannot address an array, and reading
|
|
345
|
+
// it as a negative int is what turned a damaged file into a crash
|
|
346
|
+
// instead of a refusal.
|
|
347
|
+
val value = ByteBuffer.wrap(take(4)).int.toLong() and 0xffffffffL
|
|
348
|
+
if (value > Int.MAX_VALUE) {
|
|
349
|
+
mvfail("the vault file is truncated")
|
|
350
|
+
}
|
|
351
|
+
return value.toInt()
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
fun small(): ByteArray = take(u8())
|
|
355
|
+
|
|
356
|
+
fun large(): ByteArray = take(u32())
|
|
357
|
+
|
|
358
|
+
fun magic(): String = String(take(4), StandardCharsets.ISO_8859_1)
|
|
359
|
+
|
|
360
|
+
fun sealedvalue(): Sealed = Sealed(small(), large())
|
|
361
|
+
|
|
362
|
+
fun done(): Boolean = at == bytes.size
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
private fun readfile(bytes: ByteArray): VaultFile {
|
|
366
|
+
val read = Reader(bytes)
|
|
367
|
+
|
|
368
|
+
if (MAGIC != read.magic()) {
|
|
369
|
+
mvfail("not a vault file")
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
val version = read.u8()
|
|
373
|
+
if (FORMAT != version) {
|
|
374
|
+
mvfail("unsupported format version: $version")
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
val kdf = read.u8()
|
|
378
|
+
val cipher = read.u8()
|
|
379
|
+
if (KDF_PBKDF2 != kdf || CIPHER_AESGCM != cipher) {
|
|
380
|
+
mvfail("unsupported kdf or cipher: $kdf/$cipher")
|
|
381
|
+
}
|
|
382
|
+
read.u8()
|
|
383
|
+
|
|
384
|
+
val vault = VaultFile()
|
|
385
|
+
|
|
386
|
+
repeat(read.u32()) {
|
|
387
|
+
vault.keys.add(
|
|
388
|
+
KeyRecord(
|
|
389
|
+
String(read.small(), StandardCharsets.UTF_8),
|
|
390
|
+
read.small(),
|
|
391
|
+
read.u32(),
|
|
392
|
+
read.sealedvalue(),
|
|
393
|
+
read.sealedvalue(),
|
|
394
|
+
),
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
repeat(read.u32()) {
|
|
399
|
+
vault.entries.add(EntryRecord(read.small(), read.sealedvalue(), read.sealedvalue()))
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (!read.done()) {
|
|
403
|
+
mvfail("the vault file has trailing bytes")
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return vault
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Unsigned, byte by byte, the way every other port sorts. */
|
|
410
|
+
private fun compare(left: ByteArray, right: ByteArray): Int {
|
|
411
|
+
for (index in 0 until minOf(left.size, right.size)) {
|
|
412
|
+
val one = left[index].toInt() and 0xff
|
|
413
|
+
val two = right[index].toInt() and 0xff
|
|
414
|
+
if (one != two) {
|
|
415
|
+
return if (one < two) -1 else 1
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return left.size.compareTo(right.size)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
private fun writefile(vault: VaultFile): ByteArray {
|
|
422
|
+
val out = java.io.ByteArrayOutputStream()
|
|
423
|
+
|
|
424
|
+
fun raw(bytes: ByteArray) = out.write(bytes)
|
|
425
|
+
fun u8(value: Int) = out.write(value and 0xff)
|
|
426
|
+
fun u32(value: Int) = raw(ByteBuffer.allocate(4).putInt(value).array())
|
|
427
|
+
fun small(bytes: ByteArray) { u8(bytes.size); raw(bytes) }
|
|
428
|
+
fun large(bytes: ByteArray) { u32(bytes.size); raw(bytes) }
|
|
429
|
+
fun sealedvalue(value: Sealed) { small(value.iv); large(value.blob) }
|
|
430
|
+
|
|
431
|
+
raw(MAGIC.toByteArray(StandardCharsets.ISO_8859_1))
|
|
432
|
+
u8(FORMAT)
|
|
433
|
+
u8(KDF_PBKDF2)
|
|
434
|
+
u8(CIPHER_AESGCM)
|
|
435
|
+
u8(0)
|
|
436
|
+
|
|
437
|
+
u32(vault.keys.size)
|
|
438
|
+
for (key in vault.keys) {
|
|
439
|
+
small(utf8(key.id))
|
|
440
|
+
small(key.salt)
|
|
441
|
+
u32(key.iters)
|
|
442
|
+
sealedvalue(key.ring)
|
|
443
|
+
sealedvalue(key.meta)
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// SORTED BY ID, which is a blinded value: the file therefore records
|
|
447
|
+
// nothing about the order secrets were written in.
|
|
448
|
+
val entries = vault.entries.sortedWith { left, right -> compare(left.id, right.id) }
|
|
449
|
+
|
|
450
|
+
u32(entries.size)
|
|
451
|
+
for (entry in entries) {
|
|
452
|
+
small(entry.id)
|
|
453
|
+
sealedvalue(entry.name)
|
|
454
|
+
sealedvalue(entry.value)
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return out.toByteArray()
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// --- what a key is ---------------------------------------------------
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* What a key may do. `grants` is empty for a master key.
|
|
464
|
+
*
|
|
465
|
+
* A data class with `val` fields and an immutable list, so what a caller
|
|
466
|
+
* is handed cannot become what the vault believes: `info.write = true`
|
|
467
|
+
* does not compile.
|
|
468
|
+
*/
|
|
469
|
+
data class VaultKeyInfo(
|
|
470
|
+
val key: String,
|
|
471
|
+
val master: Boolean,
|
|
472
|
+
val write: Boolean,
|
|
473
|
+
val grants: List<String>,
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
/** What a caller asks for when minting a restricted key. */
|
|
477
|
+
data class GrantSpec(
|
|
478
|
+
val key: String,
|
|
479
|
+
val passphrase: String,
|
|
480
|
+
val names: List<String> = emptyList(),
|
|
481
|
+
val write: Boolean = false,
|
|
482
|
+
val iterations: Int? = null,
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
/** How a vault handle is configured. */
|
|
486
|
+
data class VaultOptions(
|
|
487
|
+
val file: String,
|
|
488
|
+
val passphrase: String,
|
|
489
|
+
val key: String = MASTERKEY,
|
|
490
|
+
val iterations: Int = MINIVAULT_ITERATIONS,
|
|
491
|
+
val create: Boolean = false,
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
private class Opened(
|
|
495
|
+
val info: VaultKeyInfo,
|
|
496
|
+
val root: ByteArray?,
|
|
497
|
+
val grants: Map<String, ByteArray>,
|
|
498
|
+
val ring: Sealed,
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
// --- creating --------------------------------------------------------
|
|
502
|
+
|
|
503
|
+
private fun newvault(keyid: String, passphrase: String, iterations: Int): VaultFile {
|
|
504
|
+
val root = random(KEYLEN)
|
|
505
|
+
val salt = random(SALTLEN)
|
|
506
|
+
|
|
507
|
+
val ring = linkedMapOf<String, Any?>(
|
|
508
|
+
"v" to FORMAT.toDouble(), "write" to true, "root" to b64(root),
|
|
509
|
+
)
|
|
510
|
+
val meta = linkedMapOf<String, Any?>(
|
|
511
|
+
"v" to FORMAT.toDouble(), "master" to true, "write" to true,
|
|
512
|
+
"grants" to emptyList<Any?>(),
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
return VaultFile(
|
|
516
|
+
mutableListOf(
|
|
517
|
+
KeyRecord(
|
|
518
|
+
keyid, salt, iterations,
|
|
519
|
+
seal(kek(passphrase, salt, iterations), utf8(stringify(ring)),
|
|
520
|
+
AAD_RING + keyid),
|
|
521
|
+
seal(mvhmac(root, LABEL_META), utf8(stringify(meta)), AAD_META + keyid),
|
|
522
|
+
),
|
|
523
|
+
),
|
|
524
|
+
)
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
private fun owneronly(path: Path) {
|
|
528
|
+
try {
|
|
529
|
+
Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("rw-------"))
|
|
530
|
+
} catch (err: IOException) {
|
|
531
|
+
// A filesystem with no POSIX permissions is not a reason to refuse
|
|
532
|
+
// a write that otherwise succeeded.
|
|
533
|
+
} catch (err: UnsupportedOperationException) {
|
|
534
|
+
// The same.
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Write a vault file that is not there yet, and REFUSE one that is.
|
|
540
|
+
*
|
|
541
|
+
* Straight to the target with CREATE_NEW rather than through a temporary
|
|
542
|
+
* and a rename. A rename REPLACES its destination, so two processes
|
|
543
|
+
* creating the same vault both succeeded and the second discarded the
|
|
544
|
+
* first one's secrets.
|
|
545
|
+
*/
|
|
546
|
+
private fun putnew(file: String, vault: VaultFile) {
|
|
547
|
+
val path = Path.of(file)
|
|
548
|
+
try {
|
|
549
|
+
Files.write(path, writefile(vault), StandardOpenOption.CREATE_NEW,
|
|
550
|
+
StandardOpenOption.WRITE)
|
|
551
|
+
owneronly(path)
|
|
552
|
+
} catch (err: FileAlreadyExistsException) {
|
|
553
|
+
mvfail("vault file already exists: $file")
|
|
554
|
+
} catch (err: IOException) {
|
|
555
|
+
mvfail("cannot write $file: ${err.message}")
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* A handle on one vault file, opened as ONE key.
|
|
561
|
+
*
|
|
562
|
+
* Every method answers as that key: `list` shows the names it may read,
|
|
563
|
+
* `get` answers for those and misses on the rest, and the master-only
|
|
564
|
+
* methods refuse for any other key. Nothing is read or derived until the
|
|
565
|
+
* first call that needs the file.
|
|
566
|
+
*/
|
|
567
|
+
class MiniVault internal constructor(options: VaultOptions) {
|
|
568
|
+
|
|
569
|
+
private val file: String
|
|
570
|
+
private val keyid: String
|
|
571
|
+
private val passphrase: String
|
|
572
|
+
private val iterations: Int
|
|
573
|
+
private val create: Boolean
|
|
574
|
+
|
|
575
|
+
private var opened: Opened? = null
|
|
576
|
+
|
|
577
|
+
init {
|
|
578
|
+
if (options.file.isEmpty()) {
|
|
579
|
+
mvfail("a vault needs a file")
|
|
580
|
+
}
|
|
581
|
+
if (options.passphrase.isEmpty()) {
|
|
582
|
+
mvfail("a vault needs a passphrase")
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
file = options.file
|
|
586
|
+
passphrase = options.passphrase
|
|
587
|
+
keyid = checkid(wantkey(options.key), "a vault needs a key id")
|
|
588
|
+
iterations = options.iterations
|
|
589
|
+
create = options.create
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/** The file this handle reads. */
|
|
593
|
+
fun file(): String = file
|
|
594
|
+
|
|
595
|
+
/** The key id this handle opens with. */
|
|
596
|
+
fun key(): String = keyid
|
|
597
|
+
|
|
598
|
+
/** Derive the key and read the file NOW rather than at first use. */
|
|
599
|
+
fun open(): VaultKeyInfo = load().second.info
|
|
600
|
+
|
|
601
|
+
/** Forget the derived keys. The next call opens again. */
|
|
602
|
+
fun close() {
|
|
603
|
+
opened = null
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/** The names this key can read, sorted. */
|
|
607
|
+
fun list(): List<String> {
|
|
608
|
+
val (vault, open) = load()
|
|
609
|
+
val root = open.root
|
|
610
|
+
|
|
611
|
+
if (null != root) {
|
|
612
|
+
val namekey = mvhmac(root, LABEL_NAMES)
|
|
613
|
+
return vault.entries
|
|
614
|
+
.map { String(unseal(namekey, it.name, AAD_NAME, "a secret name is damaged"),
|
|
615
|
+
StandardCharsets.UTF_8) }
|
|
616
|
+
.sorted()
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
// A restricted key has no name key, so it reports the grants it can
|
|
620
|
+
// actually find: the vault never tells it what else is in there.
|
|
621
|
+
return open.info.grants.filter { null != findentry(vault, open.grants[it]) }.sorted()
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
fun has(name: String): Boolean = null != get(name)
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* The value, or null when the vault does not hold that name or this key
|
|
628
|
+
* was not granted it.
|
|
629
|
+
*/
|
|
630
|
+
fun get(name: String): String? {
|
|
631
|
+
checkname(name)
|
|
632
|
+
val (vault, open) = load()
|
|
633
|
+
|
|
634
|
+
// OUTSIDE THE GRANT IS A MISS, deliberately. The vault answers as
|
|
635
|
+
// the key that opened it, so a name this key cannot read is a name
|
|
636
|
+
// this store does not hold for this caller.
|
|
637
|
+
val key = keyfor(open, name) ?: return null
|
|
638
|
+
val entry = findentry(vault, key) ?: return null
|
|
639
|
+
|
|
640
|
+
return String(
|
|
641
|
+
unseal(key, entry.value, AAD_SECRET + name, "the value of $name is damaged"),
|
|
642
|
+
StandardCharsets.UTF_8,
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Write a value. A master writes any name; a restricted key holding
|
|
648
|
+
* `write` overwrites the names it was granted, and creates none.
|
|
649
|
+
*/
|
|
650
|
+
fun set(name: String, value: String) {
|
|
651
|
+
// Every write on this file, from any handle in this process,
|
|
652
|
+
// serializes here; see lockfor.
|
|
653
|
+
synchronized(lockfor(file)) {
|
|
654
|
+
checkname(name)
|
|
655
|
+
val (vault, open) = load()
|
|
656
|
+
|
|
657
|
+
if (!open.info.write) {
|
|
658
|
+
mvfail("key ${open.info.key} is read-only")
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
val key = keyfor(open, name) ?: mvfail("key ${open.info.key} was not granted $name")
|
|
662
|
+
val sealedvalue = seal(key, utf8(value), AAD_SECRET + name)
|
|
663
|
+
val found = findentry(vault, key)
|
|
664
|
+
|
|
665
|
+
if (null != found) {
|
|
666
|
+
found.value = sealedvalue
|
|
667
|
+
} else {
|
|
668
|
+
// A NEW NAME NEEDS THE NAME KEY, which only a master holds. So a
|
|
669
|
+
// restricted key with `write` updates what it was granted and
|
|
670
|
+
// cannot grow the vault.
|
|
671
|
+
val root = rootof(open, "creating the secret $name")
|
|
672
|
+
vault.entries.add(
|
|
673
|
+
EntryRecord(
|
|
674
|
+
entryid(key),
|
|
675
|
+
seal(mvhmac(root, LABEL_NAMES), utf8(name), AAD_NAME),
|
|
676
|
+
sealedvalue,
|
|
677
|
+
),
|
|
678
|
+
)
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
save(vault)
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/** Drop a name. Master only. */
|
|
686
|
+
fun remove(name: String) {
|
|
687
|
+
// Every write on this file, from any handle in this process,
|
|
688
|
+
// serializes here; see lockfor.
|
|
689
|
+
synchronized(lockfor(file)) {
|
|
690
|
+
checkname(name)
|
|
691
|
+
val (vault, open) = load()
|
|
692
|
+
val root = rootof(open, "removing a secret")
|
|
693
|
+
|
|
694
|
+
val wanted = entryid(secretkey(root, name))
|
|
695
|
+
val found = vault.entries.firstOrNull { it.id.contentEquals(wanted) }
|
|
696
|
+
?: mvfail("no such secret: $name")
|
|
697
|
+
|
|
698
|
+
vault.entries.remove(found)
|
|
699
|
+
save(vault)
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/** Every key in the file, with what it may do. Master only. */
|
|
704
|
+
fun keys(): List<VaultKeyInfo> {
|
|
705
|
+
val (vault, open) = load()
|
|
706
|
+
rootof(open, "listing the keys")
|
|
707
|
+
|
|
708
|
+
return vault.keys.map { record ->
|
|
709
|
+
val meta = metaof(open, record)
|
|
710
|
+
?: return@map VaultKeyInfo(record.id, false, false, emptyList())
|
|
711
|
+
|
|
712
|
+
val grants = (meta["grants"] as? List<*>)?.map { "$it" }?.sorted() ?: emptyList()
|
|
713
|
+
|
|
714
|
+
VaultKeyInfo(record.id, true == meta["master"], true == meta["write"], grants)
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/** Mint a restricted key. Master only. */
|
|
719
|
+
fun grant(spec: GrantSpec) {
|
|
720
|
+
// Every write on this file, from any handle in this process,
|
|
721
|
+
// serializes here; see lockfor.
|
|
722
|
+
synchronized(lockfor(file)) {
|
|
723
|
+
val (vault, open) = load()
|
|
724
|
+
val root = rootof(open, "granting a key")
|
|
725
|
+
|
|
726
|
+
val id = checkid(spec.key, "a grant needs a key id")
|
|
727
|
+
if (spec.passphrase.isEmpty()) {
|
|
728
|
+
mvfail("a grant needs a passphrase")
|
|
729
|
+
}
|
|
730
|
+
if (vault.keys.any { it.id == id }) {
|
|
731
|
+
mvfail("key already exists: $id")
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
val names = spec.names.sorted()
|
|
735
|
+
|
|
736
|
+
// A TreeMap, for a ring whose JSON is the same text on every run.
|
|
737
|
+
// It is NOT an interop requirement - the ring is sealed under a
|
|
738
|
+
// fresh nonce, so its ciphertext differs per write whatever the key
|
|
739
|
+
// order is. It is so that two runs of this port over the same grant
|
|
740
|
+
// produce the same plaintext.
|
|
741
|
+
val grants = TreeMap<String, Any?>()
|
|
742
|
+
for (name in names) {
|
|
743
|
+
checkname(name)
|
|
744
|
+
grants[name] = b64(secretkey(root, name))
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
vault.keys.add(
|
|
748
|
+
sealkey(
|
|
749
|
+
root, id, spec.passphrase, spec.iterations ?: iterations,
|
|
750
|
+
linkedMapOf("v" to FORMAT.toDouble(), "write" to spec.write,
|
|
751
|
+
"grants" to LinkedHashMap(grants)),
|
|
752
|
+
linkedMapOf("v" to FORMAT.toDouble(), "master" to false,
|
|
753
|
+
"write" to spec.write, "grants" to names),
|
|
754
|
+
),
|
|
755
|
+
)
|
|
756
|
+
|
|
757
|
+
save(vault)
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Drop a key. Master only.
|
|
763
|
+
*
|
|
764
|
+
* Anyone who already copied the file keeps whatever that key could
|
|
765
|
+
* read, so revoking bars future reads of the LIVE file and `rotate` is
|
|
766
|
+
* what takes a secret back.
|
|
767
|
+
*/
|
|
768
|
+
fun revoke(key: String) {
|
|
769
|
+
// Every write on this file, from any handle in this process,
|
|
770
|
+
// serializes here; see lockfor.
|
|
771
|
+
synchronized(lockfor(file)) {
|
|
772
|
+
val (vault, open) = load()
|
|
773
|
+
rootof(open, "revoking a key")
|
|
774
|
+
|
|
775
|
+
if (key == open.info.key) {
|
|
776
|
+
mvfail("a key cannot revoke itself: $key")
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
val found = vault.keys.firstOrNull { it.id == key } ?: mvfail("no such key: $key")
|
|
780
|
+
vault.keys.remove(found)
|
|
781
|
+
save(vault)
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/**
|
|
786
|
+
* A new root key, every value re-encrypted under it, and EVERY OTHER
|
|
787
|
+
* KEY DROPPED. Master only.
|
|
788
|
+
*
|
|
789
|
+
* The other keys go because they must: their rings are sealed under
|
|
790
|
+
* passphrases this process does not have. Re-grant afterwards.
|
|
791
|
+
*/
|
|
792
|
+
fun rotate() {
|
|
793
|
+
// Every write on this file, from any handle in this process,
|
|
794
|
+
// serializes here; see lockfor.
|
|
795
|
+
synchronized(lockfor(file)) {
|
|
796
|
+
val (vault, open) = load()
|
|
797
|
+
rootof(open, "rotating the vault")
|
|
798
|
+
|
|
799
|
+
// Read everything out under the old root before anything changes:
|
|
800
|
+
// once the root is replaced the old derived keys are unreachable.
|
|
801
|
+
val plain = list().map { it to (get(it) ?: "") }
|
|
802
|
+
|
|
803
|
+
val root = random(KEYLEN)
|
|
804
|
+
val namekey = mvhmac(root, LABEL_NAMES)
|
|
805
|
+
|
|
806
|
+
val fresh = VaultFile()
|
|
807
|
+
for ((name, value) in plain) {
|
|
808
|
+
val key = secretkey(root, name)
|
|
809
|
+
fresh.entries.add(
|
|
810
|
+
EntryRecord(
|
|
811
|
+
entryid(key),
|
|
812
|
+
seal(namekey, utf8(name), AAD_NAME),
|
|
813
|
+
seal(key, utf8(value), AAD_SECRET + name),
|
|
814
|
+
),
|
|
815
|
+
)
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
val iters = vault.keys.firstOrNull { it.id == keyid }?.iters ?: iterations
|
|
819
|
+
|
|
820
|
+
val record = sealkey(
|
|
821
|
+
root, keyid, passphrase, iters,
|
|
822
|
+
linkedMapOf("v" to FORMAT.toDouble(), "write" to true, "root" to b64(root)),
|
|
823
|
+
linkedMapOf("v" to FORMAT.toDouble(), "master" to true, "write" to true,
|
|
824
|
+
"grants" to emptyList<Any?>()),
|
|
825
|
+
)
|
|
826
|
+
fresh.keys.add(record)
|
|
827
|
+
|
|
828
|
+
// SAVE FIRST, adopt second. A handle holding the new root over a
|
|
829
|
+
// file that still holds the old one reads nothing and says the
|
|
830
|
+
// vault is damaged.
|
|
831
|
+
write(fresh)
|
|
832
|
+
|
|
833
|
+
opened = Opened(
|
|
834
|
+
VaultKeyInfo(keyid, true, true, emptyList()), root, emptyMap(), record.ring,
|
|
835
|
+
)
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// --- the inside ----------------------------------------------------
|
|
840
|
+
|
|
841
|
+
private fun bytes(): ByteArray = try {
|
|
842
|
+
Files.readAllBytes(Path.of(file))
|
|
843
|
+
} catch (err: NoSuchFileException) {
|
|
844
|
+
// A vault is configured deliberately, with a key. Its absence is a
|
|
845
|
+
// broken deployment and never "no secrets here": answering a miss
|
|
846
|
+
// would send the chain on to a weaker store.
|
|
847
|
+
if (!create) {
|
|
848
|
+
mvfail("no vault file: $file")
|
|
849
|
+
}
|
|
850
|
+
putnew(file, newvault(keyid, passphrase, iterations))
|
|
851
|
+
try {
|
|
852
|
+
Files.readAllBytes(Path.of(file))
|
|
853
|
+
} catch (again: IOException) {
|
|
854
|
+
mvfail("cannot read $file: ${again.message}")
|
|
855
|
+
}
|
|
856
|
+
} catch (err: IOException) {
|
|
857
|
+
mvfail("cannot read $file: ${err.message}")
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
private fun load(): Pair<VaultFile, Opened> {
|
|
861
|
+
val vault = readfile(bytes())
|
|
862
|
+
|
|
863
|
+
val record = vault.keys.firstOrNull { it.id == keyid }
|
|
864
|
+
if (null == record) {
|
|
865
|
+
// REVOKED, or never there. Either way this handle is finished,
|
|
866
|
+
// and dropping what it derived is what stops the next call
|
|
867
|
+
// answering from memory.
|
|
868
|
+
opened = null
|
|
869
|
+
mvfail("no such key: $keyid")
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
// The file still holds this key, and holds the SAME ring: a key
|
|
873
|
+
// revoked and re-granted under another passphrase is a different key
|
|
874
|
+
// wearing the id, and re-deriving is what refuses it.
|
|
875
|
+
val held = opened
|
|
876
|
+
if (null != held && held.ring == record.ring) {
|
|
877
|
+
return vault to held
|
|
878
|
+
}
|
|
879
|
+
opened = null
|
|
880
|
+
|
|
881
|
+
val plain = unseal(
|
|
882
|
+
kek(passphrase, record.salt, record.iters), record.ring, AAD_RING + keyid,
|
|
883
|
+
"wrong passphrase for key $keyid, or a damaged vault",
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
val ring = jsonof(plain, "key ring for $keyid")
|
|
887
|
+
|
|
888
|
+
val grants = LinkedHashMap<String, ByteArray>()
|
|
889
|
+
(ring["grants"] as? Map<*, *>)?.forEach { (name, key) ->
|
|
890
|
+
grants["$name"] = unb64(key, "a granted key")
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
val root = ring["root"]
|
|
894
|
+
|
|
895
|
+
val next = Opened(
|
|
896
|
+
VaultKeyInfo(
|
|
897
|
+
keyid, null != root, null != root || true == ring["write"],
|
|
898
|
+
grants.keys.sorted(),
|
|
899
|
+
),
|
|
900
|
+
if (null == root) null else unb64(root, "the root key"),
|
|
901
|
+
grants,
|
|
902
|
+
record.ring,
|
|
903
|
+
)
|
|
904
|
+
opened = next
|
|
905
|
+
|
|
906
|
+
return vault to next
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
private fun rootof(open: Opened, what: String): ByteArray =
|
|
910
|
+
open.root ?: mvfail("$what needs a master key, and ${open.info.key} is restricted")
|
|
911
|
+
|
|
912
|
+
/** The key for one name, or null when this key cannot reach it. */
|
|
913
|
+
private fun keyfor(open: Opened, name: String): ByteArray? {
|
|
914
|
+
val root = open.root
|
|
915
|
+
return if (null != root) secretkey(root, name) else open.grants[name]
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
private fun findentry(vault: VaultFile, key: ByteArray?): EntryRecord? {
|
|
919
|
+
if (null == key) {
|
|
920
|
+
return null
|
|
921
|
+
}
|
|
922
|
+
val id = entryid(key)
|
|
923
|
+
return vault.entries.firstOrNull { it.id.contentEquals(id) }
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
private fun metaof(open: Opened, record: KeyRecord): Map<String, Any?>? {
|
|
927
|
+
val root = rootof(open, "reading key metadata")
|
|
928
|
+
val what = "metadata for key ${record.id}"
|
|
929
|
+
|
|
930
|
+
return try {
|
|
931
|
+
jsonof(unseal(mvhmac(root, LABEL_META), record.meta, AAD_META + record.id, what), what)
|
|
932
|
+
} catch (err: SekretoError) {
|
|
933
|
+
// A record written under a root key this one has replaced. The
|
|
934
|
+
// key is still in the file and still opens with its own
|
|
935
|
+
// passphrase, so it is reported rather than hidden - with what
|
|
936
|
+
// it can do unknown.
|
|
937
|
+
null
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
private fun sealkey(
|
|
942
|
+
root: ByteArray,
|
|
943
|
+
id: String,
|
|
944
|
+
phrase: String,
|
|
945
|
+
iters: Int,
|
|
946
|
+
ring: Map<String, Any?>,
|
|
947
|
+
meta: Map<String, Any?>,
|
|
948
|
+
): KeyRecord {
|
|
949
|
+
val salt = random(SALTLEN)
|
|
950
|
+
return KeyRecord(
|
|
951
|
+
id, salt, iters,
|
|
952
|
+
seal(kek(phrase, salt, iters), utf8(stringify(ring)), AAD_RING + id),
|
|
953
|
+
seal(mvhmac(root, LABEL_META), utf8(stringify(meta)), AAD_META + id),
|
|
954
|
+
)
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
private fun save(vault: VaultFile) = write(vault)
|
|
958
|
+
|
|
959
|
+
/**
|
|
960
|
+
* Read, change, and REPLACE - never edit in place.
|
|
961
|
+
*
|
|
962
|
+
* THE TEMPORARY IS RANDOM AND EXCLUSIVE. `<vault>.<pid>.tmp` is a name
|
|
963
|
+
* anyone can predict, so anyone who can write the vault's directory
|
|
964
|
+
* could put a symlink there and have the next save truncate whatever it
|
|
965
|
+
* pointed at.
|
|
966
|
+
*/
|
|
967
|
+
private fun write(vault: VaultFile) {
|
|
968
|
+
val temp = Path.of(file + "." + random(8).joinToString("") {
|
|
969
|
+
"%02x".format(it.toInt() and 0xff)
|
|
970
|
+
} + ".tmp")
|
|
971
|
+
|
|
972
|
+
try {
|
|
973
|
+
Files.write(temp, writefile(vault), StandardOpenOption.CREATE_NEW,
|
|
974
|
+
StandardOpenOption.WRITE)
|
|
975
|
+
owneronly(temp)
|
|
976
|
+
Files.move(temp, Path.of(file), StandardCopyOption.REPLACE_EXISTING)
|
|
977
|
+
} catch (err: IOException) {
|
|
978
|
+
try {
|
|
979
|
+
Files.deleteIfExists(temp)
|
|
980
|
+
} catch (ignored: IOException) {
|
|
981
|
+
// The vault is unchanged either way, and the write error is
|
|
982
|
+
// what the caller needs to be told about.
|
|
983
|
+
}
|
|
984
|
+
mvfail("cannot write $file: ${err.message}")
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* Open a vault file as one key.
|
|
991
|
+
*
|
|
992
|
+
* The handle is lazy. Nothing is read, and no passphrase is stretched,
|
|
993
|
+
* until a method needs the file.
|
|
994
|
+
*/
|
|
995
|
+
fun openvault(options: VaultOptions): MiniVault = MiniVault(options)
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Make a vault file and return a handle on its master key.
|
|
999
|
+
*
|
|
1000
|
+
* Refuses a file that is already there: a vault is created once, and
|
|
1001
|
+
* overwriting one discards every secret in it.
|
|
1002
|
+
*/
|
|
1003
|
+
fun createvault(options: VaultOptions): MiniVault {
|
|
1004
|
+
if (options.file.isEmpty()) {
|
|
1005
|
+
mvfail("a vault needs a file")
|
|
1006
|
+
}
|
|
1007
|
+
if (options.passphrase.isEmpty()) {
|
|
1008
|
+
mvfail("a vault needs a passphrase")
|
|
1009
|
+
}
|
|
1010
|
+
val keyid = checkid(wantkey(options.key), "a vault needs a key id")
|
|
1011
|
+
|
|
1012
|
+
// No existence check first: the check and the write would be two steps,
|
|
1013
|
+
// and `putnew` refuses an existing file in ONE.
|
|
1014
|
+
putnew(options.file, newvault(keyid, options.passphrase, options.iterations))
|
|
1015
|
+
|
|
1016
|
+
return MiniVault(options)
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
// --- the provider ----------------------------------------------------
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Read a vault as one store in a chain.
|
|
1023
|
+
*
|
|
1024
|
+
* The provider is the READ half and nothing more: a chain resolves
|
|
1025
|
+
* secrets, and writing one is a deliberate act with an API of its own.
|
|
1026
|
+
*/
|
|
1027
|
+
fun providerof(vault: MiniVault): Provider = object : Provider {
|
|
1028
|
+
override fun lookup(name: String): String? = vault.get(name)
|
|
1029
|
+
|
|
1030
|
+
override fun describe(): String = "minivault:${vault.file()}"
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** A vault provider from options, for a chain built by hand. */
|
|
1034
|
+
fun minivaultprovider(options: VaultOptions): Provider = providerof(openvault(options))
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* The `minivault` provider kind, as a voxgig/plugin definition.
|
|
1038
|
+
*
|
|
1039
|
+
* Written out rather than built by `providerplugin`, because this
|
|
1040
|
+
* definition publishes TWO exports: `provider`, the read half every kind
|
|
1041
|
+
* publishes, and `vault`, the programmatic API.
|
|
1042
|
+
*/
|
|
1043
|
+
val minivault: Definition = mapOf(
|
|
1044
|
+
"name" to "minivault",
|
|
1045
|
+
"define" to { inst: Inst ->
|
|
1046
|
+
val spec = specof(inst.options)
|
|
1047
|
+
|
|
1048
|
+
val vault = try {
|
|
1049
|
+
// `openvault` refuses bad configuration HERE, so a mistyped
|
|
1050
|
+
// chain fails at construction. Reaching the FILE is not
|
|
1051
|
+
// configuration: the handle is lazy.
|
|
1052
|
+
openvault(
|
|
1053
|
+
VaultOptions(
|
|
1054
|
+
file = spec.file ?: "",
|
|
1055
|
+
passphrase = spec.passphrase ?: "",
|
|
1056
|
+
key = wantkey(spec.vaultkey),
|
|
1057
|
+
iterations = spec.iterations ?: MINIVAULT_ITERATIONS,
|
|
1058
|
+
create = true == spec.create,
|
|
1059
|
+
),
|
|
1060
|
+
)
|
|
1061
|
+
} catch (err: SekretoError) {
|
|
1062
|
+
val text = err.message ?: ""
|
|
1063
|
+
throw PluginError(ERROR_CODE, text, mapOf("ref" to inst.ref, "cause" to text))
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
inst.export(PROVIDER_EXPORT, providerof(vault))
|
|
1067
|
+
inst.export(VAULT_EXPORT, vault)
|
|
1068
|
+
},
|
|
1069
|
+
)
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* The vault behind a store in a chain, as its programmatic API.
|
|
1073
|
+
*
|
|
1074
|
+
* With no store named, the unqualified alias answers: one vault in the
|
|
1075
|
+
* chain resolves whatever it is called, and two raise rather than picking
|
|
1076
|
+
* one.
|
|
1077
|
+
*/
|
|
1078
|
+
fun vaultof(secrets: Sekreto, store: String? = null): MiniVault {
|
|
1079
|
+
if (null == store) {
|
|
1080
|
+
return secrets.host.exports("minivault/$VAULT_EXPORT") as? MiniVault
|
|
1081
|
+
?: mvfail("no minivault store in this chain")
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
// A NAMED STORE MUST EXIST, and the alias must not stand in for it.
|
|
1085
|
+
// `host.exports` falls back to the alias when the exact ref misses, so
|
|
1086
|
+
// asking for `minivault` in a chain whose only vault is named `app`
|
|
1087
|
+
// used to hand back the `app` vault - and then write to it.
|
|
1088
|
+
val ref = if ("minivault" == store) "minivault" else "minivault\$$store"
|
|
1089
|
+
|
|
1090
|
+
if (null == secrets.host.instance(ref)) {
|
|
1091
|
+
mvfail("no minivault store named $store in this chain")
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
return secrets.host.exports("$ref/$VAULT_EXPORT") as MiniVault
|
|
1095
|
+
}
|