@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,1250 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
// VENDORED: @voxgig/sekreto sdk-20260917-1242-0 (php/plugins/minivault.php)
|
|
3
|
+
// Source: https://github.com/voxgig/sekreto @ 108c4a914bee7b6534c30d1c68c25cd1b9377696 [tag: sdk-20260917-1242-0]
|
|
4
|
+
// License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The mini vault, as a voxgig/plugin definition.
|
|
8
|
+
*
|
|
9
|
+
* A port of typescript/plugins/minivault.ts, which is canonical.
|
|
10
|
+
*
|
|
11
|
+
* A PLUGIN, not a built-in: it needs crypto, which is the line the four
|
|
12
|
+
* built-ins stay behind.
|
|
13
|
+
*
|
|
14
|
+
* THE KEY DECIDES WHAT THE VAULT HOLDS. A master key reads and writes
|
|
15
|
+
* every name and mints restricted keys. A restricted key reads the names
|
|
16
|
+
* it was granted and CANNOT DERIVE ANY OTHER - the restriction is the
|
|
17
|
+
* cryptography rather than a check this code performs. What that does and
|
|
18
|
+
* does not protect is set out in DOCS.md under "What the mini vault
|
|
19
|
+
* protects".
|
|
20
|
+
*
|
|
21
|
+
* ext-openssl and ext-hash carry all four primitives, so nothing here is
|
|
22
|
+
* hand-rolled (AGENTS.md rule 3).
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
declare(strict_types=1);
|
|
26
|
+
|
|
27
|
+
namespace Voxgig\Sekreto\Plugins;
|
|
28
|
+
|
|
29
|
+
require_once __DIR__ . '/../src/Providers.php';
|
|
30
|
+
|
|
31
|
+
use Voxgig\Plugin\PluginError;
|
|
32
|
+
use Voxgig\Plugin\Inst;
|
|
33
|
+
use Voxgig\Sekreto\Name;
|
|
34
|
+
use Voxgig\Sekreto\Provider;
|
|
35
|
+
use Voxgig\Sekreto\SekretoError;
|
|
36
|
+
|
|
37
|
+
use const Voxgig\Sekreto\ERROR_CODE;
|
|
38
|
+
use const Voxgig\Sekreto\PROVIDER_EXPORT;
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* --- the format ------------------------------------------------------
|
|
42
|
+
*
|
|
43
|
+
* magic 4 'SKMV'
|
|
44
|
+
* version 1 FORMAT
|
|
45
|
+
* kdf 1 1 = PBKDF2-HMAC-SHA256
|
|
46
|
+
* cipher 1 1 = AES-256-GCM
|
|
47
|
+
* reserved 1 0
|
|
48
|
+
* keycount 4 uint32
|
|
49
|
+
* per key:
|
|
50
|
+
* id 1 + bytes the key id, PLAINTEXT
|
|
51
|
+
* salt 1 + bytes
|
|
52
|
+
* iters 4 PBKDF2 rounds for this key
|
|
53
|
+
* ring 1 + iv, 4 + bytes sealed under the passphrase
|
|
54
|
+
* meta 1 + iv, 4 + bytes sealed under the vault's meta key
|
|
55
|
+
* entrycount 4 uint32
|
|
56
|
+
* per entry:
|
|
57
|
+
* id 1 + bytes the blinded lookup id
|
|
58
|
+
* name 1 + iv, 4 + bytes sealed under the vault's name key
|
|
59
|
+
* value 1 + iv, 4 + bytes sealed under that secret's own key
|
|
60
|
+
*
|
|
61
|
+
* Integers are big-endian, and every length precedes its bytes. A file
|
|
62
|
+
* one port writes is read by every other; `test/fixture` pins that with a
|
|
63
|
+
* committed vault rather than with agreement.
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
const MV_MAGIC = 'SKMV';
|
|
67
|
+
const MV_FORMAT = 1;
|
|
68
|
+
const MV_KDF_PBKDF2 = 1;
|
|
69
|
+
const MV_CIPHER_AESGCM = 1;
|
|
70
|
+
|
|
71
|
+
/** AES-256-GCM: 32-byte keys, 12-byte nonces, 16-byte tags. */
|
|
72
|
+
const MV_KEYLEN = 32;
|
|
73
|
+
const MV_IVLEN = 12;
|
|
74
|
+
const MV_TAGLEN = 16;
|
|
75
|
+
const MV_SALTLEN = 16;
|
|
76
|
+
|
|
77
|
+
/** PBKDF2-HMAC-SHA256 rounds when a caller names none. */
|
|
78
|
+
const MV_ITERATIONS = 210000;
|
|
79
|
+
|
|
80
|
+
/** The key id a vault gets when a caller names none. */
|
|
81
|
+
const MV_MASTERKEY = 'master';
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
* Additional authenticated data. Every blob is bound to its PLACE in the
|
|
85
|
+
* file, so no ciphertext can be moved.
|
|
86
|
+
*/
|
|
87
|
+
const MV_AAD_RING = 'skmv1:ring:';
|
|
88
|
+
const MV_AAD_META = 'skmv1:meta:';
|
|
89
|
+
const MV_AAD_NAME = 'skmv1:name';
|
|
90
|
+
const MV_AAD_SECRET = 'skmv1:secret:';
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* Everything a master can reach is derived from the root key, so a
|
|
94
|
+
* rotation is one new random value rather than a re-wrap of each part.
|
|
95
|
+
*/
|
|
96
|
+
const MV_LABEL_NAMES = 'skmv1:names';
|
|
97
|
+
const MV_LABEL_META = 'skmv1:meta';
|
|
98
|
+
const MV_LABEL_ID = 'skmv1:id';
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The largest key id the format can record.
|
|
102
|
+
*
|
|
103
|
+
* `small` writes a length in ONE byte. A longer id wrapped that byte and
|
|
104
|
+
* the writer then appended the whole thing, so every field after it
|
|
105
|
+
* shifted. Checked where an id is ACCEPTED, so the refusal names the id
|
|
106
|
+
* rather than the file.
|
|
107
|
+
*/
|
|
108
|
+
const MV_IDMAX = 255;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The export key the vault API is published under, beside the `provider`
|
|
112
|
+
* key every kind publishes.
|
|
113
|
+
*/
|
|
114
|
+
const VAULT_EXPORT = 'vault';
|
|
115
|
+
|
|
116
|
+
/** @return never */
|
|
117
|
+
function mvfail(string $text): void
|
|
118
|
+
{
|
|
119
|
+
throw new SekretoError('sekreto: minivault: ' . $text);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function mvcheckid(mixed $id, string $what): string
|
|
123
|
+
{
|
|
124
|
+
if (!is_string($id) || '' === $id) {
|
|
125
|
+
mvfail($what);
|
|
126
|
+
}
|
|
127
|
+
if (strlen($id) > MV_IDMAX) {
|
|
128
|
+
mvfail('key id is longer than ' . MV_IDMAX . ' bytes: ' . substr($id, 0, 32) . '...');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return $id;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// --- keys ------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
function mvhmac(string $key, string $text): string
|
|
137
|
+
{
|
|
138
|
+
return hash_hmac('sha256', $text, $key, true);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** The key-encryption key a passphrase unwraps a ring with. */
|
|
142
|
+
function mvkek(string $passphrase, string $salt, int $iters): string
|
|
143
|
+
{
|
|
144
|
+
return hash_pbkdf2('sha256', $passphrase, $salt, $iters, MV_KEYLEN, true);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The key one named secret's value is encrypted with.
|
|
149
|
+
*
|
|
150
|
+
* DERIVED, never stored, for a master: it holds the root key and so
|
|
151
|
+
* reaches every name, including ones written after it was made. A
|
|
152
|
+
* restricted key holds the derived keys it was granted and nothing that
|
|
153
|
+
* produces another.
|
|
154
|
+
*/
|
|
155
|
+
function mvsecretkey(string $root, string $name): string
|
|
156
|
+
{
|
|
157
|
+
return mvhmac($root, MV_AAD_SECRET . $name);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Where a secret lives in the file, derived from its own key so that
|
|
162
|
+
* finding it needs no plaintext name.
|
|
163
|
+
*/
|
|
164
|
+
function mventryid(string $key): string
|
|
165
|
+
{
|
|
166
|
+
return mvhmac($key, MV_LABEL_ID);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function mvrandom(int $len): string
|
|
170
|
+
{
|
|
171
|
+
return random_bytes($len);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// --- sealing ---------------------------------------------------------
|
|
175
|
+
|
|
176
|
+
/** @return array{iv: string, blob: string} */
|
|
177
|
+
function mvseal(string $key, string $plain, string $aad): array
|
|
178
|
+
{
|
|
179
|
+
$iv = mvrandom(MV_IVLEN);
|
|
180
|
+
$tag = '';
|
|
181
|
+
$body = openssl_encrypt($plain, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv,
|
|
182
|
+
$tag, $aad, MV_TAGLEN);
|
|
183
|
+
|
|
184
|
+
if (false === $body) {
|
|
185
|
+
mvfail('cannot seal');
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return ['iv' => $iv, 'blob' => $body . $tag];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The plaintext, or a refusal. A GCM tag that fails to verify is the only
|
|
193
|
+
* evidence there is, and it cannot tell a wrong passphrase from a damaged
|
|
194
|
+
* file, so `what` names the attempt and the message admits both.
|
|
195
|
+
*
|
|
196
|
+
* @param array{iv: string, blob: string} $sealed
|
|
197
|
+
*/
|
|
198
|
+
function mvunseal(string $key, array $sealed, string $aad, string $what): string
|
|
199
|
+
{
|
|
200
|
+
$blob = $sealed['blob'];
|
|
201
|
+
$iv = $sealed['iv'];
|
|
202
|
+
|
|
203
|
+
if (strlen($blob) < MV_TAGLEN || MV_IVLEN !== strlen($iv)) {
|
|
204
|
+
mvfail($what . ': truncated');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
$tag = substr($blob, -MV_TAGLEN);
|
|
208
|
+
$body = substr($blob, 0, strlen($blob) - MV_TAGLEN);
|
|
209
|
+
|
|
210
|
+
// openssl_decrypt answers false rather than raising when the tag does
|
|
211
|
+
// not verify, and it also warns on a nonce of the wrong length; both
|
|
212
|
+
// are the same refusal to a caller.
|
|
213
|
+
$plain = @openssl_decrypt($body, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $iv, $tag, $aad);
|
|
214
|
+
|
|
215
|
+
if (false === $plain) {
|
|
216
|
+
mvfail($what);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return $plain;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** @return array<string, mixed> */
|
|
223
|
+
function mvjsonof(string $plain, string $what): array
|
|
224
|
+
{
|
|
225
|
+
$out = json_decode($plain, true);
|
|
226
|
+
|
|
227
|
+
if (!is_array($out)) {
|
|
228
|
+
mvfail('unreadable ' . $what);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return $out;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function mvb64(string $bytes): string
|
|
235
|
+
{
|
|
236
|
+
return base64_encode($bytes);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function mvunb64(mixed $text, string $what): string
|
|
240
|
+
{
|
|
241
|
+
if (!is_string($text)) {
|
|
242
|
+
mvfail('missing ' . $what);
|
|
243
|
+
}
|
|
244
|
+
$out = base64_decode($text, false);
|
|
245
|
+
|
|
246
|
+
if (false === $out) {
|
|
247
|
+
mvfail('missing ' . $what);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return $out;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// --- the file --------------------------------------------------------
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A cursor, so that every length check is in one place: a truncated vault
|
|
257
|
+
* is refused rather than read as a short one.
|
|
258
|
+
*/
|
|
259
|
+
final class MvReader
|
|
260
|
+
{
|
|
261
|
+
private int $at = 0;
|
|
262
|
+
|
|
263
|
+
public function __construct(private readonly string $bytes)
|
|
264
|
+
{
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
public function take(int $len): string
|
|
268
|
+
{
|
|
269
|
+
if (strlen($this->bytes) < $this->at + $len) {
|
|
270
|
+
mvfail('the vault file is truncated');
|
|
271
|
+
}
|
|
272
|
+
$out = substr($this->bytes, $this->at, $len);
|
|
273
|
+
$this->at += $len;
|
|
274
|
+
|
|
275
|
+
return $out;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
public function u8(): int
|
|
279
|
+
{
|
|
280
|
+
return ord($this->take(1));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
public function u32(): int
|
|
284
|
+
{
|
|
285
|
+
/** @var array{1: int} $out */
|
|
286
|
+
$out = unpack('N', $this->take(4));
|
|
287
|
+
|
|
288
|
+
return $out[1];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public function small(): string
|
|
292
|
+
{
|
|
293
|
+
return $this->take($this->u8());
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
public function large(): string
|
|
297
|
+
{
|
|
298
|
+
return $this->take($this->u32());
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
public function magic(): string
|
|
302
|
+
{
|
|
303
|
+
return $this->take(4);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** @return array{iv: string, blob: string} */
|
|
307
|
+
public function sealed(): array
|
|
308
|
+
{
|
|
309
|
+
return ['iv' => $this->small(), 'blob' => $this->large()];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
public function done(): bool
|
|
313
|
+
{
|
|
314
|
+
return $this->at === strlen($this->bytes);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/** @return array{keys: array<int, array<string, mixed>>, entries: array<int, array<string, mixed>>} */
|
|
319
|
+
function mvreadfile(string $bytes): array
|
|
320
|
+
{
|
|
321
|
+
$read = new MvReader($bytes);
|
|
322
|
+
|
|
323
|
+
if (MV_MAGIC !== $read->magic()) {
|
|
324
|
+
mvfail('not a vault file');
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
$version = $read->u8();
|
|
328
|
+
if (MV_FORMAT !== $version) {
|
|
329
|
+
mvfail('unsupported format version: ' . $version);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
$kdf = $read->u8();
|
|
333
|
+
$cipher = $read->u8();
|
|
334
|
+
if (MV_KDF_PBKDF2 !== $kdf || MV_CIPHER_AESGCM !== $cipher) {
|
|
335
|
+
mvfail('unsupported kdf or cipher: ' . $kdf . '/' . $cipher);
|
|
336
|
+
}
|
|
337
|
+
$read->u8();
|
|
338
|
+
|
|
339
|
+
$keys = [];
|
|
340
|
+
$keycount = $read->u32();
|
|
341
|
+
for ($index = 0; $index < $keycount; $index++) {
|
|
342
|
+
$id = $read->small();
|
|
343
|
+
$salt = $read->small();
|
|
344
|
+
$iters = $read->u32();
|
|
345
|
+
$keys[] = ['id' => $id, 'salt' => $salt, 'iters' => $iters,
|
|
346
|
+
'ring' => $read->sealed(), 'meta' => $read->sealed()];
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
$entries = [];
|
|
350
|
+
$entrycount = $read->u32();
|
|
351
|
+
for ($index = 0; $index < $entrycount; $index++) {
|
|
352
|
+
$entries[] = ['id' => $read->small(), 'name' => $read->sealed(),
|
|
353
|
+
'value' => $read->sealed()];
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (!$read->done()) {
|
|
357
|
+
mvfail('the vault file has trailing bytes');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return ['keys' => $keys, 'entries' => $entries];
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** @param array{keys: array<int, array<string, mixed>>, entries: array<int, array<string, mixed>>} $vault */
|
|
364
|
+
function mvwritefile(array $vault): string
|
|
365
|
+
{
|
|
366
|
+
$out = '';
|
|
367
|
+
|
|
368
|
+
$u8 = function (int $value) use (&$out): void {
|
|
369
|
+
$out .= chr($value);
|
|
370
|
+
};
|
|
371
|
+
$u32 = function (int $value) use (&$out): void {
|
|
372
|
+
$out .= pack('N', $value);
|
|
373
|
+
};
|
|
374
|
+
$small = function (string $bytes) use (&$out, $u8): void {
|
|
375
|
+
$u8(strlen($bytes));
|
|
376
|
+
$out .= $bytes;
|
|
377
|
+
};
|
|
378
|
+
$large = function (string $bytes) use (&$out, $u32): void {
|
|
379
|
+
$u32(strlen($bytes));
|
|
380
|
+
$out .= $bytes;
|
|
381
|
+
};
|
|
382
|
+
$sealed = function (array $value) use ($small, $large): void {
|
|
383
|
+
$small($value['iv']);
|
|
384
|
+
$large($value['blob']);
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
$out .= MV_MAGIC;
|
|
388
|
+
$u8(MV_FORMAT);
|
|
389
|
+
$u8(MV_KDF_PBKDF2);
|
|
390
|
+
$u8(MV_CIPHER_AESGCM);
|
|
391
|
+
$u8(0);
|
|
392
|
+
|
|
393
|
+
$u32(count($vault['keys']));
|
|
394
|
+
foreach ($vault['keys'] as $key) {
|
|
395
|
+
$small($key['id']);
|
|
396
|
+
$small($key['salt']);
|
|
397
|
+
$u32($key['iters']);
|
|
398
|
+
$sealed($key['ring']);
|
|
399
|
+
$sealed($key['meta']);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// SORTED BY ID, which is a blinded value: the file therefore records
|
|
403
|
+
// nothing about the order secrets were written in.
|
|
404
|
+
$entries = $vault['entries'];
|
|
405
|
+
usort($entries, fn(array $left, array $right) => strcmp($left['id'], $right['id']));
|
|
406
|
+
|
|
407
|
+
$u32(count($entries));
|
|
408
|
+
foreach ($entries as $entry) {
|
|
409
|
+
$small($entry['id']);
|
|
410
|
+
$sealed($entry['name']);
|
|
411
|
+
$sealed($entry['value']);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return $out;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// --- creating --------------------------------------------------------
|
|
418
|
+
|
|
419
|
+
/** A new vault: one master key, no secrets. */
|
|
420
|
+
function mvnew(string $keyid, string $passphrase, int $iterations): array
|
|
421
|
+
{
|
|
422
|
+
$root = mvrandom(MV_KEYLEN);
|
|
423
|
+
$salt = mvrandom(MV_SALTLEN);
|
|
424
|
+
|
|
425
|
+
$ring = ['v' => MV_FORMAT, 'write' => true, 'root' => mvb64($root)];
|
|
426
|
+
$meta = ['v' => MV_FORMAT, 'master' => true, 'write' => true, 'grants' => []];
|
|
427
|
+
|
|
428
|
+
return [
|
|
429
|
+
'keys' => [[
|
|
430
|
+
'id' => $keyid,
|
|
431
|
+
'salt' => $salt,
|
|
432
|
+
'iters' => $iterations,
|
|
433
|
+
'ring' => mvseal(mvkek($passphrase, $salt, $iterations),
|
|
434
|
+
mvjson($ring), MV_AAD_RING . $keyid),
|
|
435
|
+
'meta' => mvseal(mvhmac($root, MV_LABEL_META),
|
|
436
|
+
mvjson($meta), MV_AAD_META . $keyid),
|
|
437
|
+
]],
|
|
438
|
+
'entries' => [],
|
|
439
|
+
];
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* JSON the way every other port writes it: a ring's `grants` is an OBJECT
|
|
444
|
+
* keyed by secret name, and a meta record's is an ARRAY of names. PHP has
|
|
445
|
+
* one `[]` for both, so the ring's is forced to `stdClass` and the meta's
|
|
446
|
+
* is left as the list it already is. A ring is the one with no `master`.
|
|
447
|
+
*
|
|
448
|
+
* FORCED WHATEVER IS IN IT, not only when it is empty, and that is the
|
|
449
|
+
* whole of the bug this once had. `api.token` is a valid secret name and
|
|
450
|
+
* so is `0`: PHP turns the string key `"0"` into the integer key `0`, and
|
|
451
|
+
* `json_encode` writes an array for any map whose keys are `0..n`. So one
|
|
452
|
+
* grant named `0` wrote `"grants":["..."]`, which PHP reads back as its
|
|
453
|
+
* own map and no other port can read at all - java sees an array where it
|
|
454
|
+
* wants an object and the restricted key reaches nothing.
|
|
455
|
+
*
|
|
456
|
+
* @param array<string, mixed> $value
|
|
457
|
+
*/
|
|
458
|
+
function mvjson(array $value): string
|
|
459
|
+
{
|
|
460
|
+
if (isset($value['grants']) && !isset($value['master'])) {
|
|
461
|
+
$value['grants'] = (object) $value['grants'];
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return json_encode($value, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* `fopen` under `x` — O_CREAT|O_EXCL — with the umask set so the kernel
|
|
469
|
+
* creates the file 0600 and no wider.
|
|
470
|
+
*
|
|
471
|
+
* WHY NOT fopen-THEN-chmod, which this used to do: between the two calls
|
|
472
|
+
* the file exists at 0666 & ~umask, and another local user watching a
|
|
473
|
+
* shared directory can open it for writing and keep that descriptor after
|
|
474
|
+
* the chmod lands. PHP has no way to pass a mode to `fopen`, so the umask
|
|
475
|
+
* is the only way to ask the kernel for the mode AT CREATION. It is
|
|
476
|
+
* process-global for the width of this call, which is what every PHP
|
|
477
|
+
* program that needs a private file does.
|
|
478
|
+
*/
|
|
479
|
+
function mvcreate(string $path)
|
|
480
|
+
{
|
|
481
|
+
$was = umask(0o077);
|
|
482
|
+
|
|
483
|
+
try {
|
|
484
|
+
return @fopen($path, 'xb');
|
|
485
|
+
} finally {
|
|
486
|
+
umask($was);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Write a vault file that is not there yet, and REFUSE one that is.
|
|
492
|
+
*
|
|
493
|
+
* Straight to the target under `x` — `O_CREAT|O_EXCL` — rather than
|
|
494
|
+
* through a temporary and a rename. `rename` REPLACES its destination, so
|
|
495
|
+
* two processes creating the same vault both succeeded and the second
|
|
496
|
+
* discarded the first one's secrets.
|
|
497
|
+
*/
|
|
498
|
+
function mvputnew(string $file, array $vault): void
|
|
499
|
+
{
|
|
500
|
+
$handle = mvcreate($file);
|
|
501
|
+
|
|
502
|
+
if (false === $handle) {
|
|
503
|
+
if (file_exists($file)) {
|
|
504
|
+
mvfail('vault file already exists: ' . $file);
|
|
505
|
+
}
|
|
506
|
+
mvfail('cannot write ' . $file);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
try {
|
|
510
|
+
// A SHORT WRITE IS NOT A WRITE. `fwrite` answers the byte count,
|
|
511
|
+
// and under a quota or a full disk that count is positive and less
|
|
512
|
+
// than what it was handed - which `false ===` took for success.
|
|
513
|
+
$raw = mvwritefile($vault);
|
|
514
|
+
if (strlen($raw) !== fwrite($handle, $raw)) {
|
|
515
|
+
mvfail('cannot write ' . $file);
|
|
516
|
+
}
|
|
517
|
+
} finally {
|
|
518
|
+
fclose($handle);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** Is this the same sealed blob, byte for byte? */
|
|
523
|
+
function mvsameseal(array $left, array $right): bool
|
|
524
|
+
{
|
|
525
|
+
return $left['iv'] === $right['iv'] && $left['blob'] === $right['blob'];
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* A handle on one vault file, opened as ONE key.
|
|
530
|
+
*
|
|
531
|
+
* Every method answers as that key: `list` shows the names it may read,
|
|
532
|
+
* `get` answers for those and misses on the rest, and the master-only
|
|
533
|
+
* methods refuse for any other key. Nothing is read or derived until the
|
|
534
|
+
* first call that needs the file.
|
|
535
|
+
*/
|
|
536
|
+
final class MiniVault
|
|
537
|
+
{
|
|
538
|
+
private readonly string $file;
|
|
539
|
+
private readonly string $keyid;
|
|
540
|
+
private readonly string $passphrase;
|
|
541
|
+
private readonly int $iterations;
|
|
542
|
+
private readonly bool $create;
|
|
543
|
+
|
|
544
|
+
/** @var array<string, mixed>|null */
|
|
545
|
+
private ?array $opened = null;
|
|
546
|
+
|
|
547
|
+
/** @param array<string, mixed> $options */
|
|
548
|
+
public function __construct(array $options)
|
|
549
|
+
{
|
|
550
|
+
$file = $options['file'] ?? null;
|
|
551
|
+
$passphrase = $options['passphrase'] ?? null;
|
|
552
|
+
|
|
553
|
+
if (!is_string($file) || '' === $file) {
|
|
554
|
+
mvfail('a vault needs a file');
|
|
555
|
+
}
|
|
556
|
+
if (!is_string($passphrase) || '' === $passphrase) {
|
|
557
|
+
mvfail('a vault needs a passphrase');
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
$this->file = $file;
|
|
561
|
+
$this->passphrase = $passphrase;
|
|
562
|
+
// AN EMPTY KEY IS NO KEY, so it means `master` - `??` answers for
|
|
563
|
+
// null alone, and the canonical's `opts.key || MASTERKEY` answers
|
|
564
|
+
// for both. A CLI reaches this with SEKRETO_VAULT_KEY set and
|
|
565
|
+
// empty, which is what an unset shell variable expands to.
|
|
566
|
+
$wantkey = (string) ($options['key'] ?? '');
|
|
567
|
+
$this->keyid = mvcheckid('' === $wantkey ? MV_MASTERKEY : $wantkey,
|
|
568
|
+
'a vault needs a key id');
|
|
569
|
+
$this->iterations = (int) ($options['iterations'] ?? MV_ITERATIONS);
|
|
570
|
+
$this->create = true === ($options['create'] ?? false);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/** The file this handle reads. */
|
|
574
|
+
public function file(): string
|
|
575
|
+
{
|
|
576
|
+
return $this->file;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/** The key id this handle opens with. */
|
|
580
|
+
public function key(): string
|
|
581
|
+
{
|
|
582
|
+
return $this->keyid;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Derive the key and read the file NOW rather than at first use.
|
|
587
|
+
*
|
|
588
|
+
* A COPY. `set` reads `write` to decide whether this key may write, so
|
|
589
|
+
* handing the caller the live record let it flip its own permission.
|
|
590
|
+
* Authorization state does not leave this object.
|
|
591
|
+
*
|
|
592
|
+
* @return array<string, mixed>
|
|
593
|
+
*/
|
|
594
|
+
public function open(): array
|
|
595
|
+
{
|
|
596
|
+
[, $opened] = $this->load();
|
|
597
|
+
$info = $opened['info'];
|
|
598
|
+
|
|
599
|
+
return ['key' => $info['key'], 'master' => $info['master'],
|
|
600
|
+
'write' => $info['write'], 'grants' => array_values($info['grants'])];
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
/** Forget the derived keys. The next call opens again. */
|
|
604
|
+
public function close(): void
|
|
605
|
+
{
|
|
606
|
+
$this->opened = null;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/**
|
|
610
|
+
* The names this key can read, sorted.
|
|
611
|
+
*
|
|
612
|
+
* @return array<int, string>
|
|
613
|
+
*/
|
|
614
|
+
public function list(): array
|
|
615
|
+
{
|
|
616
|
+
[$vault, $opened] = $this->load();
|
|
617
|
+
|
|
618
|
+
if (null !== $opened['root']) {
|
|
619
|
+
$namekey = mvhmac($opened['root'], MV_LABEL_NAMES);
|
|
620
|
+
$out = [];
|
|
621
|
+
foreach ($vault['entries'] as $entry) {
|
|
622
|
+
$out[] = mvunseal($namekey, $entry['name'], MV_AAD_NAME,
|
|
623
|
+
'a secret name is damaged');
|
|
624
|
+
}
|
|
625
|
+
sort($out);
|
|
626
|
+
|
|
627
|
+
return $out;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// A restricted key has no name key, so it reports the grants it can
|
|
631
|
+
// actually find: the vault never tells it what else is in there.
|
|
632
|
+
$out = [];
|
|
633
|
+
foreach ($opened['info']['grants'] as $name) {
|
|
634
|
+
if (null !== $this->findentry($vault, $opened['grants'][$name])) {
|
|
635
|
+
$out[] = $name;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
sort($out);
|
|
639
|
+
|
|
640
|
+
return $out;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
public function has(string $name): bool
|
|
644
|
+
{
|
|
645
|
+
return null !== $this->get($name);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/**
|
|
649
|
+
* The value, or null when the vault does not hold that name or this
|
|
650
|
+
* key was not granted it.
|
|
651
|
+
*/
|
|
652
|
+
public function get(string $name): ?string
|
|
653
|
+
{
|
|
654
|
+
Name::check($name);
|
|
655
|
+
[$vault, $opened] = $this->load();
|
|
656
|
+
|
|
657
|
+
$key = $this->keyfor($opened, $name);
|
|
658
|
+
if (null === $key) {
|
|
659
|
+
// OUTSIDE THE GRANT IS A MISS, deliberately. The vault answers
|
|
660
|
+
// as the key that opened it, so a name this key cannot read is
|
|
661
|
+
// a name this store does not hold for this caller.
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
$entry = $this->findentry($vault, $key);
|
|
666
|
+
if (null === $entry) {
|
|
667
|
+
return null;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
return mvunseal($key, $entry['value'], MV_AAD_SECRET . $name,
|
|
671
|
+
'the value of ' . $name . ' is damaged');
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Write a value. A master writes any name; a restricted key holding
|
|
676
|
+
* `write` overwrites the names it was granted, and creates none.
|
|
677
|
+
*/
|
|
678
|
+
public function set(string $name, string $value): void
|
|
679
|
+
{
|
|
680
|
+
Name::check($name);
|
|
681
|
+
[$vault, $opened] = $this->load();
|
|
682
|
+
|
|
683
|
+
if (!$opened['info']['write']) {
|
|
684
|
+
mvfail('key ' . $opened['info']['key'] . ' is read-only');
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
$key = $this->keyfor($opened, $name);
|
|
688
|
+
if (null === $key) {
|
|
689
|
+
mvfail('key ' . $opened['info']['key'] . ' was not granted ' . $name);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
$sealedvalue = mvseal($key, $value, MV_AAD_SECRET . $name);
|
|
693
|
+
$id = mventryid($key);
|
|
694
|
+
|
|
695
|
+
$at = null;
|
|
696
|
+
foreach ($vault['entries'] as $index => $entry) {
|
|
697
|
+
if ($entry['id'] === $id) {
|
|
698
|
+
$at = $index;
|
|
699
|
+
break;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
if (null !== $at) {
|
|
704
|
+
$vault['entries'][$at]['value'] = $sealedvalue;
|
|
705
|
+
} else {
|
|
706
|
+
// A NEW NAME NEEDS THE NAME KEY, which only a master holds. So
|
|
707
|
+
// a restricted key with `write` updates what it was granted and
|
|
708
|
+
// cannot grow the vault.
|
|
709
|
+
$root = $this->rootof($opened, 'creating the secret ' . $name);
|
|
710
|
+
$vault['entries'][] = [
|
|
711
|
+
'id' => $id,
|
|
712
|
+
'name' => mvseal(mvhmac($root, MV_LABEL_NAMES), $name, MV_AAD_NAME),
|
|
713
|
+
'value' => $sealedvalue,
|
|
714
|
+
];
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
$this->save($vault);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/** Drop a name. Master only. */
|
|
721
|
+
public function remove(string $name): void
|
|
722
|
+
{
|
|
723
|
+
Name::check($name);
|
|
724
|
+
[$vault, $opened] = $this->load();
|
|
725
|
+
$root = $this->rootof($opened, 'removing a secret');
|
|
726
|
+
|
|
727
|
+
$wanted = mventryid(mvsecretkey($root, $name));
|
|
728
|
+
$at = null;
|
|
729
|
+
foreach ($vault['entries'] as $index => $entry) {
|
|
730
|
+
if ($entry['id'] === $wanted) {
|
|
731
|
+
$at = $index;
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if (null === $at) {
|
|
736
|
+
mvfail('no such secret: ' . $name);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
array_splice($vault['entries'], $at, 1);
|
|
740
|
+
$this->save($vault);
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/**
|
|
744
|
+
* Every key in the file, with what it may do. Master only.
|
|
745
|
+
*
|
|
746
|
+
* @return array<int, array<string, mixed>>
|
|
747
|
+
*/
|
|
748
|
+
public function keys(): array
|
|
749
|
+
{
|
|
750
|
+
[$vault, $opened] = $this->load();
|
|
751
|
+
$this->rootof($opened, 'listing the keys');
|
|
752
|
+
|
|
753
|
+
$out = [];
|
|
754
|
+
foreach ($vault['keys'] as $record) {
|
|
755
|
+
$meta = $this->metaof($opened, $record);
|
|
756
|
+
if (null === $meta) {
|
|
757
|
+
$out[] = ['key' => $record['id'], 'master' => false,
|
|
758
|
+
'write' => false, 'grants' => []];
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
$grants = $meta['grants'] ?? [];
|
|
762
|
+
sort($grants);
|
|
763
|
+
$out[] = ['key' => $record['id'], 'master' => true === ($meta['master'] ?? false),
|
|
764
|
+
'write' => true === ($meta['write'] ?? false), 'grants' => $grants];
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
return $out;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Mint a restricted key. Master only.
|
|
772
|
+
*
|
|
773
|
+
* @param array<string, mixed> $spec
|
|
774
|
+
*/
|
|
775
|
+
public function grant(array $spec): void
|
|
776
|
+
{
|
|
777
|
+
[$vault, $opened] = $this->load();
|
|
778
|
+
$root = $this->rootof($opened, 'granting a key');
|
|
779
|
+
|
|
780
|
+
$id = mvcheckid($spec['key'] ?? null, 'a grant needs a key id');
|
|
781
|
+
$phrase = $spec['passphrase'] ?? null;
|
|
782
|
+
if (!is_string($phrase) || '' === $phrase) {
|
|
783
|
+
mvfail('a grant needs a passphrase');
|
|
784
|
+
}
|
|
785
|
+
foreach ($vault['keys'] as $key) {
|
|
786
|
+
if ($key['id'] === $id) {
|
|
787
|
+
mvfail('key already exists: ' . $id);
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
$names = $spec['names'] ?? [];
|
|
792
|
+
sort($names);
|
|
793
|
+
$grants = [];
|
|
794
|
+
foreach ($names as $name) {
|
|
795
|
+
Name::check($name);
|
|
796
|
+
$grants[$name] = mvb64(mvsecretkey($root, $name));
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
$write = true === ($spec['write'] ?? false);
|
|
800
|
+
$vault['keys'][] = $this->sealkey(
|
|
801
|
+
$root, $id, $phrase, (int) ($spec['iterations'] ?? $this->iterations),
|
|
802
|
+
['v' => MV_FORMAT, 'write' => $write, 'grants' => $grants],
|
|
803
|
+
['v' => MV_FORMAT, 'master' => false, 'write' => $write, 'grants' => $names]
|
|
804
|
+
);
|
|
805
|
+
|
|
806
|
+
$this->save($vault);
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* Drop a key. Master only.
|
|
811
|
+
*
|
|
812
|
+
* Anyone who already copied the file keeps whatever that key could
|
|
813
|
+
* read, so revoking bars future reads of the LIVE file and `rotate` is
|
|
814
|
+
* what takes a secret back.
|
|
815
|
+
*/
|
|
816
|
+
public function revoke(string $key): void
|
|
817
|
+
{
|
|
818
|
+
[$vault, $opened] = $this->load();
|
|
819
|
+
$this->rootof($opened, 'revoking a key');
|
|
820
|
+
|
|
821
|
+
if ($key === $opened['info']['key']) {
|
|
822
|
+
mvfail('a key cannot revoke itself: ' . $key);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
$at = null;
|
|
826
|
+
foreach ($vault['keys'] as $index => $record) {
|
|
827
|
+
if ($record['id'] === $key) {
|
|
828
|
+
$at = $index;
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
if (null === $at) {
|
|
833
|
+
mvfail('no such key: ' . $key);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
array_splice($vault['keys'], $at, 1);
|
|
837
|
+
$this->save($vault);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* A new root key, every value re-encrypted under it, and EVERY OTHER
|
|
842
|
+
* KEY DROPPED. Master only.
|
|
843
|
+
*
|
|
844
|
+
* The other keys go because they must: their rings are sealed under
|
|
845
|
+
* passphrases this process does not have. Re-grant afterwards.
|
|
846
|
+
*/
|
|
847
|
+
public function rotate(): void
|
|
848
|
+
{
|
|
849
|
+
[$vault, $opened] = $this->load();
|
|
850
|
+
$this->rootof($opened, 'rotating the vault');
|
|
851
|
+
|
|
852
|
+
// Read everything out under the old root before anything changes:
|
|
853
|
+
// once the root is replaced the old derived keys are unreachable.
|
|
854
|
+
$plain = [];
|
|
855
|
+
foreach ($this->list() as $name) {
|
|
856
|
+
$plain[$name] = $this->get($name);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
$root = mvrandom(MV_KEYLEN);
|
|
860
|
+
$namekey = mvhmac($root, MV_LABEL_NAMES);
|
|
861
|
+
|
|
862
|
+
$entries = [];
|
|
863
|
+
foreach ($plain as $name => $value) {
|
|
864
|
+
$key = mvsecretkey($root, (string) $name);
|
|
865
|
+
$entries[] = [
|
|
866
|
+
'id' => mventryid($key),
|
|
867
|
+
'name' => mvseal($namekey, (string) $name, MV_AAD_NAME),
|
|
868
|
+
'value' => mvseal($key, $value, MV_AAD_SECRET . $name),
|
|
869
|
+
];
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
$iters = $this->iterations;
|
|
873
|
+
foreach ($vault['keys'] as $record) {
|
|
874
|
+
if ($record['id'] === $this->keyid) {
|
|
875
|
+
$iters = $record['iters'];
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
$fresh = $this->sealkey(
|
|
880
|
+
$root, $this->keyid, $this->passphrase, $iters,
|
|
881
|
+
['v' => MV_FORMAT, 'write' => true, 'root' => mvb64($root)],
|
|
882
|
+
['v' => MV_FORMAT, 'master' => true, 'write' => true, 'grants' => []]
|
|
883
|
+
);
|
|
884
|
+
|
|
885
|
+
// SAVE FIRST, adopt second. A handle holding the new root over a
|
|
886
|
+
// file that still holds the old one reads nothing and says the
|
|
887
|
+
// vault is damaged.
|
|
888
|
+
$this->save(['keys' => [$fresh], 'entries' => $entries]);
|
|
889
|
+
|
|
890
|
+
$this->opened = [
|
|
891
|
+
'info' => ['key' => $this->keyid, 'master' => true, 'write' => true, 'grants' => []],
|
|
892
|
+
'root' => $root,
|
|
893
|
+
'grants' => [],
|
|
894
|
+
'ring' => $fresh['ring'],
|
|
895
|
+
];
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
private function bytes(): string
|
|
899
|
+
{
|
|
900
|
+
$raw = @file_get_contents($this->file);
|
|
901
|
+
|
|
902
|
+
if (false !== $raw) {
|
|
903
|
+
return $raw;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
// A vault is configured deliberately, with a key. Its absence is a
|
|
907
|
+
// broken deployment and never "no secrets here": answering a miss
|
|
908
|
+
// would send the chain on to a weaker store.
|
|
909
|
+
if (!file_exists($this->file)) {
|
|
910
|
+
if (!$this->create) {
|
|
911
|
+
mvfail('no vault file: ' . $this->file);
|
|
912
|
+
}
|
|
913
|
+
mvputnew($this->file, mvnew($this->keyid, $this->passphrase, $this->iterations));
|
|
914
|
+
$raw = @file_get_contents($this->file);
|
|
915
|
+
if (false !== $raw) {
|
|
916
|
+
return $raw;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
mvfail('cannot read ' . $this->file);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
/** @return array{0: array<string, mixed>, 1: array<string, mixed>} */
|
|
924
|
+
private function load(): array
|
|
925
|
+
{
|
|
926
|
+
$vault = mvreadfile($this->bytes());
|
|
927
|
+
|
|
928
|
+
$record = null;
|
|
929
|
+
foreach ($vault['keys'] as $key) {
|
|
930
|
+
if ($key['id'] === $this->keyid) {
|
|
931
|
+
$record = $key;
|
|
932
|
+
break;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
if (null === $record) {
|
|
936
|
+
// REVOKED, or never there. Either way this handle is finished,
|
|
937
|
+
// and dropping what it derived is what stops the next call
|
|
938
|
+
// answering from memory.
|
|
939
|
+
$this->opened = null;
|
|
940
|
+
mvfail('no such key: ' . $this->keyid);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
// The file still holds this key, and holds the SAME ring: a key
|
|
944
|
+
// revoked and re-granted under another passphrase is a different
|
|
945
|
+
// key wearing the id, and re-deriving is what refuses it.
|
|
946
|
+
if (null !== $this->opened && mvsameseal($this->opened['ring'], $record['ring'])) {
|
|
947
|
+
return [$vault, $this->opened];
|
|
948
|
+
}
|
|
949
|
+
$this->opened = null;
|
|
950
|
+
|
|
951
|
+
$plain = mvunseal(
|
|
952
|
+
mvkek($this->passphrase, $record['salt'], $record['iters']),
|
|
953
|
+
$record['ring'], MV_AAD_RING . $this->keyid,
|
|
954
|
+
'wrong passphrase for key ' . $this->keyid . ', or a damaged vault'
|
|
955
|
+
);
|
|
956
|
+
|
|
957
|
+
$ring = mvjsonof($plain, 'key ring for ' . $this->keyid);
|
|
958
|
+
|
|
959
|
+
$grants = [];
|
|
960
|
+
foreach (($ring['grants'] ?? []) as $name => $key) {
|
|
961
|
+
$grants[$name] = mvunb64($key, 'a granted key');
|
|
962
|
+
}
|
|
963
|
+
// `strval`, and it is the same PHP rule as the one `mvjson` fights
|
|
964
|
+
// on the way out: `array_keys` hands back an INTEGER for the key
|
|
965
|
+
// "0", so a grant on a numerically named secret would reach the
|
|
966
|
+
// caller as `[0]` where every other port answers `["0"]`.
|
|
967
|
+
$names = array_map('strval', array_keys($grants));
|
|
968
|
+
sort($names);
|
|
969
|
+
|
|
970
|
+
$this->opened = [
|
|
971
|
+
'info' => [
|
|
972
|
+
'key' => $this->keyid,
|
|
973
|
+
'master' => isset($ring['root']),
|
|
974
|
+
'write' => isset($ring['root']) || true === ($ring['write'] ?? false),
|
|
975
|
+
'grants' => $names,
|
|
976
|
+
],
|
|
977
|
+
'root' => isset($ring['root']) ? mvunb64($ring['root'], 'the root key') : null,
|
|
978
|
+
'grants' => $grants,
|
|
979
|
+
'ring' => $record['ring'],
|
|
980
|
+
];
|
|
981
|
+
|
|
982
|
+
return [$vault, $this->opened];
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
private function rootof(array $opened, string $what): string
|
|
986
|
+
{
|
|
987
|
+
if (null === $opened['root']) {
|
|
988
|
+
mvfail($what . ' needs a master key, and ' . $opened['info']['key'] .
|
|
989
|
+
' is restricted');
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
return $opened['root'];
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/** The key for one name, or null when this key cannot reach it. */
|
|
996
|
+
private function keyfor(array $opened, string $name): ?string
|
|
997
|
+
{
|
|
998
|
+
if (null !== $opened['root']) {
|
|
999
|
+
return mvsecretkey($opened['root'], $name);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return $opened['grants'][$name] ?? null;
|
|
1003
|
+
}
|
|
1004
|
+
|
|
1005
|
+
private function findentry(array $vault, ?string $key): ?array
|
|
1006
|
+
{
|
|
1007
|
+
if (null === $key) {
|
|
1008
|
+
return null;
|
|
1009
|
+
}
|
|
1010
|
+
$id = mventryid($key);
|
|
1011
|
+
foreach ($vault['entries'] as $entry) {
|
|
1012
|
+
if ($entry['id'] === $id) {
|
|
1013
|
+
return $entry;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
return null;
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
private function metaof(array $opened, array $record): ?array
|
|
1021
|
+
{
|
|
1022
|
+
$root = $this->rootof($opened, 'reading key metadata');
|
|
1023
|
+
$what = 'metadata for key ' . $record['id'];
|
|
1024
|
+
|
|
1025
|
+
try {
|
|
1026
|
+
return mvjsonof(
|
|
1027
|
+
mvunseal(mvhmac($root, MV_LABEL_META), $record['meta'],
|
|
1028
|
+
MV_AAD_META . $record['id'], $what),
|
|
1029
|
+
$what
|
|
1030
|
+
);
|
|
1031
|
+
} catch (SekretoError) {
|
|
1032
|
+
// A record written under a root key this one has replaced. The
|
|
1033
|
+
// key is still in the file and still opens with its own
|
|
1034
|
+
// passphrase, so it is reported rather than hidden - with what
|
|
1035
|
+
// it can do unknown.
|
|
1036
|
+
return null;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
private function sealkey(string $root, string $id, string $phrase, int $iters,
|
|
1041
|
+
array $ring, array $meta): array
|
|
1042
|
+
{
|
|
1043
|
+
$salt = mvrandom(MV_SALTLEN);
|
|
1044
|
+
|
|
1045
|
+
return [
|
|
1046
|
+
'id' => $id,
|
|
1047
|
+
'salt' => $salt,
|
|
1048
|
+
'iters' => $iters,
|
|
1049
|
+
'ring' => mvseal(mvkek($phrase, $salt, $iters), mvjson($ring), MV_AAD_RING . $id),
|
|
1050
|
+
'meta' => mvseal(mvhmac($root, MV_LABEL_META), mvjson($meta), MV_AAD_META . $id),
|
|
1051
|
+
];
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Read, change, and REPLACE - never edit in place.
|
|
1056
|
+
*
|
|
1057
|
+
* THE TEMPORARY IS RANDOM AND EXCLUSIVE. `<vault>.<pid>.tmp` is a name
|
|
1058
|
+
* anyone can predict, so anyone who can write the vault's directory
|
|
1059
|
+
* could put a symlink there and have the next save truncate whatever
|
|
1060
|
+
* it pointed at.
|
|
1061
|
+
*/
|
|
1062
|
+
private function save(array $vault): void
|
|
1063
|
+
{
|
|
1064
|
+
$temp = $this->file . '.' . bin2hex(mvrandom(8)) . '.tmp';
|
|
1065
|
+
$handle = mvcreate($temp);
|
|
1066
|
+
|
|
1067
|
+
if (false === $handle) {
|
|
1068
|
+
mvfail('cannot write ' . $this->file);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
// A SHORT WRITE IS NOT A WRITE; see mvputnew. Here it would be
|
|
1072
|
+
// worse: the rename would put a truncated file over a good vault.
|
|
1073
|
+
$raw = mvwritefile($vault);
|
|
1074
|
+
$ok = strlen($raw) === fwrite($handle, $raw);
|
|
1075
|
+
fclose($handle);
|
|
1076
|
+
|
|
1077
|
+
if ($ok) {
|
|
1078
|
+
$ok = @rename($temp, $this->file);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
if (!$ok) {
|
|
1082
|
+
// The vault is unchanged either way, and the write error is
|
|
1083
|
+
// what the caller needs to be told about.
|
|
1084
|
+
@unlink($temp);
|
|
1085
|
+
mvfail('cannot write ' . $this->file);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
/**
|
|
1091
|
+
* Open a vault file as one key.
|
|
1092
|
+
*
|
|
1093
|
+
* The handle is lazy. Nothing is read, and no passphrase is stretched,
|
|
1094
|
+
* until a method needs the file.
|
|
1095
|
+
*
|
|
1096
|
+
* @param array<string, mixed> $options
|
|
1097
|
+
*/
|
|
1098
|
+
function openvault(array $options): MiniVault
|
|
1099
|
+
{
|
|
1100
|
+
return new MiniVault($options);
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Make a vault file and return a handle on its master key.
|
|
1105
|
+
*
|
|
1106
|
+
* Refuses a file that is already there: a vault is created once, and
|
|
1107
|
+
* overwriting one discards every secret in it.
|
|
1108
|
+
*
|
|
1109
|
+
* @param array<string, mixed> $options
|
|
1110
|
+
*/
|
|
1111
|
+
function createvault(array $options): MiniVault
|
|
1112
|
+
{
|
|
1113
|
+
$file = $options['file'] ?? null;
|
|
1114
|
+
$passphrase = $options['passphrase'] ?? null;
|
|
1115
|
+
|
|
1116
|
+
if (!is_string($file) || '' === $file) {
|
|
1117
|
+
mvfail('a vault needs a file');
|
|
1118
|
+
}
|
|
1119
|
+
if (!is_string($passphrase) || '' === $passphrase) {
|
|
1120
|
+
mvfail('a vault needs a passphrase');
|
|
1121
|
+
}
|
|
1122
|
+
$wantkey = (string) ($options['key'] ?? '');
|
|
1123
|
+
$keyid = mvcheckid('' === $wantkey ? MV_MASTERKEY : $wantkey, 'a vault needs a key id');
|
|
1124
|
+
|
|
1125
|
+
// No existence check first: the check and the write would be two
|
|
1126
|
+
// steps, and `mvputnew` refuses an existing file in ONE.
|
|
1127
|
+
mvputnew($file, mvnew($keyid, $passphrase, (int) ($options['iterations'] ?? MV_ITERATIONS)));
|
|
1128
|
+
|
|
1129
|
+
return new MiniVault($options);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// --- the provider ----------------------------------------------------
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Read a vault as one store in a chain.
|
|
1136
|
+
*
|
|
1137
|
+
* The provider is the READ half and nothing more: a chain resolves
|
|
1138
|
+
* secrets, and writing one is a deliberate act with an API of its own.
|
|
1139
|
+
*/
|
|
1140
|
+
final class MiniVaultProvider implements Provider
|
|
1141
|
+
{
|
|
1142
|
+
public function __construct(private readonly MiniVault $vault)
|
|
1143
|
+
{
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
public function lookup(string $name): ?string
|
|
1147
|
+
{
|
|
1148
|
+
return $this->vault->get($name);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
public function describe(): string
|
|
1152
|
+
{
|
|
1153
|
+
return 'minivault:' . $this->vault->file();
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
function providerof(MiniVault $vault): Provider
|
|
1158
|
+
{
|
|
1159
|
+
return new MiniVaultProvider($vault);
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* A vault provider from options, for a chain built by hand.
|
|
1164
|
+
*
|
|
1165
|
+
* @param array<string, mixed> $options
|
|
1166
|
+
*/
|
|
1167
|
+
function minivaultprovider(array $options): Provider
|
|
1168
|
+
{
|
|
1169
|
+
return providerof(openvault($options));
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* The vault options a provider spec describes.
|
|
1174
|
+
*
|
|
1175
|
+
* @param array<string, mixed> $spec
|
|
1176
|
+
* @return array<string, mixed>
|
|
1177
|
+
*/
|
|
1178
|
+
function mvoptions(array $spec): array
|
|
1179
|
+
{
|
|
1180
|
+
return [
|
|
1181
|
+
'file' => $spec['file'] ?? '',
|
|
1182
|
+
'key' => $spec['vaultkey'] ?? null,
|
|
1183
|
+
'passphrase' => $spec['passphrase'] ?? '',
|
|
1184
|
+
'iterations' => $spec['iterations'] ?? null,
|
|
1185
|
+
'create' => true === ($spec['create'] ?? false),
|
|
1186
|
+
];
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
/**
|
|
1190
|
+
* The `minivault` provider kind, as a voxgig/plugin definition.
|
|
1191
|
+
*
|
|
1192
|
+
* Written out rather than built by `providerplugin`, because this
|
|
1193
|
+
* definition publishes TWO exports: `provider`, the read half every kind
|
|
1194
|
+
* publishes, and `vault`, the programmatic API.
|
|
1195
|
+
*
|
|
1196
|
+
* @return array<string, mixed>
|
|
1197
|
+
*/
|
|
1198
|
+
function minivault(): array
|
|
1199
|
+
{
|
|
1200
|
+
return [
|
|
1201
|
+
'name' => 'minivault',
|
|
1202
|
+
'define' => function (Inst $inst): void {
|
|
1203
|
+
$options = mvoptions($inst->options());
|
|
1204
|
+
|
|
1205
|
+
try {
|
|
1206
|
+
// `openvault` refuses bad configuration HERE, so a mistyped
|
|
1207
|
+
// chain fails at construction. Reaching the FILE is not
|
|
1208
|
+
// configuration: the handle is lazy.
|
|
1209
|
+
$vault = openvault($options);
|
|
1210
|
+
} catch (SekretoError $err) {
|
|
1211
|
+
throw new PluginError(ERROR_CODE, $err->getMessage(),
|
|
1212
|
+
['ref' => $inst->ref, 'cause' => $err->getMessage()]);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
$inst->export(PROVIDER_EXPORT, providerof($vault));
|
|
1216
|
+
$inst->export(VAULT_EXPORT, $vault);
|
|
1217
|
+
},
|
|
1218
|
+
];
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
/**
|
|
1222
|
+
* The vault behind a store in a chain, as its programmatic API.
|
|
1223
|
+
*
|
|
1224
|
+
* With no store named, the unqualified alias answers: one vault in the
|
|
1225
|
+
* chain resolves whatever it is called, and two raise rather than picking
|
|
1226
|
+
* one.
|
|
1227
|
+
*/
|
|
1228
|
+
function vaultof(object $secrets, ?string $store = null): MiniVault
|
|
1229
|
+
{
|
|
1230
|
+
if (null === $store) {
|
|
1231
|
+
$found = $secrets->host->exports('minivault/' . VAULT_EXPORT);
|
|
1232
|
+
if (null === $found) {
|
|
1233
|
+
mvfail('no minivault store in this chain');
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
return $found;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
// A NAMED STORE MUST EXIST, and the alias must not stand in for it.
|
|
1240
|
+
// `host.exports` falls back to the alias when the exact ref misses, so
|
|
1241
|
+
// asking for `minivault` in a chain whose only vault is named `app`
|
|
1242
|
+
// used to hand back the `app` vault - and then write to it.
|
|
1243
|
+
$ref = 'minivault' === $store ? 'minivault' : 'minivault$' . $store;
|
|
1244
|
+
|
|
1245
|
+
if (null === $secrets->host->instance($ref)) {
|
|
1246
|
+
mvfail('no minivault store named ' . $store . ' in this chain');
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
return $secrets->host->exports($ref . '/' . VAULT_EXPORT);
|
|
1250
|
+
}
|