@voxgig/sdkgen 4.8.2 → 4.8.3
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/action/doctor.d.ts +1 -0
- package/dist/action/doctor.js +50 -2
- package/dist/action/doctor.js.map +1 -1
- package/dist/helpers/naming.js +4 -2
- package/dist/helpers/naming.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aon +21 -0
- package/package.json +1 -1
- package/project/.sdk/model/feature/secrets.aon +120 -18
- package/project/.sdk/model/target/c.aon +10 -0
- package/project/.sdk/model/target/clojure.aon +13 -0
- package/project/.sdk/model/target/cpp.aon +10 -0
- package/project/.sdk/model/target/csharp.aon +9 -0
- package/project/.sdk/model/target/dart.aon +10 -0
- package/project/.sdk/model/target/elixir.aon +9 -0
- package/project/.sdk/model/target/go.aon +13 -0
- package/project/.sdk/model/target/java.aon +9 -0
- package/project/.sdk/model/target/js.aon +7 -0
- package/project/.sdk/model/target/kotlin.aon +9 -0
- package/project/.sdk/model/target/lean.aon +17 -0
- package/project/.sdk/model/target/lua.aon +8 -0
- package/project/.sdk/model/target/ocaml.aon +9 -0
- package/project/.sdk/model/target/perl.aon +8 -0
- package/project/.sdk/model/target/php.aon +8 -0
- package/project/.sdk/model/target/py.aon +13 -0
- package/project/.sdk/model/target/rb.aon +8 -0
- package/project/.sdk/model/target/rust.aon +10 -0
- package/project/.sdk/model/target/scala.aon +21 -2
- package/project/.sdk/model/target/swift.aon +18 -0
- package/project/.sdk/model/target/ts.aon +13 -0
- package/project/.sdk/src/cmp/clojure/Package_clojure.ts +9 -2
- package/project/.sdk/src/cmp/cpp/Gitignore_cpp.ts +3 -0
- package/project/.sdk/src/cmp/dart/Test_dart.ts +2 -0
- package/project/.sdk/src/cmp/elixir/Package_elixir.ts +4 -1
- package/project/.sdk/src/cmp/go/Config_go.ts +59 -2
- package/project/.sdk/src/cmp/go/Main_go.ts +8 -2
- package/project/.sdk/src/cmp/java/Test_java.ts +6 -5
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +6 -5
- package/project/.sdk/src/cmp/lean/Package_lean.ts +23 -0
- package/project/.sdk/src/cmp/lean/ReadmeInstall_lean.ts +1 -0
- package/project/.sdk/src/cmp/lean/ReadmeTopTest_lean.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Gitignore_ocaml.ts +1 -0
- package/project/.sdk/src/cmp/ocaml/Main_ocaml.ts +7 -3
- package/project/.sdk/src/cmp/py/Config_py.ts +82 -1
- package/project/.sdk/src/cmp/py/Main_py.ts +44 -0
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +2 -0
- package/project/.sdk/src/cmp/swift/Main_swift.ts +10 -0
- package/project/.sdk/src/cmp/swift/Package_swift.ts +13 -1
- package/project/.sdk/src/cmp/ts/Config_ts.ts +42 -17
- package/project/.sdk/src/cmp/ts/fragment/Config.data.fragment.ts +13 -1
- package/project/.sdk/src/cmp/ts/fragment/Config.fragment.ts +13 -1
- package/project/.sdk/tm/c/Makefile +38 -3
- package/project/.sdk/tm/c/tests/omni_resolver.h +361 -0
- package/project/.sdk/tm/c/tests/omni_smoke_test.c +237 -0
- package/project/.sdk/tm/c/tests/primary_corpus_test.c +205 -284
- package/project/.sdk/tm/c/tests/struct_corpus_test.c +292 -212
- package/project/.sdk/tm/c/tests/vendor/omni/json.c +811 -0
- package/project/.sdk/tm/c/tests/vendor/omni/omni.h +240 -0
- package/project/.sdk/tm/c/tests/vendor/omni/runner.c +940 -0
- package/project/.sdk/tm/c/tests/vendor/omni/util.c +351 -0
- package/project/.sdk/tm/c/utility/struct/utility.c +7 -2
- package/project/.sdk/tm/clojure/test/sdk/test/omni.clj +401 -0
- package/project/.sdk/tm/clojure/test/sdk/test/omni_smoke.clj +81 -0
- package/project/.sdk/tm/clojure/test/sdk/test/primary.clj +92 -58
- package/project/.sdk/tm/clojure/test/sdk/test/struct_corpus.clj +122 -149
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +8 -3
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/json.clj +145 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/runner.clj +445 -0
- package/project/.sdk/tm/clojure/test/vendor/omni/voxgig/omni/util.clj +145 -0
- package/project/.sdk/tm/cpp/Makefile +5 -1
- package/project/.sdk/tm/cpp/test/omni_resolver.hpp +473 -0
- package/project/.sdk/tm/cpp/test/omni_smoke_test.cpp +209 -0
- package/project/.sdk/tm/cpp/test/primary_utility_test.cpp +243 -184
- package/project/.sdk/tm/cpp/test/runner_support.hpp +68 -181
- package/project/.sdk/tm/cpp/test/struct_corpus_test.cpp +183 -56
- package/project/.sdk/tm/cpp/test/vendor/omni/json.hpp +406 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/omni.hpp +751 -0
- package/project/.sdk/tm/cpp/test/vendor/omni/util.hpp +256 -0
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +7 -1
- package/project/.sdk/tm/csharp/test/OmniResolver.cs +491 -0
- package/project/.sdk/tm/csharp/test/OmniSmokeTest.cs +106 -0
- package/project/.sdk/tm/csharp/test/PrimaryUtilityTest.cs +299 -316
- package/project/.sdk/tm/csharp/test/Runner.cs +104 -269
- package/project/.sdk/tm/csharp/test/StructUtilityTest.cs +535 -724
- package/project/.sdk/tm/csharp/test/vendor/omni/Runner.cs +864 -0
- package/project/.sdk/tm/csharp/test/vendor/omni/Util.cs +347 -0
- package/project/.sdk/tm/csharp/utility/MakeSpec.cs +3 -1
- package/project/.sdk/tm/csharp/utility/PrepareMethod.cs +6 -1
- package/project/.sdk/tm/csharp/utility/struct/Struct.cs +21 -5
- package/project/.sdk/tm/dart/test/omni.dart +520 -0
- package/project/.sdk/tm/dart/test/omni_smoke_test.dart +143 -0
- package/project/.sdk/tm/dart/test/primary_test.dart +86 -28
- package/project/.sdk/tm/dart/test/struct_test.dart +438 -11
- package/project/.sdk/tm/dart/test/vendor/omni/omni.dart +7 -0
- package/project/.sdk/tm/dart/test/vendor/omni/runner.dart +653 -0
- package/project/.sdk/tm/dart/test/vendor/omni/util.dart +232 -0
- package/project/.sdk/tm/elixir/Makefile +11 -3
- package/project/.sdk/tm/elixir/test/omni_smoke_test.exs +117 -0
- package/project/.sdk/tm/elixir/test/primary_utility_test.exs +341 -16
- package/project/.sdk/tm/elixir/test/struct_corpus_test.exs +554 -9
- package/project/.sdk/tm/elixir/test/support/omni.ex +377 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/json.ex +122 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/runner.ex +623 -0
- package/project/.sdk/tm/elixir/test/vendor/omni/util.ex +187 -0
- package/project/.sdk/tm/go/core/context.go +32 -16
- package/project/.sdk/tm/go/feature/secrets/plugin/capability.go +261 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/catalog.go +78 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/config.go +652 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/depend.go +250 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/env.go +194 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/export.go +80 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/graph.go +238 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/host.go +1575 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/order.go +248 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/point.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/ref.go +123 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/resolve.go +79 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/types.go +296 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/util.go +87 -0
- package/project/.sdk/tm/go/feature/secrets/plugin/version.go +161 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/aws.go +292 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/aws/sigv4.go +201 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/azuresecrets/azuresecrets.go +187 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/boru/boru.go +184 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/doppler/doppler.go +114 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/gcpsecrets/gcpsecrets.go +156 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/hashicorp/hashicorp.go +209 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/httpjson/httpjson.go +241 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/infisical/infisical.go +151 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/onepassword/onepassword.go +152 -0
- package/project/.sdk/tm/go/feature/secrets/plugins/secretspec/secretspec.go +143 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/addr.go +120 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/providers.go +439 -0
- package/project/.sdk/tm/go/feature/secrets/sekreto/sekreto.go +685 -0
- package/project/.sdk/tm/go/feature/secrets_feature.go +675 -0
- package/project/.sdk/tm/go/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/go/test/feature/secrets/secrets_feature_test.go +799 -0
- package/project/.sdk/tm/go/test/omni/omni.go +897 -0
- package/project/.sdk/tm/go/test/omni/util.go +360 -0
- package/project/.sdk/tm/go/test/omniresolver_test.go +748 -0
- package/project/.sdk/tm/go/test/omnismoke_test.go +112 -0
- package/project/.sdk/tm/go/test/primary_utility_test.go +123 -191
- package/project/.sdk/tm/go/test/struct_utility_test.go +323 -16
- package/project/.sdk/tm/go/test/testsupport_test.go +294 -0
- package/project/.sdk/tm/go/utility/make_options.go +8 -1
- package/project/.sdk/tm/go/utility/prepare_method.go +5 -1
- package/project/.sdk/tm/go/utility/struct/voxgigstruct.go +2 -2
- package/project/.sdk/tm/java/test/OmniResolver.java +355 -0
- package/project/.sdk/tm/java/test/OmniSmokeTest.java +99 -0
- package/project/.sdk/tm/java/test/PrimaryUtilityTest.java +254 -280
- package/project/.sdk/tm/java/test/RunnerSupport.java +9 -194
- package/project/.sdk/tm/java/test/StructCorpusTest.java +119 -42
- package/project/.sdk/tm/java/test/vendor/omni/Json.java +287 -0
- package/project/.sdk/tm/java/test/vendor/omni/Runner.java +851 -0
- package/project/.sdk/tm/java/test/vendor/omni/Util.java +322 -0
- package/project/.sdk/tm/java/utility/MakeSpec.java +3 -1
- package/project/.sdk/tm/java/utility/PrepareMethod.java +5 -5
- package/project/.sdk/tm/java/utility/struct/Struct.java +17 -4
- package/project/.sdk/tm/js/src/utility/StructUtility.js +3 -3
- package/project/.sdk/tm/js/test/omni.js +251 -0
- package/project/.sdk/tm/js/test/omni.test.js +105 -0
- package/project/.sdk/tm/js/test/utility/PrimaryUtility.test.js +6 -2
- package/project/.sdk/tm/js/test/utility/StructUtility.test.js +27 -2
- package/project/.sdk/tm/js/test/vendor/omni/index.js +77 -0
- package/project/.sdk/tm/js/test/vendor/omni/runner.js +613 -0
- package/project/.sdk/tm/js/test/vendor/omni/util.js +212 -0
- package/project/.sdk/tm/kotlin/core/Utility.kt +1 -1
- package/project/.sdk/tm/kotlin/test/OmniResolver.kt +343 -0
- package/project/.sdk/tm/kotlin/test/OmniSmokeTest.kt +100 -0
- package/project/.sdk/tm/kotlin/test/PrimaryUtilityTest.kt +244 -262
- package/project/.sdk/tm/kotlin/test/RunnerSupport.kt +9 -178
- package/project/.sdk/tm/kotlin/test/StructCorpusTest.kt +121 -32
- package/project/.sdk/tm/kotlin/test/vendor/omni/Json.kt +264 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Runner.kt +615 -0
- package/project/.sdk/tm/kotlin/test/vendor/omni/Util.kt +139 -0
- package/project/.sdk/tm/kotlin/utility/MakeSpecUrl.kt +6 -3
- package/project/.sdk/tm/kotlin/utility/Prepare.kt +6 -6
- package/project/.sdk/tm/kotlin/utility/struct/Struct.kt +18 -2
- package/project/.sdk/tm/lean/Makefile +12 -5
- package/project/.sdk/tm/lean/src/SdkUtility.lean +14 -1
- package/project/.sdk/tm/lean/test/OmniResolver.lean +358 -0
- package/project/.sdk/tm/lean/test/OmniSmoke.lean +174 -0
- package/project/.sdk/tm/lean/test/StructCorpus.lean +245 -574
- package/project/.sdk/tm/lean/test/TPrimaryUtility.lean +155 -291
- package/project/.sdk/tm/lean/test/vendor/omni/Omni.lean +997 -0
- package/project/.sdk/tm/lua/test/omni.lua +456 -0
- package/project/.sdk/tm/lua/test/omni_smoke_test.lua +103 -0
- package/project/.sdk/tm/lua/test/primary_utility_test.lua +250 -509
- package/project/.sdk/tm/lua/test/struct_utility_test.lua +161 -70
- package/project/.sdk/tm/lua/test/vendor/omni/json.lua +268 -0
- package/project/.sdk/tm/lua/test/vendor/omni/regex.lua +385 -0
- package/project/.sdk/tm/lua/test/vendor/omni/runner.lua +641 -0
- package/project/.sdk/tm/lua/test/vendor/omni/util.lua +282 -0
- package/project/.sdk/tm/lua/utility/prepare_method.lua +5 -1
- package/project/.sdk/tm/lua/utility/struct/regex.lua +663 -0
- package/project/.sdk/tm/lua/utility/struct/struct.lua +660 -420
- package/project/.sdk/tm/ocaml/Makefile +37 -12
- package/project/.sdk/tm/ocaml/test/omni_resolver.ml +284 -0
- package/project/.sdk/tm/ocaml/test/omni_smoke_test.ml +169 -0
- package/project/.sdk/tm/ocaml/test/primary_utility_test.ml +84 -100
- package/project/.sdk/tm/ocaml/test/struct_corpus.ml +225 -201
- package/project/.sdk/tm/ocaml/test/vendor/omni/omni.ml +1157 -0
- package/project/.sdk/tm/perl/lib/Voxgig/Struct.pm +88 -12
- package/project/.sdk/tm/perl/t/omni.pm +647 -0
- package/project/.sdk/tm/perl/t/omni_smoke.t +87 -0
- package/project/.sdk/tm/perl/t/primary_utility.t +189 -487
- package/project/.sdk/tm/perl/t/struct_utility.t +455 -389
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Runner.pm +649 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni/Util.pm +253 -0
- package/project/.sdk/tm/perl/t/vendor/omni/Voxgig/Omni.pm +24 -0
- package/project/.sdk/tm/perl/utility/prepare_method.pm +7 -2
- package/project/.sdk/tm/php/test/Omni.php +691 -0
- package/project/.sdk/tm/php/test/OmniSmokeTest.php +93 -0
- package/project/.sdk/tm/php/test/PrimaryUtilityTest.php +210 -571
- package/project/.sdk/tm/php/test/StructUtilityTest.php +320 -342
- package/project/.sdk/tm/php/test/vendor/omni/Runner.php +644 -0
- package/project/.sdk/tm/php/test/vendor/omni/Util.php +283 -0
- package/project/.sdk/tm/php/utility/MakeSpec.php +10 -3
- package/project/.sdk/tm/php/utility/PrepareBody.php +7 -1
- package/project/.sdk/tm/php/utility/PrepareMethod.php +6 -2
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/__init__.py +36 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/capability.py +141 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/catalog.py +50 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/config.py +333 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/depend.py +198 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/env.py +147 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/export.py +52 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/graph.py +139 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/host.py +1053 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/order.py +171 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/point.py +95 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/ref.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/resolve.py +59 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/types.py +87 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_plugin/version.py +112 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/__init__.py +74 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/addr.py +116 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/aws.py +192 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/azuresecrets.py +120 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/boru.py +140 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/doppler.py +62 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/gcpsecrets.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/hashicorp.py +152 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/httpjson.py +115 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/infisical.py +92 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/onepassword.py +101 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/secretspec.py +119 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/plugins/sigv4.py +125 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/providers.py +211 -0
- package/project/.sdk/tm/py/pkg/feature/secrets/voxgig_sekreto/sekreto.py +455 -0
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +467 -0
- package/project/.sdk/tm/py/pkg/utility/prepare_method.py +5 -1
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/__init__.py +0 -2
- package/project/.sdk/tm/py/pkg/utility/voxgig_struct/voxgig_struct.py +780 -529
- package/project/.sdk/tm/py/src/feature/secrets/.gitkeep +0 -0
- package/project/.sdk/tm/py/test/feature/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/__init__.py +0 -0
- package/project/.sdk/tm/py/test/feature/secrets/test_secrets.py +337 -0
- package/project/.sdk/tm/py/test/omni.py +415 -0
- package/project/.sdk/tm/py/test/test_omni_smoke.py +74 -0
- package/project/.sdk/tm/py/test/test_primary_utility.py +144 -668
- package/project/.sdk/tm/py/test/test_struct_utility.py +74 -27
- package/project/.sdk/tm/py/test/voxgig_omni/__init__.py +62 -0
- package/project/.sdk/tm/py/test/voxgig_omni/runner.py +566 -0
- package/project/.sdk/tm/py/test/voxgig_omni/util.py +237 -0
- package/project/.sdk/tm/rb/test/omni.rb +505 -0
- package/project/.sdk/tm/rb/test/omni_smoke_test.rb +72 -0
- package/project/.sdk/tm/rb/test/primary_utility_test.rb +174 -560
- package/project/.sdk/tm/rb/test/struct_utility_test.rb +13 -7
- package/project/.sdk/tm/rb/test/vendor/omni/runner.rb +493 -0
- package/project/.sdk/tm/rb/test/vendor/omni/util.rb +199 -0
- package/project/.sdk/tm/rb/test/vendor/omni/voxgig_omni.rb +15 -0
- package/project/.sdk/tm/rb/utility/prepare_method.rb +5 -1
- package/project/.sdk/tm/rust/tests/common/mod.rs +19 -242
- package/project/.sdk/tm/rust/tests/omni_resolver/mod.rs +888 -0
- package/project/.sdk/tm/rust/tests/omni_smoke_test.rs +286 -0
- package/project/.sdk/tm/rust/tests/primary_utility_test.rs +318 -312
- package/project/.sdk/tm/rust/tests/struct_utility_test.rs +66 -28
- package/project/.sdk/tm/rust/tests/vendor/omni/json.rs +412 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/mod.rs +38 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/regex.rs +392 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/runner.rs +1001 -0
- package/project/.sdk/tm/rust/tests/vendor/omni/util.rs +161 -0
- package/project/.sdk/tm/rust/utility/prepare_method.rs +5 -1
- package/project/.sdk/tm/scala/Makefile +16 -6
- package/project/.sdk/tm/scala/sdktest/OmniResolver.scala +497 -0
- package/project/.sdk/tm/scala/sdktest/OmniSmoke.scala +192 -0
- package/project/.sdk/tm/scala/sdktest/PrimaryCorpus.scala +47 -19
- package/project/.sdk/tm/scala/sdktest/StructCorpus.scala +0 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Json.scala +229 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Runner.scala +552 -0
- package/project/.sdk/tm/scala/sdktest/vendor/omni/Util.scala +104 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Constants.swift +10 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Inject.swift +28 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Injection.swift +5 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Minor.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/Struct/Validate.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Prepare.swift +6 -1
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniResolver.swift +474 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/OmniSmokeTest.swift +107 -0
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/PrimaryUtilityTest.swift +141 -178
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/Runner.swift +17 -113
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/StructUtilityTest.swift +295 -446
- package/project/.sdk/tm/swift/Tests/vendor/omni/Json.swift +364 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Runner.swift +730 -0
- package/project/.sdk/tm/swift/Tests/vendor/omni/Util.swift +162 -0
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +7 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Capability.ts +148 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Catalog.ts +55 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Config.ts +344 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Depend.ts +205 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Env.ts +138 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Export.ts +46 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/FeatureHost.ts +349 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Graph.ts +181 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Host.ts +1132 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Order.ts +177 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Point.ts +119 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Ref.ts +102 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Resolve.ts +61 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Types.ts +112 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/Version.ts +100 -0
- package/project/.sdk/tm/ts/src/feature/secrets/plugin/index.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/Sekreto.ts +163 -30
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/index.ts +27 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/aws.ts +26 -36
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/azuresecrets.ts +19 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/boru.ts +36 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/doppler.ts +14 -21
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/gcpsecrets.ts +27 -27
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/hashicorp.ts +25 -39
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/httpjson.ts +99 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/infisical.ts +14 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{provider → plugins}/onepassword.ts +15 -22
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/plugins/secretspec.ts +98 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/{Sigv4.ts → plugins/sigv4.ts} +7 -6
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/addr.ts +97 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/builtin.ts +37 -0
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/dotenv.ts +4 -17
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/env.ts +4 -16
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/file.ts +11 -25
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/memory.ts +6 -23
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/support.ts +106 -39
- package/project/.sdk/tm/ts/src/utility/StructUtility.ts +3 -3
- package/project/.sdk/tm/ts/test/omni.ts +104 -32
- package/project/.sdk/tm/ts/test/utility/StructUtility.test.ts +27 -0
- package/project/.sdk/tm/ts/test/vendor/omni/Runner.ts +32 -5
- package/project/.sdk/tm/ts/test/vendor/omni/Util.ts +2 -2
- package/project/.sdk/tm/ts/test/vendor/omni/index.ts +2 -2
- package/project/.sdk/tm/zig/test/primary_utility_test.zig +1 -1
- package/project/.sdk/tm/zig/test/struct_runner.zig +5 -4
- package/project/sdkgen-package.json +1 -1
- package/src/action/doctor.ts +66 -2
- package/src/helpers/naming.ts +4 -2
- package/project/.sdk/tm/c/tests/runner.h +0 -274
- package/project/.sdk/tm/cpp/test/struct_runner.hpp +0 -314
- package/project/.sdk/tm/csharp/test/StructRunner.cs +0 -276
- package/project/.sdk/tm/dart/test/runner.dart +0 -406
- package/project/.sdk/tm/dart/test/struct_corpus.dart +0 -531
- package/project/.sdk/tm/elixir/test/support/struct_corpus.ex +0 -1088
- package/project/.sdk/tm/go/test/runner_test.go +0 -629
- package/project/.sdk/tm/go/test/struct_runner_test.go +0 -1094
- package/project/.sdk/tm/java/test/StructRunner.java +0 -281
- package/project/.sdk/tm/js/test/runner.js +0 -387
- package/project/.sdk/tm/kotlin/test/StructRunner.kt +0 -177
- package/project/.sdk/tm/lua/test/struct_runner.lua +0 -602
- package/project/.sdk/tm/ocaml/test/corpus_runner.ml +0 -185
- package/project/.sdk/tm/perl/t/struct_runner.pm +0 -275
- package/project/.sdk/tm/php/test/StructRunner.php +0 -275
- package/project/.sdk/tm/py/test/struct_runner.py +0 -411
- package/project/.sdk/tm/rb/test/struct_runner.rb +0 -309
- package/project/.sdk/tm/rust/tests/struct_runner/mod.rs +0 -424
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/Registry.ts +0 -90
- package/project/.sdk/tm/ts/src/feature/secrets/sekreto/provider/http.ts +0 -66
- package/project/.sdk/tm/ts/test/vendor/omni/compat.ts +0 -188
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# VENDORED: @voxgig/sekreto 0.2.0 (python/voxgig_sekreto/__init__.py)
|
|
2
|
+
# Source: https://github.com/voxgig/sekreto @ a5a00db6e6d3a1ddbdef7ac62e8a75be53a9e042 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# voxgig_sekreto - one interface for secrets, wherever they live.
|
|
5
|
+
#
|
|
6
|
+
# THE CORE SURFACE: the chain, the four built-in provider kinds, and the
|
|
7
|
+
# means of adding a fifth.
|
|
8
|
+
#
|
|
9
|
+
# The built-ins are the kinds that read at most a local file - env,
|
|
10
|
+
# memory, dotenv, file. Everything that opens a socket, spawns a process
|
|
11
|
+
# or signs a request is a PLUGIN, is not imported by this package, and is
|
|
12
|
+
# handed to `Sekreto` by the calling project:
|
|
13
|
+
#
|
|
14
|
+
# from voxgig_sekreto import Sekreto
|
|
15
|
+
# from voxgig_sekreto.plugins.hashicorp import hashicorp
|
|
16
|
+
#
|
|
17
|
+
# secrets = Sekreto({
|
|
18
|
+
# 'plugins': [hashicorp],
|
|
19
|
+
# 'providers': [{'kind': 'env'}, {'kind': 'hashicorp', 'addr': addr, 'token': token}],
|
|
20
|
+
# })
|
|
21
|
+
#
|
|
22
|
+
# or, for every kind at once, `ALL` from `voxgig_sekreto.plugins`. See
|
|
23
|
+
# docs/design/plugin-providers.md.
|
|
24
|
+
|
|
25
|
+
from .addr import checkaddr, safeaddr
|
|
26
|
+
from .providers import (
|
|
27
|
+
BUILTINS,
|
|
28
|
+
ERROR_CODE,
|
|
29
|
+
KINDS,
|
|
30
|
+
PROVIDER_EXPORT,
|
|
31
|
+
DotenvProvider,
|
|
32
|
+
EnvProvider,
|
|
33
|
+
FileProvider,
|
|
34
|
+
MemoryProvider,
|
|
35
|
+
Provider,
|
|
36
|
+
providerplugin,
|
|
37
|
+
)
|
|
38
|
+
from .sekreto import (
|
|
39
|
+
Sekreto,
|
|
40
|
+
SekretoError,
|
|
41
|
+
awsparam,
|
|
42
|
+
envkey,
|
|
43
|
+
flatname,
|
|
44
|
+
parsedotenv,
|
|
45
|
+
redact,
|
|
46
|
+
sekreto,
|
|
47
|
+
validname,
|
|
48
|
+
vaultref,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
'BUILTINS',
|
|
53
|
+
'ERROR_CODE',
|
|
54
|
+
'KINDS',
|
|
55
|
+
'PROVIDER_EXPORT',
|
|
56
|
+
'DotenvProvider',
|
|
57
|
+
'EnvProvider',
|
|
58
|
+
'FileProvider',
|
|
59
|
+
'MemoryProvider',
|
|
60
|
+
'Provider',
|
|
61
|
+
'Sekreto',
|
|
62
|
+
'SekretoError',
|
|
63
|
+
'awsparam',
|
|
64
|
+
'checkaddr',
|
|
65
|
+
'envkey',
|
|
66
|
+
'flatname',
|
|
67
|
+
'parsedotenv',
|
|
68
|
+
'providerplugin',
|
|
69
|
+
'redact',
|
|
70
|
+
'safeaddr',
|
|
71
|
+
'sekreto',
|
|
72
|
+
'validname',
|
|
73
|
+
'vaultref',
|
|
74
|
+
]
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# VENDORED: @voxgig/sekreto 0.2.0 (python/voxgig_sekreto/addr.py)
|
|
2
|
+
# Source: https://github.com/voxgig/sekreto @ a5a00db6e6d3a1ddbdef7ac62e8a75be53a9e042 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# The plaintext-address guard, in the core because it is pure - a handful
|
|
5
|
+
# of string steps, no socket - and because it is on the spec: every port
|
|
6
|
+
# answers the same for every address in spec/def/store.aon. The plugins
|
|
7
|
+
# that dial an address call `checkaddr` before they do.
|
|
8
|
+
#
|
|
9
|
+
# A port of typescript/src/provider/addr.ts.
|
|
10
|
+
|
|
11
|
+
from .sekreto import SekretoError
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def safeaddr(addr):
|
|
15
|
+
"""An address with any userinfo replaced by `[redacted]`, for messages.
|
|
16
|
+
|
|
17
|
+
Every refusal below names the address it refused, and one of them fires
|
|
18
|
+
precisely because the address carries a credential - so printing it
|
|
19
|
+
verbatim wrote the password to stderr and into the logs. It cannot be
|
|
20
|
+
cleaned up afterwards either: that password was never resolved as a
|
|
21
|
+
secret, so `redact` has never seen it and never will. The host is what a
|
|
22
|
+
reader needs to identify which chain entry is at fault; the userinfo is
|
|
23
|
+
not.
|
|
24
|
+
"""
|
|
25
|
+
mark = addr.find('://')
|
|
26
|
+
if -1 == mark:
|
|
27
|
+
return addr
|
|
28
|
+
|
|
29
|
+
rest = addr[mark + 3:]
|
|
30
|
+
end = len(rest)
|
|
31
|
+
for ch in ('/', '?', '#'):
|
|
32
|
+
at = rest.find(ch)
|
|
33
|
+
if -1 != at and at < end:
|
|
34
|
+
end = at
|
|
35
|
+
authority = rest[:end]
|
|
36
|
+
|
|
37
|
+
at = authority.rfind('@')
|
|
38
|
+
if -1 == at:
|
|
39
|
+
return addr
|
|
40
|
+
|
|
41
|
+
return addr[:mark + 3] + '[redacted]' + addr[mark + 3 + at:]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def checkaddr(addr):
|
|
45
|
+
"""Refuse to send a Vault token in the clear.
|
|
46
|
+
|
|
47
|
+
Vault's API is HTTPS in any real deployment; plaintext is a dev-mode
|
|
48
|
+
convenience. Sending `X-Vault-Token` over http to anything but the local
|
|
49
|
+
machine puts both the token and the secret it fetches on the wire for
|
|
50
|
+
anyone on the path, so sekreto will not do it. Loopback stays allowed:
|
|
51
|
+
that is `vault server -dev` and this repo's own test harness.
|
|
52
|
+
|
|
53
|
+
The address is read by hand, in the same handful of steps in every port,
|
|
54
|
+
rather than by each platform's URL parser. That is deliberate. Twelve
|
|
55
|
+
parsers disagree about malformed input - where userinfo ends, whether
|
|
56
|
+
`0177.0.0.1` is loopback, what an unclosed bracket means - and a check
|
|
57
|
+
that answers differently in different ports is not a check.
|
|
58
|
+
|
|
59
|
+
The rule this parse obeys, and the reason it can be trusted: it is never
|
|
60
|
+
more permissive than the HTTP client that will dial the address. It ends
|
|
61
|
+
the authority at `/`, `?` or `#` only, so a client that also breaks on
|
|
62
|
+
`\\` (WHATWG does) can only ever see a SHORTER host than this does. It
|
|
63
|
+
refuses userinfo outright rather than locating its end. It compares the
|
|
64
|
+
host literally, so a numeric form no parser here agrees on is refused
|
|
65
|
+
rather than guessed at.
|
|
66
|
+
"""
|
|
67
|
+
if addr.startswith('https://'):
|
|
68
|
+
scheme = 'https://'
|
|
69
|
+
elif addr.startswith('http://'):
|
|
70
|
+
scheme = 'http://'
|
|
71
|
+
else:
|
|
72
|
+
raise SekretoError('sekreto: not an http(s) address: ' + safeaddr(addr))
|
|
73
|
+
|
|
74
|
+
rest = addr[len(scheme):]
|
|
75
|
+
end = len(rest)
|
|
76
|
+
for mark in ('/', '?', '#'):
|
|
77
|
+
at = rest.find(mark)
|
|
78
|
+
if -1 != at and at < end:
|
|
79
|
+
end = at
|
|
80
|
+
authority = rest[:end]
|
|
81
|
+
|
|
82
|
+
# Userinfo is refused outright rather than parsed around, and on https as
|
|
83
|
+
# well as http. No store this library speaks authenticates by userinfo -
|
|
84
|
+
# they take a token or a signature - so an address carrying one is a
|
|
85
|
+
# mistake at best. At worst it is the attack this whole function exists
|
|
86
|
+
# to stop: `http://localhost:8200@evil.example.com/` is a request to
|
|
87
|
+
# evil.example.com that reads, to anything that splits the authority on
|
|
88
|
+
# ':', as loopback.
|
|
89
|
+
if '@' in authority:
|
|
90
|
+
raise SekretoError(
|
|
91
|
+
'sekreto: refusing an address with embedded credentials: ' + safeaddr(addr)
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
# An opening bracket with no closing one is not an address at all.
|
|
95
|
+
if authority.startswith('[') and ']' not in authority:
|
|
96
|
+
raise SekretoError('sekreto: not a valid http(s) address: ' + safeaddr(addr))
|
|
97
|
+
|
|
98
|
+
if 'https://' == scheme:
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
# A bracketed IPv6 literal keeps its brackets. Splitting the authority on
|
|
102
|
+
# the first colon yields '[', so `http://[::1]:8200` could never match -
|
|
103
|
+
# which made the '[::1]' entry below unreachable, and refused a
|
|
104
|
+
# legitimate local vault.
|
|
105
|
+
if authority.startswith('['):
|
|
106
|
+
host = authority[:authority.index(']') + 1]
|
|
107
|
+
else:
|
|
108
|
+
host = authority.split(':')[0]
|
|
109
|
+
|
|
110
|
+
if host.lower() in ('localhost', '127.0.0.1', '::1', '[::1]'):
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
raise SekretoError(
|
|
114
|
+
'sekreto: refusing to send a token in plaintext to ' + safeaddr(addr)
|
|
115
|
+
+ ' (use https)'
|
|
116
|
+
)
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# VENDORED: @voxgig/sekreto 0.2.0 (python/voxgig_sekreto/plugins/aws.py)
|
|
2
|
+
# Source: https://github.com/voxgig/sekreto @ a5a00db6e6d3a1ddbdef7ac62e8a75be53a9e042 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# The aws plugin: Secrets Manager and SSM Parameter Store, with requests
|
|
5
|
+
# SigV4-signed in-tree (sigv4.py, beside this file). Needs HTTPS and
|
|
6
|
+
# HMAC-SHA256 - the one cryptographic dependency in the library, which is
|
|
7
|
+
# why this is a plugin and why the core never imports hashlib or hmac. A
|
|
8
|
+
# port of typescript/plugins/aws.ts.
|
|
9
|
+
import base64
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import time
|
|
13
|
+
|
|
14
|
+
from ..addr import checkaddr
|
|
15
|
+
from ..sekreto import SekretoError, awsparam, vaultref
|
|
16
|
+
from ..providers import Provider, providerplugin
|
|
17
|
+
from .httpjson import fetchjson
|
|
18
|
+
from .sigv4 import sigv4
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def awsnow():
|
|
22
|
+
"""The `YYYYMMDDTHHMMSSZ` timestamp SigV4 wants, for now."""
|
|
23
|
+
return time.strftime('%Y%m%dT%H%M%SZ', time.gmtime())
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def awsauth(opts):
|
|
27
|
+
"""Region and credentials, from config first and the standard AWS_*
|
|
28
|
+
environment variables second - those are AWS's own convention, and a
|
|
29
|
+
pod or CI job that has them set should just work. Missing either is
|
|
30
|
+
an error: an AWS store with no credentials could not answer."""
|
|
31
|
+
env = os.environ
|
|
32
|
+
|
|
33
|
+
region = opts.get('region') or env.get('AWS_REGION') or env.get('AWS_DEFAULT_REGION') or ''
|
|
34
|
+
keyid = opts.get('keyid') or env.get('AWS_ACCESS_KEY_ID') or ''
|
|
35
|
+
secret = opts.get('secret') or env.get('AWS_SECRET_ACCESS_KEY') or ''
|
|
36
|
+
session = opts.get('session') or env.get('AWS_SESSION_TOKEN') or None
|
|
37
|
+
|
|
38
|
+
if '' == region:
|
|
39
|
+
raise SekretoError('sekreto: aws: no region (set region or AWS_REGION)')
|
|
40
|
+
if '' == keyid or '' == secret:
|
|
41
|
+
raise SekretoError(
|
|
42
|
+
'sekreto: aws: no credentials (set keyid/secret or'
|
|
43
|
+
+ ' AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY)'
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return {'region': region, 'keyid': keyid, 'secret': secret, 'session': session}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def awscall(opts, service, target, payload):
|
|
50
|
+
"""One signed call to an AWS JSON-1.1 API."""
|
|
51
|
+
auth = awsauth(opts)
|
|
52
|
+
# The China partition lives under its own suffix; every other
|
|
53
|
+
# commercial region is plain amazonaws.com.
|
|
54
|
+
suffix = '.amazonaws.com.cn' if auth['region'].startswith('cn-') else '.amazonaws.com'
|
|
55
|
+
addr = opts.get('addr') or 'https://' + service + '.' + auth['region'] + suffix
|
|
56
|
+
checkaddr(addr)
|
|
57
|
+
|
|
58
|
+
url = addr.rstrip('/') + '/'
|
|
59
|
+
body = json.dumps(payload, separators=(',', ':'))
|
|
60
|
+
headers = {
|
|
61
|
+
'content-type': 'application/x-amz-json-1.1',
|
|
62
|
+
'x-amz-target': target,
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
signed = sigv4({
|
|
66
|
+
'method': 'POST',
|
|
67
|
+
'url': url,
|
|
68
|
+
'headers': headers,
|
|
69
|
+
'body': body,
|
|
70
|
+
'service': service,
|
|
71
|
+
'region': auth['region'],
|
|
72
|
+
'keyid': auth['keyid'],
|
|
73
|
+
'secret': auth['secret'],
|
|
74
|
+
'session': auth['session'],
|
|
75
|
+
'datetime': awsnow(),
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
allheaders = dict(headers)
|
|
79
|
+
allheaders.update(signed)
|
|
80
|
+
|
|
81
|
+
return fetchjson('POST', url, allheaders, body)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def awsmiss(body, types):
|
|
85
|
+
"""Does this AWS error body name one of the not-found types? Those are
|
|
86
|
+
a miss; every other failure is a store that could not answer."""
|
|
87
|
+
errtype = body.get('__type') if isinstance(body, dict) else None
|
|
88
|
+
if not isinstance(errtype, str):
|
|
89
|
+
errtype = ''
|
|
90
|
+
return any(name in errtype for name in types)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class AwssecretsProvider(Provider):
|
|
94
|
+
"""AWS Secrets Manager.
|
|
95
|
+
|
|
96
|
+
`api.token` reads the secret named `api` (the vaultref path, so
|
|
97
|
+
`db.pass.main` reads `db/pass`) and takes the `token` field of its
|
|
98
|
+
JSON SecretString - the AWS idiom of one JSON map per secret. A
|
|
99
|
+
SecretString that is not JSON is the value itself, under the
|
|
100
|
+
conventional field `value`. Requests are SigV4-signed in-tree; see
|
|
101
|
+
sigv4.py.
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
def __init__(self, options=None):
|
|
105
|
+
self.opts = options or {}
|
|
106
|
+
|
|
107
|
+
def lookup(self, name):
|
|
108
|
+
ref = vaultref(name)
|
|
109
|
+
|
|
110
|
+
status, body = awscall(
|
|
111
|
+
self.opts, 'secretsmanager', 'secretsmanager.GetSecretValue',
|
|
112
|
+
{'SecretId': ref['path']},
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
if 400 == status and awsmiss(body, ['ResourceNotFoundException']):
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
if 200 != status:
|
|
119
|
+
raise SekretoError('sekreto: aws secretsmanager error: ' + str(status))
|
|
120
|
+
|
|
121
|
+
text = (body or {}).get('SecretString')
|
|
122
|
+
|
|
123
|
+
if not isinstance(text, str):
|
|
124
|
+
# A binary secret has no fields to address; only the conventional
|
|
125
|
+
# `value` field can mean "the bytes themselves".
|
|
126
|
+
binary = (body or {}).get('SecretBinary')
|
|
127
|
+
if isinstance(binary, str) and 'value' == ref['field']:
|
|
128
|
+
# validate=True: b64decode silently SKIPS characters
|
|
129
|
+
# outside the alphabet, so a corrupted payload decoded to
|
|
130
|
+
# plausible-looking bytes that were then returned as the
|
|
131
|
+
# secret. A store that answered incoherently is an error,
|
|
132
|
+
# never a miss.
|
|
133
|
+
try:
|
|
134
|
+
return base64.b64decode(binary, validate=True).decode('utf8')
|
|
135
|
+
except Exception:
|
|
136
|
+
raise SekretoError('sekreto: aws secretsmanager: undecodable secret')
|
|
137
|
+
return None
|
|
138
|
+
|
|
139
|
+
try:
|
|
140
|
+
parsed = json.loads(text)
|
|
141
|
+
except ValueError:
|
|
142
|
+
parsed = None
|
|
143
|
+
|
|
144
|
+
if isinstance(parsed, dict):
|
|
145
|
+
value = parsed.get(ref['field'])
|
|
146
|
+
return None if value is None else str(value)
|
|
147
|
+
|
|
148
|
+
# A plain-string secret is the whole value; it has no named fields.
|
|
149
|
+
return text if 'value' == ref['field'] else None
|
|
150
|
+
|
|
151
|
+
def describe(self):
|
|
152
|
+
# Config only, never the environment: describe() feeds the spec's
|
|
153
|
+
# sources group, which must answer the same everywhere.
|
|
154
|
+
return 'awssecrets:' + (self.opts.get('region') or '')
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class AwsparamsProvider(Provider):
|
|
158
|
+
"""AWS SSM Parameter Store.
|
|
159
|
+
|
|
160
|
+
`db.pass.main` reads the parameter `/db/pass/main` (under an optional
|
|
161
|
+
prefix path), decrypted. Parameter Store carries flat strings, so
|
|
162
|
+
there is no field indirection.
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
def __init__(self, options=None):
|
|
166
|
+
self.opts = options or {}
|
|
167
|
+
|
|
168
|
+
def lookup(self, name):
|
|
169
|
+
status, body = awscall(self.opts, 'ssm', 'AmazonSSM.GetParameter', {
|
|
170
|
+
'Name': awsparam(name, self.opts.get('prefix')),
|
|
171
|
+
'WithDecryption': True,
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
if 400 == status and awsmiss(body, ['ParameterNotFound']):
|
|
175
|
+
return None
|
|
176
|
+
|
|
177
|
+
if 200 != status:
|
|
178
|
+
raise SekretoError('sekreto: aws ssm error: ' + str(status))
|
|
179
|
+
|
|
180
|
+
value = ((body or {}).get('Parameter') or {}).get('Value')
|
|
181
|
+
return None if value is None else str(value)
|
|
182
|
+
|
|
183
|
+
def describe(self):
|
|
184
|
+
return 'awsparams:' + (self.opts.get('region') or '') + (self.opts.get('prefix') or '')
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
# The two plugins: the `awssecrets` and `awsparams` provider kinds, as
|
|
188
|
+
# voxgig/plugin definitions.
|
|
189
|
+
awssecrets = providerplugin('awssecrets', AwssecretsProvider)
|
|
190
|
+
awsparams = providerplugin('awsparams', AwsparamsProvider)
|
|
191
|
+
|
|
192
|
+
__all__ = ['AwssecretsProvider', 'AwsparamsProvider', 'awssecrets', 'awsparams', 'sigv4']
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# VENDORED: @voxgig/sekreto 0.2.0 (python/voxgig_sekreto/plugins/azuresecrets.py)
|
|
2
|
+
# Source: https://github.com/voxgig/sekreto @ a5a00db6e6d3a1ddbdef7ac62e8a75be53a9e042 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# The azuresecrets plugin: Azure Key Vault. Needs HTTPS. A port of
|
|
5
|
+
# typescript/plugins/azuresecrets.ts.
|
|
6
|
+
import time
|
|
7
|
+
|
|
8
|
+
from ..addr import checkaddr
|
|
9
|
+
from ..sekreto import SekretoError, flatname
|
|
10
|
+
from ..providers import Provider, providerplugin
|
|
11
|
+
from .httpjson import fetchjson, tonumber, urlpart
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AzuresecretsProvider(Provider):
|
|
15
|
+
"""Azure Key Vault.
|
|
16
|
+
|
|
17
|
+
`api.token` reads secret `api-token` (dots flattened to `-`; Key
|
|
18
|
+
Vault names allow nothing else), current version. The token comes
|
|
19
|
+
from config, then a client-credentials login when tenant/clientid/
|
|
20
|
+
clientsecret are given, then the IMDS managed-identity endpoint - so
|
|
21
|
+
on Azure's own platform no credential configuration is needed.
|
|
22
|
+
|
|
23
|
+
As with GCP, the IMDS call is plain http to a link-local host by
|
|
24
|
+
platform design and carries no credential; the login and vault
|
|
25
|
+
addresses are `checkaddr`-guarded.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
RESOURCE = 'https://vault.azure.net'
|
|
29
|
+
|
|
30
|
+
def __init__(self, options=None):
|
|
31
|
+
self.opts = options or {}
|
|
32
|
+
|
|
33
|
+
# A configured token is kept forever; logged-in and IMDS tokens carry
|
|
34
|
+
# expires_in and are renewed shortly before they run out.
|
|
35
|
+
self.livetoken = None
|
|
36
|
+
self.renewat = float('inf')
|
|
37
|
+
|
|
38
|
+
def expiry(self, expires):
|
|
39
|
+
seconds = tonumber(expires)
|
|
40
|
+
return time.time() + max(seconds - 60, 1) if 0 < seconds else float('inf')
|
|
41
|
+
|
|
42
|
+
def login(self):
|
|
43
|
+
opts = self.opts
|
|
44
|
+
|
|
45
|
+
if opts.get('token'):
|
|
46
|
+
return opts['token']
|
|
47
|
+
|
|
48
|
+
if opts.get('tenant') and opts.get('clientid') and opts.get('clientsecret'):
|
|
49
|
+
loginaddr = opts.get('loginaddr') or 'https://login.microsoftonline.com'
|
|
50
|
+
checkaddr(loginaddr)
|
|
51
|
+
|
|
52
|
+
url = loginaddr.rstrip('/') + '/' + opts['tenant'] + '/oauth2/v2.0/token'
|
|
53
|
+
form = ('grant_type=client_credentials&client_id=' + urlpart(opts['clientid'])
|
|
54
|
+
+ '&client_secret=' + urlpart(opts['clientsecret'])
|
|
55
|
+
+ '&scope=' + urlpart(self.RESOURCE + '/.default'))
|
|
56
|
+
|
|
57
|
+
status, body = fetchjson(
|
|
58
|
+
'POST', url, {'content-type': 'application/x-www-form-urlencoded'}, form
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
got = (body or {}).get('access_token')
|
|
62
|
+
if 200 != status or not got:
|
|
63
|
+
raise SekretoError('sekreto: azure login failed: ' + str(status))
|
|
64
|
+
|
|
65
|
+
self.renewat = self.expiry((body or {}).get('expires_in'))
|
|
66
|
+
return str(got)
|
|
67
|
+
|
|
68
|
+
imds = ((opts.get('imdsaddr') or 'http://169.254.169.254').rstrip('/')
|
|
69
|
+
+ '/metadata/identity/oauth2/token?api-version=2018-02-01&resource='
|
|
70
|
+
+ urlpart(self.RESOURCE))
|
|
71
|
+
|
|
72
|
+
status, body = fetchjson('GET', imds, {'Metadata': 'true'})
|
|
73
|
+
|
|
74
|
+
got = (body or {}).get('access_token')
|
|
75
|
+
if 200 != status or not got:
|
|
76
|
+
raise SekretoError(
|
|
77
|
+
'sekreto: azure: no token, no client credentials, and IMDS did not answer'
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
self.renewat = self.expiry((body or {}).get('expires_in'))
|
|
81
|
+
return str(got)
|
|
82
|
+
|
|
83
|
+
def lookup(self, name):
|
|
84
|
+
vault = self.opts.get('vault') or ''
|
|
85
|
+
if '' == vault:
|
|
86
|
+
raise SekretoError('sekreto: azure: no vault')
|
|
87
|
+
|
|
88
|
+
# Only an explicit scheme is a URL; a vault NAMED httpvault must
|
|
89
|
+
# still become https://httpvault.vault.azure.net.
|
|
90
|
+
if vault.startswith('http://') or vault.startswith('https://'):
|
|
91
|
+
vaulturl = vault
|
|
92
|
+
else:
|
|
93
|
+
vaulturl = 'https://' + vault + '.vault.azure.net'
|
|
94
|
+
checkaddr(vaulturl)
|
|
95
|
+
|
|
96
|
+
if self.livetoken is None or time.time() >= self.renewat:
|
|
97
|
+
self.livetoken = self.login()
|
|
98
|
+
|
|
99
|
+
url = (vaulturl.rstrip('/') + '/secrets/' + flatname(name, '-')
|
|
100
|
+
+ '?api-version=' + (self.opts.get('apiversion') or '7.4'))
|
|
101
|
+
|
|
102
|
+
status, body = fetchjson('GET', url, {'authorization': 'Bearer ' + self.livetoken})
|
|
103
|
+
|
|
104
|
+
if 404 == status:
|
|
105
|
+
return None
|
|
106
|
+
|
|
107
|
+
if 200 != status:
|
|
108
|
+
raise SekretoError(
|
|
109
|
+
'sekreto: azure error: ' + str(status) + ': ' + url.split('?')[0]
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
value = (body or {}).get('value')
|
|
113
|
+
return None if value is None else str(value)
|
|
114
|
+
|
|
115
|
+
def describe(self):
|
|
116
|
+
return 'azuresecrets:' + (self.opts.get('vault') or '')
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# The plugin: the `azuresecrets` provider kind, as a voxgig/plugin definition.
|
|
120
|
+
azuresecrets = providerplugin('azuresecrets', AzuresecretsProvider)
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# VENDORED: @voxgig/sekreto 0.2.0 (python/voxgig_sekreto/plugins/boru.py)
|
|
2
|
+
# Source: https://github.com/voxgig/sekreto @ a5a00db6e6d3a1ddbdef7ac62e8a75be53a9e042 [tag: sdk-20260904-1610-0]
|
|
3
|
+
# License: MIT (c) voxgig - see repository LICENSE. Do not edit: resync from upstream.
|
|
4
|
+
# The boru plugin: a boru vault through its CLI, or over `boru vault
|
|
5
|
+
# serve`. Needs a child process, or HTTPS in wire mode. A port of
|
|
6
|
+
# typescript/plugins/boru.ts.
|
|
7
|
+
import os
|
|
8
|
+
import subprocess
|
|
9
|
+
|
|
10
|
+
from ..addr import checkaddr
|
|
11
|
+
from ..sekreto import SekretoError, checkname
|
|
12
|
+
from ..providers import Provider, providerplugin
|
|
13
|
+
from .httpjson import fetchjson
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BoruProvider(Provider):
|
|
17
|
+
"""A boru vault (https://github.com/boru-lang/boru).
|
|
18
|
+
|
|
19
|
+
Two ways in, both boru's own.
|
|
20
|
+
|
|
21
|
+
With no `addr`, the CLI: `boru vault get --reveal <alias>` prints the
|
|
22
|
+
secret on stdout and nothing else. The passphrase is read by boru
|
|
23
|
+
itself from `BORU_VAULT_PASSPHRASE`; sekreto never accepts it as
|
|
24
|
+
config and never puts it on a command line, where it would show up in
|
|
25
|
+
the process table.
|
|
26
|
+
|
|
27
|
+
With an `addr`, boru's wire protocol: `boru vault serve` publishes a
|
|
28
|
+
read-only, HashiCorp-shaped provision API (boru's
|
|
29
|
+
design/VAULT-WIRE-PROTOCOL.0.md), authenticated by a capability token
|
|
30
|
+
from `boru vault grant`. A sekreto name is already a valid boru
|
|
31
|
+
alias, and boru aliases keep their dots, so `api.token` is the single
|
|
32
|
+
path segment `api.token` - not the `api`/`token` split a HashiCorp KV
|
|
33
|
+
gets. The value is the `value` field. A 404 is a miss; anything else
|
|
34
|
+
the server refuses (a revoked capability, a sealed vault) is an
|
|
35
|
+
error.
|
|
36
|
+
|
|
37
|
+
boru's `vault proxy` and `vault mcp` remain out of bounds: they are a
|
|
38
|
+
credential *broker*, built precisely so the caller never receives the
|
|
39
|
+
credential. `vault serve` is the provision endpoint, built to hand
|
|
40
|
+
the value back - that is the one sekreto uses.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self, command=None, namespace=None, home=None,
|
|
44
|
+
addr=None, token=None, mount=None):
|
|
45
|
+
self.command = command or 'boru'
|
|
46
|
+
self.namespace = namespace
|
|
47
|
+
self.home = home
|
|
48
|
+
self.addr = addr.rstrip('/') if addr else None
|
|
49
|
+
self.token = token
|
|
50
|
+
self.mount = mount or 'secret'
|
|
51
|
+
|
|
52
|
+
def lookup(self, name):
|
|
53
|
+
checkname(name)
|
|
54
|
+
|
|
55
|
+
if self.addr:
|
|
56
|
+
return self.wirelookup(name)
|
|
57
|
+
|
|
58
|
+
alias = self.namespace + ':' + name if self.namespace else name
|
|
59
|
+
|
|
60
|
+
env = dict(os.environ)
|
|
61
|
+
if self.home:
|
|
62
|
+
env['BORU_HOME'] = self.home
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
run = subprocess.run(
|
|
66
|
+
[self.command, 'vault', 'get', '--reveal', alias],
|
|
67
|
+
capture_output=True,
|
|
68
|
+
text=True,
|
|
69
|
+
env=env,
|
|
70
|
+
# Not inherited: a CLI that reads stdin - one prompting for a
|
|
71
|
+
# passphrase when its environment variable is absent - would
|
|
72
|
+
# otherwise block on the parent's own stdin forever, and
|
|
73
|
+
# nothing here sets a timeout. `capture_output` covers only
|
|
74
|
+
# the other two streams.
|
|
75
|
+
stdin=subprocess.DEVNULL,
|
|
76
|
+
)
|
|
77
|
+
except OSError as err:
|
|
78
|
+
raise SekretoError('sekreto: cannot run ' + self.command + ': ' + str(err))
|
|
79
|
+
|
|
80
|
+
if 0 == run.returncode:
|
|
81
|
+
# boru prints the value and one newline, and nothing else.
|
|
82
|
+
return run.stdout[:-1] if run.stdout.endswith('\n') else run.stdout
|
|
83
|
+
|
|
84
|
+
why = (run.stderr or '').strip()
|
|
85
|
+
|
|
86
|
+
# "no alias named" is boru saying it does not hold this secret, which
|
|
87
|
+
# is a miss: the chain carries on to the next provider. A locked vault
|
|
88
|
+
# or a wrong passphrase is not a miss - treating it as one would fall
|
|
89
|
+
# through to a weaker store without saying so.
|
|
90
|
+
if borumiss(why):
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
raise SekretoError(
|
|
94
|
+
'sekreto: boru vault error: ' + (why or 'exit ' + str(run.returncode))
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
def wirelookup(self, name):
|
|
98
|
+
checkaddr(self.addr)
|
|
99
|
+
|
|
100
|
+
alias = self.namespace + '/' + name if self.namespace else name
|
|
101
|
+
url = self.addr + '/v1/' + self.mount + '/data/' + alias
|
|
102
|
+
|
|
103
|
+
status, body = fetchjson('GET', url, {'X-Vault-Token': self.token or ''})
|
|
104
|
+
|
|
105
|
+
if 404 == status:
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
if 200 != status:
|
|
109
|
+
raise SekretoError('sekreto: boru serve error: ' + str(status) + ': ' + url)
|
|
110
|
+
|
|
111
|
+
data = ((body or {}).get('data') or {}).get('data')
|
|
112
|
+
value = data.get('value') if isinstance(data, dict) else None
|
|
113
|
+
|
|
114
|
+
return None if value is None else str(value)
|
|
115
|
+
|
|
116
|
+
def describe(self):
|
|
117
|
+
if self.addr:
|
|
118
|
+
return 'boru:' + self.addr
|
|
119
|
+
return 'boru' + (':' + self.namespace if self.namespace else '')
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def borumiss(why):
|
|
123
|
+
"""Does this boru failure mean "no such secret" rather than "I could not
|
|
124
|
+
answer"? Matched on boru's own wording for a missing alias."""
|
|
125
|
+
return 'no alias named' in why
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _make(spec):
|
|
129
|
+
return BoruProvider(
|
|
130
|
+
spec.get('command'),
|
|
131
|
+
spec.get('namespace'),
|
|
132
|
+
spec.get('home'),
|
|
133
|
+
spec.get('addr'),
|
|
134
|
+
spec.get('token'),
|
|
135
|
+
spec.get('mount'),
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
# The plugin: the `boru` provider kind, as a voxgig/plugin definition.
|
|
140
|
+
boru = providerplugin('boru', _make)
|