@voxgig/sdkgen 4.32.1 → 4.34.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/action/copies.d.ts +21 -0
- package/dist/action/copies.js +146 -0
- package/dist/action/copies.js.map +1 -0
- package/dist/action/doctor.d.ts +15 -2
- package/dist/action/doctor.js +169 -23
- package/dist/action/doctor.js.map +1 -1
- package/dist/action/edition.js +6 -2
- package/dist/action/edition.js.map +1 -1
- package/dist/action/feature.js +6 -2
- package/dist/action/feature.js.map +1 -1
- package/dist/action/package.js +28 -10
- package/dist/action/package.js.map +1 -1
- package/dist/action/remove.js +2 -0
- package/dist/action/remove.js.map +1 -1
- package/dist/action/resolve.d.ts +1 -0
- package/dist/action/resolve.js +10 -2
- package/dist/action/resolve.js.map +1 -1
- package/dist/action/target.js +6 -2
- package/dist/action/target.js.map +1 -1
- package/dist/helpers/naming.js +1 -1
- package/dist/helpers/naming.js.map +1 -1
- package/dist/sdkgen.d.ts +2 -1
- package/dist/sdkgen.js +36 -3
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/model/sdkgen.aontu +7 -1
- package/package.json +1 -1
- package/project/.sdk/model/feature/debug.aontu +3 -1
- package/project/.sdk/src/cmp/c/PrepareAuth_c.ts +8 -28
- package/project/.sdk/src/cmp/c/TestClean_c.ts +774 -0
- package/project/.sdk/src/cmp/c/Test_c.ts +3 -0
- package/project/.sdk/src/cmp/c/fragment/Entity.fragment.c +16 -5
- package/project/.sdk/src/cmp/c/fragment/Main.fragment.c +1 -1
- package/project/.sdk/src/cmp/clojure/PrepareAuth_clojure.ts +3 -0
- package/project/.sdk/src/cmp/clojure/TestClean_clojure.ts +473 -0
- package/project/.sdk/src/cmp/clojure/Test_clojure.ts +6 -0
- package/project/.sdk/src/cmp/clojure/fragment/Entity.fragment.clj +18 -8
- package/project/.sdk/src/cmp/cpp/PrepareAuth_cpp.ts +3 -0
- package/project/.sdk/src/cmp/cpp/TestClean_cpp.ts +782 -0
- package/project/.sdk/src/cmp/cpp/TestEntity_cpp.ts +1 -1
- package/project/.sdk/src/cmp/cpp/Test_cpp.ts +2 -0
- package/project/.sdk/src/cmp/csharp/PrepareAuth_csharp.ts +3 -0
- package/project/.sdk/src/cmp/csharp/TestClean_csharp.ts +887 -0
- package/project/.sdk/src/cmp/csharp/Test_csharp.ts +2 -0
- package/project/.sdk/src/cmp/csharp/fragment/EntityBase.fragment.cs +68 -4
- package/project/.sdk/src/cmp/csharp/fragment/Main.fragment.cs +8 -2
- package/project/.sdk/src/cmp/csharp/fragment/SdkError.fragment.cs +49 -0
- package/project/.sdk/src/cmp/elixir/PrepareAuth_elixir.ts +3 -0
- package/project/.sdk/src/cmp/elixir/Schema_elixir.ts +20 -10
- package/project/.sdk/src/cmp/elixir/TestClean_elixir.ts +666 -0
- package/project/.sdk/src/cmp/elixir/Test_elixir.ts +4 -0
- package/project/.sdk/src/cmp/elixir/fragment/Main.fragment.ex +1 -1
- package/project/.sdk/src/cmp/elixir/fragment/Pipeline.fragment.ex +14 -2
- package/project/.sdk/src/cmp/go/PrepareAuth_go.ts +3 -0
- package/project/.sdk/src/cmp/go/TestClean_go.ts +804 -0
- package/project/.sdk/src/cmp/go/Test_go.ts +3 -0
- package/project/.sdk/src/cmp/go/fragment/Entity.fragment.go +54 -4
- package/project/.sdk/src/cmp/go/fragment/Main.fragment.go +27 -2
- package/project/.sdk/src/cmp/java/PrepareAuth_java.ts +3 -0
- package/project/.sdk/src/cmp/java/TestClean_java.ts +884 -0
- package/project/.sdk/src/cmp/java/Test_java.ts +2 -0
- package/project/.sdk/src/cmp/java/fragment/EntityBase.fragment.java +56 -11
- package/project/.sdk/src/cmp/java/fragment/SdkError.fragment.java +36 -3
- package/project/.sdk/src/cmp/js/PrepareAuth_js.ts +3 -0
- package/project/.sdk/src/cmp/js/TestClean_js.ts +458 -0
- package/project/.sdk/src/cmp/js/Test_js.ts +2 -0
- package/project/.sdk/src/cmp/js/fragment/EntityBase.fragment.js +5 -4
- package/project/.sdk/src/cmp/js/fragment/EntityCreateOp.fragment.js +7 -1
- package/project/.sdk/src/cmp/js/fragment/EntityListOp.fragment.js +7 -1
- package/project/.sdk/src/cmp/js/fragment/EntityLoadOp.fragment.js +7 -1
- package/project/.sdk/src/cmp/js/fragment/EntityRemoveOp.fragment.js +7 -1
- package/project/.sdk/src/cmp/js/fragment/EntityUpdateOp.fragment.js +7 -1
- package/project/.sdk/src/cmp/js/fragment/Main.fragment.js +11 -2
- package/project/.sdk/src/cmp/js/fragment/SdkError.fragment.js +17 -1
- package/project/.sdk/src/cmp/kotlin/Package_kotlin.ts +5 -0
- package/project/.sdk/src/cmp/kotlin/PrepareAuth_kotlin.ts +3 -0
- package/project/.sdk/src/cmp/kotlin/TestClean_kotlin.ts +654 -0
- package/project/.sdk/src/cmp/kotlin/Test_kotlin.ts +3 -0
- package/project/.sdk/src/cmp/kotlin/fragment/EntityBase.fragment.kt +44 -11
- package/project/.sdk/src/cmp/kotlin/fragment/SdkError.fragment.kt +31 -0
- package/project/.sdk/src/cmp/lua/PrepareAuth_lua.ts +3 -0
- package/project/.sdk/src/cmp/lua/TestClean_lua.ts +769 -0
- package/project/.sdk/src/cmp/lua/Test_lua.ts +3 -0
- package/project/.sdk/src/cmp/lua/fragment/Entity.fragment.lua +77 -1
- package/project/.sdk/src/cmp/lua/fragment/Main.fragment.lua +49 -2
- package/project/.sdk/src/cmp/ocaml/Entity_ocaml.ts +3 -2
- package/project/.sdk/src/cmp/ocaml/PrepareAuth_ocaml.ts +4 -25
- package/project/.sdk/src/cmp/ocaml/TestClean_ocaml.ts +538 -0
- package/project/.sdk/src/cmp/ocaml/Test_ocaml.ts +5 -0
- package/project/.sdk/src/cmp/ocaml/fragment/RunOp.fragment.ml +16 -4
- package/project/.sdk/src/cmp/perl/PrepareAuth_perl.ts +3 -0
- package/project/.sdk/src/cmp/perl/TestClean_perl.ts +619 -0
- package/project/.sdk/src/cmp/perl/Test_perl.ts +3 -0
- package/project/.sdk/src/cmp/perl/fragment/Entity.fragment.pm +67 -5
- package/project/.sdk/src/cmp/perl/fragment/Main.fragment.pm +13 -1
- package/project/.sdk/src/cmp/php/PrepareAuth_php.ts +3 -0
- package/project/.sdk/src/cmp/php/TestClean_php.ts +809 -0
- package/project/.sdk/src/cmp/php/Test_php.ts +2 -0
- package/project/.sdk/src/cmp/php/fragment/Entity.fragment.php +96 -55
- package/project/.sdk/src/cmp/php/fragment/Main.fragment.php +15 -2
- package/project/.sdk/src/cmp/py/PrepareAuth_py.ts +3 -0
- package/project/.sdk/src/cmp/py/TestClean_py.ts +549 -0
- package/project/.sdk/src/cmp/py/Test_py.ts +3 -0
- package/project/.sdk/src/cmp/py/fragment/Entity.fragment.py +83 -55
- package/project/.sdk/src/cmp/py/fragment/Main.fragment.py +19 -3
- package/project/.sdk/src/cmp/rb/PrepareAuth_rb.ts +3 -0
- package/project/.sdk/src/cmp/rb/TestClean_rb.ts +535 -0
- package/project/.sdk/src/cmp/rb/Test_rb.ts +3 -0
- package/project/.sdk/src/cmp/rb/fragment/Entity.fragment.rb +108 -46
- package/project/.sdk/src/cmp/rb/fragment/Main.fragment.rb +12 -1
- package/project/.sdk/src/cmp/rust/PrepareAuth_rust.ts +9 -45
- package/project/.sdk/src/cmp/rust/TestClean_rust.ts +881 -0
- package/project/.sdk/src/cmp/rust/Test_rust.ts +3 -0
- package/project/.sdk/src/cmp/rust/fragment/Entity.fragment.rs +14 -6
- package/project/.sdk/src/cmp/rust/fragment/Main.fragment.rs +17 -1
- package/project/.sdk/src/cmp/rust/fragment/SdkError.fragment.rs +34 -2
- package/project/.sdk/src/cmp/scala/PrepareAuth_scala.ts +3 -0
- package/project/.sdk/src/cmp/scala/TestClean_scala.ts +608 -0
- package/project/.sdk/src/cmp/scala/Test_scala.ts +3 -0
- package/project/.sdk/src/cmp/scala/fragment/EntityBase.fragment.scala +58 -6
- package/project/.sdk/src/cmp/swift/PrepareAuth_swift.ts +3 -0
- package/project/.sdk/src/cmp/swift/TestClean_swift.ts +671 -0
- package/project/.sdk/src/cmp/swift/Test_swift.ts +3 -0
- package/project/.sdk/src/cmp/swift/fragment/EntityBase.fragment.swift +10 -0
- package/project/.sdk/src/cmp/swift/fragment/Main.fragment.swift +16 -2
- package/project/.sdk/src/cmp/swift/fragment/SdkError.fragment.swift +47 -3
- package/project/.sdk/src/cmp/ts/PrepareAuth_ts.ts +3 -0
- package/project/.sdk/src/cmp/ts/TestClean_ts.ts +465 -0
- package/project/.sdk/src/cmp/ts/Test_ts.ts +2 -0
- package/project/.sdk/src/cmp/ts/fragment/EntityBase.fragment.ts +5 -4
- package/project/.sdk/src/cmp/ts/fragment/EntityCreateOp.fragment.ts +7 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityListOp.fragment.ts +7 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityLoadOp.fragment.ts +7 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityRemoveOp.fragment.ts +7 -1
- package/project/.sdk/src/cmp/ts/fragment/EntityUpdateOp.fragment.ts +7 -1
- package/project/.sdk/src/cmp/ts/fragment/Main.fragment.ts +8 -2
- package/project/.sdk/src/cmp/ts/fragment/SdkError.fragment.ts +20 -2
- package/project/.sdk/src/cmp/zig/PrepareAuth_zig.ts +3 -0
- package/project/.sdk/src/cmp/zig/TestClean_zig.ts +791 -0
- package/project/.sdk/src/cmp/zig/Test_zig.ts +5 -0
- package/project/.sdk/src/cmp/zig/fragment/Build.fragment.zig +19 -0
- package/project/.sdk/src/cmp/zig/fragment/Entity.fragment.zig +14 -5
- package/project/.sdk/src/cmp/zig/fragment/Main.fragment.zig +1 -1
- package/project/.sdk/tm/c/core/context.c +25 -0
- package/project/.sdk/tm/c/core/error.c +16 -0
- package/project/.sdk/tm/c/core/sdk.h +22 -0
- package/project/.sdk/tm/c/feature/audit.c +2 -0
- package/project/.sdk/tm/c/feature/cost.c +1 -0
- package/project/.sdk/tm/c/feature/debug.c +19 -29
- package/project/.sdk/tm/c/feature/log.c +21 -2
- package/project/.sdk/tm/c/feature/proxy.c +55 -3
- package/project/.sdk/tm/c/feature/secrets.c +7 -0
- package/project/.sdk/tm/c/feature/telemetry.c +2 -0
- package/project/.sdk/tm/c/tests/feature_test.c +2 -2
- package/project/.sdk/tm/c/utility/clean.c +530 -8
- package/project/.sdk/tm/c/utility/done.c +28 -12
- package/project/.sdk/tm/c/utility/make_error.c +4 -3
- package/project/.sdk/tm/c/utility/make_options.c +71 -45
- package/project/.sdk/tm/clojure/feature/secrets/sdk/feature/secrets.clj +15 -0
- package/project/.sdk/tm/clojure/src/sdk/client.clj +20 -4
- package/project/.sdk/tm/clojure/src/sdk/core.clj +319 -35
- package/project/.sdk/tm/clojure/src/sdk/features.clj +68 -30
- package/project/.sdk/tm/clojure/test/sdk/test/feature.clj +4 -2
- package/project/.sdk/tm/clojure/test/sdk/test/pipeline.clj +47 -20
- package/project/.sdk/tm/clojure/test/sdk/test_runner.clj +4 -0
- package/project/.sdk/tm/cpp/core/types.hpp +93 -3
- package/project/.sdk/tm/cpp/feature/audit.hpp +1 -0
- package/project/.sdk/tm/cpp/feature/cost.hpp +1 -0
- package/project/.sdk/tm/cpp/feature/debug.hpp +20 -12
- package/project/.sdk/tm/cpp/feature/log.hpp +31 -9
- package/project/.sdk/tm/cpp/feature/proxy.hpp +52 -6
- package/project/.sdk/tm/cpp/feature/secrets.hpp +13 -0
- package/project/.sdk/tm/cpp/feature/telemetry.hpp +4 -2
- package/project/.sdk/tm/cpp/test/feature_test.cpp +2 -2
- package/project/.sdk/tm/cpp/utility/pipeline.hpp +426 -51
- package/project/.sdk/tm/csharp/core/Context.cs +32 -0
- package/project/.sdk/tm/csharp/core/Utility.cs +2 -0
- package/project/.sdk/tm/csharp/feature/AuditFeature.cs +1 -0
- package/project/.sdk/tm/csharp/feature/CostFeature.cs +7 -5
- package/project/.sdk/tm/csharp/feature/DebugFeature.cs +19 -16
- package/project/.sdk/tm/csharp/feature/FeatureOptions.cs +16 -0
- package/project/.sdk/tm/csharp/feature/LogFeature.cs +4 -1
- package/project/.sdk/tm/csharp/feature/ProxyFeature.cs +26 -5
- package/project/.sdk/tm/csharp/feature/SecretsFeature.cs +16 -0
- package/project/.sdk/tm/csharp/feature/TelemetryFeature.cs +4 -2
- package/project/.sdk/tm/csharp/test/FeatureTest.cs +2 -2
- package/project/.sdk/tm/csharp/utility/Clean.cs +440 -2
- package/project/.sdk/tm/csharp/utility/Done.cs +27 -11
- package/project/.sdk/tm/csharp/utility/MakeError.cs +19 -8
- package/project/.sdk/tm/csharp/utility/MakeOptions.cs +119 -29
- package/project/.sdk/tm/csharp/utility/MakeResponse.cs +21 -11
- package/project/.sdk/tm/csharp/utility/Register.cs +1 -0
- package/project/.sdk/tm/elixir/lib/projectname/context.ex +19 -0
- package/project/.sdk/tm/elixir/lib/projectname/entity_base.ex +22 -1
- package/project/.sdk/tm/elixir/lib/projectname/error.ex +24 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/audit.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/cost.ex +2 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature/debug.ex +13 -13
- package/project/.sdk/tm/elixir/lib/projectname/feature/log.ex +18 -5
- package/project/.sdk/tm/elixir/lib/projectname/feature/proxy.ex +19 -1
- package/project/.sdk/tm/elixir/lib/projectname/feature/secrets.ex +15 -0
- package/project/.sdk/tm/elixir/lib/projectname/feature/telemetry.ex +4 -2
- package/project/.sdk/tm/elixir/lib/projectname/feature.ex +22 -0
- package/project/.sdk/tm/elixir/lib/projectname/utility.ex +464 -41
- package/project/.sdk/tm/elixir/test/feature_test.exs +3 -2
- package/project/.sdk/tm/go/core/context.go +42 -0
- package/project/.sdk/tm/go/core/error.go +30 -10
- package/project/.sdk/tm/go/core/utility_type.go +2 -0
- package/project/.sdk/tm/go/feature/audit_feature.go +1 -0
- package/project/.sdk/tm/go/feature/base_feature.go +12 -0
- package/project/.sdk/tm/go/feature/cost_feature.go +2 -2
- package/project/.sdk/tm/go/feature/debug_feature.go +14 -12
- package/project/.sdk/tm/go/feature/log_feature.go +13 -8
- package/project/.sdk/tm/go/feature/proxy_feature.go +26 -6
- package/project/.sdk/tm/go/feature/secrets_feature.go +19 -0
- package/project/.sdk/tm/go/feature/telemetry_feature.go +4 -2
- package/project/.sdk/tm/go/test/feature_test.go +2 -2
- package/project/.sdk/tm/go/utility/clean.go +585 -2
- package/project/.sdk/tm/go/utility/done.go +29 -9
- package/project/.sdk/tm/go/utility/make_error.go +51 -16
- package/project/.sdk/tm/go/utility/make_options.go +77 -36
- package/project/.sdk/tm/go/utility/register.go +12 -0
- package/project/.sdk/tm/java/core/Context.java +29 -0
- package/project/.sdk/tm/java/core/SdkClient.java +4 -2
- package/project/.sdk/tm/java/core/Utility.java +7 -0
- package/project/.sdk/tm/java/feature/AuditFeature.java +6 -0
- package/project/.sdk/tm/java/feature/CostFeature.java +5 -0
- package/project/.sdk/tm/java/feature/DebugFeature.java +25 -14
- package/project/.sdk/tm/java/feature/LogFeature.java +11 -4
- package/project/.sdk/tm/java/feature/ProxyFeature.java +41 -6
- package/project/.sdk/tm/java/feature/SecretsFeature.java +18 -0
- package/project/.sdk/tm/java/feature/TelemetryFeature.java +8 -2
- package/project/.sdk/tm/java/test/FeatureTest.java +2 -2
- package/project/.sdk/tm/java/utility/Clean.java +519 -1
- package/project/.sdk/tm/java/utility/Done.java +1 -1
- package/project/.sdk/tm/java/utility/MakeError.java +5 -1
- package/project/.sdk/tm/java/utility/MakeOptions.java +55 -31
- package/project/.sdk/tm/java/utility/Register.java +4 -0
- package/project/.sdk/tm/js/src/Context.js +5 -1
- package/project/.sdk/tm/js/src/feature/audit/AuditFeature.js +2 -2
- package/project/.sdk/tm/js/src/feature/cost/CostFeature.js +2 -2
- package/project/.sdk/tm/js/src/feature/debug/DebugFeature.js +13 -7
- package/project/.sdk/tm/js/src/feature/log/LogFeature.js +9 -5
- package/project/.sdk/tm/js/src/feature/proxy/ProxyFeature.js +19 -1
- package/project/.sdk/tm/js/src/feature/secrets/SecretsFeature.js +14 -0
- package/project/.sdk/tm/js/src/feature/telemetry/TelemetryFeature.js +4 -2
- package/project/.sdk/tm/js/src/utility/CleanUtility.js +294 -21
- package/project/.sdk/tm/js/src/utility/DoneUtility.js +17 -5
- package/project/.sdk/tm/js/src/utility/MakeErrorUtility.js +18 -2
- package/project/.sdk/tm/js/src/utility/MakeOptionsUtility.js +39 -15
- package/project/.sdk/tm/js/src/utility/Utility.js +4 -2
- package/project/.sdk/tm/js/test/feature/harness.js +11 -1
- package/project/.sdk/tm/js/test/feature.test.js +9 -2
- package/project/.sdk/tm/kotlin/core/Context.kt +19 -0
- package/project/.sdk/tm/kotlin/core/SdkClient.kt +9 -2
- package/project/.sdk/tm/kotlin/core/Utility.kt +2 -0
- package/project/.sdk/tm/kotlin/feature/AuditFeature.kt +11 -9
- package/project/.sdk/tm/kotlin/feature/CostFeature.kt +8 -5
- package/project/.sdk/tm/kotlin/feature/DebugFeature.kt +15 -22
- package/project/.sdk/tm/kotlin/feature/LogFeature.kt +8 -4
- package/project/.sdk/tm/kotlin/feature/ProxyFeature.kt +26 -2
- package/project/.sdk/tm/kotlin/feature/SecretsFeature.kt +11 -0
- package/project/.sdk/tm/kotlin/feature/TelemetryFeature.kt +4 -2
- package/project/.sdk/tm/kotlin/test/FeatureTest.kt +2 -2
- package/project/.sdk/tm/kotlin/utility/CoreUtil.kt +447 -11
- package/project/.sdk/tm/kotlin/utility/MakeOptions.kt +38 -31
- package/project/.sdk/tm/kotlin/utility/Register.kt +1 -0
- package/project/.sdk/tm/lua/core/context.lua +43 -0
- package/project/.sdk/tm/lua/core/error.lua +36 -1
- package/project/.sdk/tm/lua/core/utility_type.lua +4 -0
- package/project/.sdk/tm/lua/feature/audit_feature.lua +2 -2
- package/project/.sdk/tm/lua/feature/cost_feature.lua +2 -2
- package/project/.sdk/tm/lua/feature/debug_feature.lua +21 -17
- package/project/.sdk/tm/lua/feature/log_feature.lua +2 -1
- package/project/.sdk/tm/lua/feature/proxy_feature.lua +23 -1
- package/project/.sdk/tm/lua/feature/secrets_feature.lua +18 -0
- package/project/.sdk/tm/lua/feature/telemetry_feature.lua +4 -2
- package/project/.sdk/tm/lua/test/feature/secrets/secrets_feature_test.lua +3 -2
- package/project/.sdk/tm/lua/test/feature_test.lua +10 -3
- package/project/.sdk/tm/lua/utility/clean.lua +426 -2
- package/project/.sdk/tm/lua/utility/clean_explain.lua +34 -0
- package/project/.sdk/tm/lua/utility/done.lua +1 -7
- package/project/.sdk/tm/lua/utility/make_error.lua +3 -1
- package/project/.sdk/tm/lua/utility/make_options.lua +76 -30
- package/project/.sdk/tm/lua/utility/register.lua +4 -1
- package/project/.sdk/tm/ocaml/Makefile +5 -1
- package/project/.sdk/tm/ocaml/feature/secrets_feature.ml +12 -1
- package/project/.sdk/tm/ocaml/sdk_features.ml +78 -18
- package/project/.sdk/tm/ocaml/sdk_helpers.ml +27 -0
- package/project/.sdk/tm/ocaml/sdk_runtime.ml +304 -26
- package/project/.sdk/tm/ocaml/sdk_types.ml +1 -0
- package/project/.sdk/tm/ocaml/test/feature/secrets/t_secrets.ml +3 -1
- package/project/.sdk/tm/ocaml/test/t_feature.ml +2 -2
- package/project/.sdk/tm/perl/core/context.pm +27 -0
- package/project/.sdk/tm/perl/core/error.pm +52 -5
- package/project/.sdk/tm/perl/feature/audit_feature.pm +2 -2
- package/project/.sdk/tm/perl/feature/cost_feature.pm +2 -2
- package/project/.sdk/tm/perl/feature/debug_feature.pm +17 -13
- package/project/.sdk/tm/perl/feature/log_feature.pm +3 -1
- package/project/.sdk/tm/perl/feature/proxy_feature.pm +21 -1
- package/project/.sdk/tm/perl/feature/secrets_feature.pm +20 -1
- package/project/.sdk/tm/perl/feature/telemetry_feature.pm +4 -2
- package/project/.sdk/tm/perl/t/feature.t +4 -2
- package/project/.sdk/tm/perl/utility/clean.pm +345 -1
- package/project/.sdk/tm/perl/utility/done.pm +24 -6
- package/project/.sdk/tm/perl/utility/make_error.pm +17 -4
- package/project/.sdk/tm/perl/utility/make_options.pm +33 -14
- package/project/.sdk/tm/php/core/Context.php +24 -1
- package/project/.sdk/tm/php/core/Error.php +34 -3
- package/project/.sdk/tm/php/core/UtilityType.php +4 -0
- package/project/.sdk/tm/php/feature/AuditFeature.php +2 -2
- package/project/.sdk/tm/php/feature/CostFeature.php +2 -2
- package/project/.sdk/tm/php/feature/DebugFeature.php +18 -9
- package/project/.sdk/tm/php/feature/LogFeature.php +5 -2
- package/project/.sdk/tm/php/feature/ProxyFeature.php +20 -1
- package/project/.sdk/tm/php/feature/SecretsFeature.php +18 -0
- package/project/.sdk/tm/php/feature/TelemetryFeature.php +4 -2
- package/project/.sdk/tm/php/test/FeatureTest.php +2 -2
- package/project/.sdk/tm/php/utility/Clean.php +438 -2
- package/project/.sdk/tm/php/utility/Done.php +14 -7
- package/project/.sdk/tm/php/utility/MakeError.php +9 -7
- package/project/.sdk/tm/php/utility/MakeOptions.php +62 -38
- package/project/.sdk/tm/php/utility/Register.php +2 -0
- package/project/.sdk/tm/py/pkg/core/context.py +17 -0
- package/project/.sdk/tm/py/pkg/core/error.py +42 -1
- package/project/.sdk/tm/py/pkg/core/utility_type.py +4 -0
- package/project/.sdk/tm/py/pkg/feature/audit_feature.py +2 -2
- package/project/.sdk/tm/py/pkg/feature/cost_feature.py +2 -2
- package/project/.sdk/tm/py/pkg/feature/debug_feature.py +17 -12
- package/project/.sdk/tm/py/pkg/feature/log_feature.py +2 -1
- package/project/.sdk/tm/py/pkg/feature/proxy_feature.py +18 -1
- package/project/.sdk/tm/py/pkg/feature/secrets_feature.py +12 -0
- package/project/.sdk/tm/py/pkg/feature/telemetry_feature.py +4 -2
- package/project/.sdk/tm/py/pkg/utility/clean.py +311 -1
- package/project/.sdk/tm/py/pkg/utility/done.py +18 -5
- package/project/.sdk/tm/py/pkg/utility/make_error.py +9 -6
- package/project/.sdk/tm/py/pkg/utility/make_options.py +64 -25
- package/project/.sdk/tm/py/pkg/utility/make_response.py +19 -13
- package/project/.sdk/tm/py/pkg/utility/register.py +4 -2
- package/project/.sdk/tm/py/test/feature_harness.py +4 -0
- package/project/.sdk/tm/py/test/test_feature.py +2 -2
- package/project/.sdk/tm/py/test/test_primary_utility.py +1 -0
- package/project/.sdk/tm/rb/core/context.rb +28 -0
- package/project/.sdk/tm/rb/core/error.rb +30 -0
- package/project/.sdk/tm/rb/core/utility_type.rb +1 -1
- package/project/.sdk/tm/rb/feature/audit_feature.rb +2 -2
- package/project/.sdk/tm/rb/feature/cost_feature.rb +2 -2
- package/project/.sdk/tm/rb/feature/debug_feature.rb +15 -12
- package/project/.sdk/tm/rb/feature/log_feature.rb +3 -1
- package/project/.sdk/tm/rb/feature/proxy_feature.rb +25 -1
- package/project/.sdk/tm/rb/feature/secrets_feature.rb +17 -0
- package/project/.sdk/tm/rb/feature/telemetry_feature.rb +4 -2
- package/project/.sdk/tm/rb/test/feature_test.rb +4 -2
- package/project/.sdk/tm/rb/utility/clean.rb +312 -1
- package/project/.sdk/tm/rb/utility/done.rb +15 -5
- package/project/.sdk/tm/rb/utility/make_error.rb +13 -4
- package/project/.sdk/tm/rb/utility/make_options.rb +31 -12
- package/project/.sdk/tm/rb/utility/register.rb +2 -0
- package/project/.sdk/tm/rust/core/context.rs +55 -0
- package/project/.sdk/tm/rust/core/utility_type.rs +17 -0
- package/project/.sdk/tm/rust/feature/audit.rs +2 -0
- package/project/.sdk/tm/rust/feature/cost.rs +3 -2
- package/project/.sdk/tm/rust/feature/debug.rs +16 -16
- package/project/.sdk/tm/rust/feature/log.rs +42 -7
- package/project/.sdk/tm/rust/feature/proxy.rs +48 -2
- package/project/.sdk/tm/rust/feature/secrets.rs +12 -0
- package/project/.sdk/tm/rust/feature/telemetry.rs +2 -0
- package/project/.sdk/tm/rust/tests/feature_test.rs +2 -2
- package/project/.sdk/tm/rust/utility/clean.rs +446 -5
- package/project/.sdk/tm/rust/utility/done.rs +22 -12
- package/project/.sdk/tm/rust/utility/make_error.rs +4 -1
- package/project/.sdk/tm/rust/utility/make_options.rs +73 -19
- package/project/.sdk/tm/scala/Makefile +3 -1
- package/project/.sdk/tm/scala/core/Context.scala +16 -0
- package/project/.sdk/tm/scala/core/SdkClient.scala +14 -4
- package/project/.sdk/tm/scala/core/SdkError.scala +28 -0
- package/project/.sdk/tm/scala/core/Types.scala +3 -0
- package/project/.sdk/tm/scala/core/Utility.scala +2 -0
- package/project/.sdk/tm/scala/feature/AuditFeature.scala +16 -10
- package/project/.sdk/tm/scala/feature/CostFeature.scala +10 -5
- package/project/.sdk/tm/scala/feature/DebugFeature.scala +24 -21
- package/project/.sdk/tm/scala/feature/LogFeature.scala +9 -4
- package/project/.sdk/tm/scala/feature/ProxyFeature.scala +23 -2
- package/project/.sdk/tm/scala/feature/SecretsFeature.scala +14 -0
- package/project/.sdk/tm/scala/feature/TelemetryFeature.scala +9 -2
- package/project/.sdk/tm/scala/sdktest/SdkTestMain.scala +2 -2
- package/project/.sdk/tm/scala/utility/Make.scala +63 -20
- package/project/.sdk/tm/scala/utility/Misc.scala +358 -5
- package/project/.sdk/tm/scala/utility/Register.scala +1 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Context.swift +29 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/core/Utility.swift +2 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/AuditFeature.swift +10 -9
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/CostFeature.swift +7 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/DebugFeature.swift +19 -15
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/FeatureOptions.swift +16 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/LogFeature.swift +4 -1
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/ProxyFeature.swift +20 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/SecretsFeature.swift +13 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/feature/TelemetryFeature.swift +4 -2
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeError.swift +15 -5
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/MakeOptions.swift +58 -19
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/Register.swift +1 -0
- package/project/.sdk/tm/swift/Sources/ProjectNameSDK/utility/ResultUtil.swift +391 -4
- package/project/.sdk/tm/swift/Tests/ProjectNameSDKTests/FeatureTest.swift +2 -2
- package/project/.sdk/tm/ts/src/Context.ts +5 -1
- package/project/.sdk/tm/ts/src/feature/audit/AuditFeature.ts +2 -2
- package/project/.sdk/tm/ts/src/feature/cost/CostFeature.ts +2 -2
- package/project/.sdk/tm/ts/src/feature/debug/DebugFeature.ts +13 -7
- package/project/.sdk/tm/ts/src/feature/log/LogFeature.ts +9 -5
- package/project/.sdk/tm/ts/src/feature/proxy/ProxyFeature.ts +19 -1
- package/project/.sdk/tm/ts/src/feature/secrets/SecretsFeature.ts +12 -0
- package/project/.sdk/tm/ts/src/feature/telemetry/TelemetryFeature.ts +4 -2
- package/project/.sdk/tm/ts/src/utility/CleanUtility.ts +287 -9
- package/project/.sdk/tm/ts/src/utility/DoneUtility.ts +18 -5
- package/project/.sdk/tm/ts/src/utility/MakeErrorUtility.ts +18 -8
- package/project/.sdk/tm/ts/src/utility/MakeOptionsUtility.ts +38 -16
- package/project/.sdk/tm/ts/src/utility/Utility.ts +4 -2
- package/project/.sdk/tm/ts/test/feature/harness.ts +11 -1
- package/project/.sdk/tm/ts/test/feature.test.ts +9 -2
- package/project/.sdk/tm/zig/core/context.zig +34 -0
- package/project/.sdk/tm/zig/core/error.zig +22 -1
- package/project/.sdk/tm/zig/core/utility.zig +403 -39
- package/project/.sdk/tm/zig/feature/audit.zig +4 -2
- package/project/.sdk/tm/zig/feature/cost.zig +3 -2
- package/project/.sdk/tm/zig/feature/debug.zig +20 -25
- package/project/.sdk/tm/zig/feature/log.zig +3 -1
- package/project/.sdk/tm/zig/feature/proxy.zig +47 -6
- package/project/.sdk/tm/zig/feature/secrets.zig +7 -0
- package/project/.sdk/tm/zig/feature/telemetry.zig +4 -2
- package/project/.sdk/tm/zig/test/feature_test.zig +2 -2
- package/project/sdkgen-package.json +1 -1
- package/src/action/copies.ts +219 -0
- package/src/action/doctor.ts +247 -21
- package/src/action/edition.ts +10 -2
- package/src/action/feature.ts +11 -2
- package/src/action/package.ts +31 -10
- package/src/action/remove.ts +4 -0
- package/src/action/resolve.ts +16 -3
- package/src/action/target.ts +10 -2
- package/src/helpers/naming.ts +1 -1
- package/src/sdkgen.ts +45 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package JAVAPACKAGE.utility;
|
|
2
2
|
|
|
3
3
|
import java.util.ArrayList;
|
|
4
|
+
import java.util.Arrays;
|
|
4
5
|
import java.util.LinkedHashMap;
|
|
5
6
|
import java.util.List;
|
|
6
7
|
import java.util.Map;
|
|
@@ -60,6 +61,38 @@ final class MakeOptions {
|
|
|
60
61
|
opts.remove("auth");
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
Map<String, Object> config = ctx.config;
|
|
65
|
+
if (config == null) {
|
|
66
|
+
config = new LinkedHashMap<>();
|
|
67
|
+
}
|
|
68
|
+
Map<String, Object> cfgopts = Helpers.toMapAny(config.get("options"));
|
|
69
|
+
if (cfgopts == null) {
|
|
70
|
+
cfgopts = new LinkedHashMap<>();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// The secret registry exists BEFORE validation, fed from the raw input, so
|
|
74
|
+
// the constructor's own rejection of a mistyped credential is clean too.
|
|
75
|
+
// Both clean blocks are cloned for the reason the options merge below is,
|
|
76
|
+
// and an absent one is left out: merge lets a null replace everything.
|
|
77
|
+
List<Map<String, Object>> cleanblocks = Arrays.asList(
|
|
78
|
+
Helpers.toMapAny(cfgopts.get("clean")), Helpers.toMapAny(options.get("clean")));
|
|
79
|
+
List<Object> cleanmerge = new ArrayList<>();
|
|
80
|
+
cleanmerge.add(new LinkedHashMap<String, Object>());
|
|
81
|
+
cleanmerge.add(Struct.clone(Schema.optspec().get("clean")));
|
|
82
|
+
for (Map<String, Object> block : cleanblocks) {
|
|
83
|
+
if (block != null) {
|
|
84
|
+
cleanmerge.add(Struct.clone(block));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
final Map<String, Object> cleancfg =
|
|
88
|
+
Clean.makeCleanConfig(Helpers.toMapAny(Struct.merge(cleanmerge)));
|
|
89
|
+
Clean.addSensitiveOptions(cleancfg, without(options, "clean"));
|
|
90
|
+
for (Map<String, Object> block : cleanblocks) {
|
|
91
|
+
for (String raw : Clean.splitvalues(block == null ? null : block.get("values"))) {
|
|
92
|
+
Clean.add(cleancfg, raw);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
63
96
|
// Feature add-order. options.feature may be given as an ordered LIST of
|
|
64
97
|
// { name, active, ...opts } entries (the list position IS the order in
|
|
65
98
|
// which features are added), or as a { name: {opts} } map. Normalize a
|
|
@@ -85,15 +118,6 @@ final class MakeOptions {
|
|
|
85
118
|
opts.put("feature", fmap);
|
|
86
119
|
}
|
|
87
120
|
|
|
88
|
-
Map<String, Object> config = ctx.config;
|
|
89
|
-
if (config == null) {
|
|
90
|
-
config = new LinkedHashMap<>();
|
|
91
|
-
}
|
|
92
|
-
Map<String, Object> cfgopts = Helpers.toMapAny(config.get("options"));
|
|
93
|
-
if (cfgopts == null) {
|
|
94
|
-
cfgopts = new LinkedHashMap<>();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
121
|
// THE OPTION SPEC IS GENERATED, NOT WRITTEN HERE.
|
|
98
122
|
//
|
|
99
123
|
// Built from the model: `main.kit.optspec` for the standard options,
|
|
@@ -125,7 +149,16 @@ final class MakeOptions {
|
|
|
125
149
|
|
|
126
150
|
Map<String, Object> vopts = new LinkedHashMap<>();
|
|
127
151
|
vopts.put("errs", new ArrayList<>());
|
|
128
|
-
Object validated
|
|
152
|
+
Object validated;
|
|
153
|
+
try {
|
|
154
|
+
validated = Struct.validate(merged, optspec, vopts);
|
|
155
|
+
}
|
|
156
|
+
catch (IllegalArgumentException err) {
|
|
157
|
+
// The message quotes the offending value; a rewrite is the only way to
|
|
158
|
+
// clean a JDK exception, so the type is kept and the text replaced.
|
|
159
|
+
throw new IllegalArgumentException(
|
|
160
|
+
(String) Clean.cleanWith(cleancfg, String.valueOf(err.getMessage())), err.getCause());
|
|
161
|
+
}
|
|
129
162
|
opts = (Map<String, Object>) validated;
|
|
130
163
|
|
|
131
164
|
// Restore the suppression the optspec default would otherwise erase.
|
|
@@ -198,22 +231,6 @@ final class MakeOptions {
|
|
|
198
231
|
opts.put("base", resolved.toString());
|
|
199
232
|
}
|
|
200
233
|
|
|
201
|
-
// Derived clean config.
|
|
202
|
-
String cleanKeys = "key,token,id";
|
|
203
|
-
Object ck = Struct.getpath(opts, List.of("clean", "keys"));
|
|
204
|
-
if (ck instanceof String) {
|
|
205
|
-
cleanKeys = (String) ck;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
List<String> filtered = new ArrayList<>();
|
|
209
|
-
for (String p : cleanKeys.split(",")) {
|
|
210
|
-
p = p.trim();
|
|
211
|
-
if (!"".equals(p)) {
|
|
212
|
-
filtered.add(Struct.escre(p));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
String keyre = String.join("|", filtered);
|
|
216
|
-
|
|
217
234
|
// Resolve the feature add-order: an explicit list order (above) wins;
|
|
218
235
|
// otherwise order the map test-first, then the remaining names sorted, so
|
|
219
236
|
// the outcome is deterministic and `test` is always the base transport.
|
|
@@ -249,14 +266,21 @@ final class MakeOptions {
|
|
|
249
266
|
}
|
|
250
267
|
|
|
251
268
|
Map<String, Object> derived = new LinkedHashMap<>();
|
|
252
|
-
|
|
253
|
-
if (!"".equals(keyre)) {
|
|
254
|
-
derivedClean.put("keyre", keyre);
|
|
255
|
-
}
|
|
256
|
-
derived.put("clean", derivedClean);
|
|
269
|
+
derived.put("clean", cleancfg);
|
|
257
270
|
derived.put("featureorder", featureorder);
|
|
258
271
|
opts.put("__derived__", derived);
|
|
259
272
|
|
|
273
|
+
// Again over the merged result: the config's own defaults can carry one.
|
|
274
|
+
Clean.addSensitiveOptions(cleancfg, without(opts, "clean", "__derived__"));
|
|
275
|
+
|
|
260
276
|
return opts;
|
|
261
277
|
}
|
|
278
|
+
|
|
279
|
+
private static Map<String, Object> without(Map<String, Object> map, String... keys) {
|
|
280
|
+
Map<String, Object> out = new LinkedHashMap<>(map);
|
|
281
|
+
for (String key : keys) {
|
|
282
|
+
out.remove(key);
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
262
286
|
}
|
|
@@ -9,6 +9,7 @@ public final class Register {
|
|
|
9
9
|
|
|
10
10
|
public static void registerAll(Utility u) {
|
|
11
11
|
u.clean = Clean::clean;
|
|
12
|
+
u.cleanAdd = Clean::cleanAdd;
|
|
12
13
|
u.done = Done::done;
|
|
13
14
|
u.makeError = MakeError::makeError;
|
|
14
15
|
u.featureAdd = FeatureAdd::featureAdd;
|
|
@@ -74,6 +75,9 @@ public final class Register {
|
|
|
74
75
|
case "clean":
|
|
75
76
|
if (val instanceof Utility.CleanFn) { u.clean = (Utility.CleanFn) val; return true; }
|
|
76
77
|
return false;
|
|
78
|
+
case "cleanAdd":
|
|
79
|
+
if (val instanceof Utility.CleanAddFn) { u.cleanAdd = (Utility.CleanAddFn) val; return true; }
|
|
80
|
+
return false;
|
|
77
81
|
case "makeError":
|
|
78
82
|
if (val instanceof Utility.MakeErrorFn) { u.makeError = (Utility.MakeErrorFn) val; return true; }
|
|
79
83
|
return false;
|
|
@@ -119,8 +119,10 @@ class Context {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
|
|
122
|
+
// The serialised context leaves the pipeline (a logger, an error dump), so
|
|
123
|
+
// it is cleaned; the live fields stay raw for the pipeline's own use.
|
|
122
124
|
toJSON() {
|
|
123
|
-
|
|
125
|
+
const record = {
|
|
124
126
|
id: this.id,
|
|
125
127
|
op: this.op,
|
|
126
128
|
spec: this.spec,
|
|
@@ -129,6 +131,8 @@ class Context {
|
|
|
129
131
|
response: this.response,
|
|
130
132
|
meta: this.meta,
|
|
131
133
|
}
|
|
134
|
+
const clean = this.utility?.clean
|
|
135
|
+
return 'function' === typeof clean ? clean(this, record) : record
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
toString() {
|
|
@@ -55,7 +55,7 @@ class AuditFeature extends BaseFeature {
|
|
|
55
55
|
}
|
|
56
56
|
this._seen.add(ctx)
|
|
57
57
|
this._seq++
|
|
58
|
-
const record = {
|
|
58
|
+
const record = ctx.utility.clean(ctx, {
|
|
59
59
|
seq: this._seq,
|
|
60
60
|
ts: this._now(),
|
|
61
61
|
actor: (ctx.ctrl && ctx.ctrl.actor) || this._options.actor || 'anonymous',
|
|
@@ -64,7 +64,7 @@ class AuditFeature extends BaseFeature {
|
|
|
64
64
|
outcome,
|
|
65
65
|
status: ctx.result && ctx.result.status,
|
|
66
66
|
correlationId: ctx.id,
|
|
67
|
-
}
|
|
67
|
+
})
|
|
68
68
|
|
|
69
69
|
const client = this._client
|
|
70
70
|
const recs = client._audit.records
|
|
@@ -258,7 +258,7 @@ class CostFeature extends BaseFeature {
|
|
|
258
258
|
this._bump(cost.actors, actor, amount)
|
|
259
259
|
|
|
260
260
|
this._seq++
|
|
261
|
-
const record = {
|
|
261
|
+
const record = ctx.utility.clean(ctx, {
|
|
262
262
|
seq: this._seq,
|
|
263
263
|
entity,
|
|
264
264
|
op: opname,
|
|
@@ -267,7 +267,7 @@ class CostFeature extends BaseFeature {
|
|
|
267
267
|
currency: cost.currency,
|
|
268
268
|
source,
|
|
269
269
|
attempts: pending.attempts,
|
|
270
|
-
}
|
|
270
|
+
})
|
|
271
271
|
cost.last = record
|
|
272
272
|
|
|
273
273
|
const sink = this._options.sink
|
|
@@ -38,7 +38,7 @@ class DebugFeature extends BaseFeature {
|
|
|
38
38
|
op: ((ctx.op && ctx.op.entity) || '_') + '.' + ((ctx.op && ctx.op.name) || '_'),
|
|
39
39
|
method: spec.method,
|
|
40
40
|
url: spec.url || spec.path,
|
|
41
|
-
headers: this._redact(spec.headers),
|
|
41
|
+
headers: this._redact(ctx, spec.headers),
|
|
42
42
|
start: this._now(),
|
|
43
43
|
status: undefined,
|
|
44
44
|
ok: undefined,
|
|
@@ -77,7 +77,7 @@ class DebugFeature extends BaseFeature {
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
_finish(ctx, ok) {
|
|
80
|
-
|
|
80
|
+
let entry = this._entries.get(ctx)
|
|
81
81
|
if (null == entry) {
|
|
82
82
|
return
|
|
83
83
|
}
|
|
@@ -88,6 +88,11 @@ class DebugFeature extends BaseFeature {
|
|
|
88
88
|
entry.status = ctx.result.status
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// The whole entry leaves through the buffer and the callback: the url
|
|
92
|
+
// and the error message can carry a query credential the header mask
|
|
93
|
+
// above never saw.
|
|
94
|
+
entry = ctx.utility.clean(ctx, entry)
|
|
95
|
+
|
|
91
96
|
const client = this._client
|
|
92
97
|
const buf = client._debug.entries
|
|
93
98
|
buf.push(entry)
|
|
@@ -103,17 +108,18 @@ class DebugFeature extends BaseFeature {
|
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
|
|
106
|
-
|
|
111
|
+
// The core clean rules apply (clean.keys, every registered value); the
|
|
112
|
+
// feature's own `redact` list ADDS header names on top of them.
|
|
113
|
+
_redact(ctx, headers) {
|
|
107
114
|
if (null == headers) {
|
|
108
115
|
return {}
|
|
109
116
|
}
|
|
110
|
-
const patterns = this._options.redact ||
|
|
111
|
-
['authorization', 'cookie', 'set-cookie', 'api-key', 'apikey', 'x-api-key', 'idempotency-key']
|
|
117
|
+
const patterns = (this._options.redact || []).map((n) => String(n).toLowerCase())
|
|
112
118
|
const out = {}
|
|
113
119
|
for (const k of Object.keys(headers)) {
|
|
114
|
-
out[k] = patterns.indexOf(k.toLowerCase()) >= 0 ? '
|
|
120
|
+
out[k] = patterns.indexOf(k.toLowerCase()) >= 0 ? '[redacted]' : headers[k]
|
|
115
121
|
}
|
|
116
|
-
return out
|
|
122
|
+
return ctx.utility.clean(ctx, out)
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
|
|
@@ -35,9 +35,9 @@ class LogFeature extends BaseFeature {
|
|
|
35
35
|
let level = this._options.level || 'info'
|
|
36
36
|
|
|
37
37
|
logger = Pino({ name: 'log', level }, pretty)
|
|
38
|
-
|
|
39
|
-
this._logger = logger
|
|
40
38
|
}
|
|
39
|
+
|
|
40
|
+
this._logger = logger
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -83,15 +83,19 @@ class LogFeature extends BaseFeature {
|
|
|
83
83
|
this._loghook('PreResult', ctx)
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
// A log line leaves the pipeline, so it carries the cleaned record: the
|
|
87
|
+
// spec after auth holds the credential, and a logger serialises whatever
|
|
88
|
+
// it is handed.
|
|
86
89
|
_loghook(hook, ctx, level) {
|
|
87
90
|
level = level || 'info'
|
|
88
91
|
if (this._logger) {
|
|
89
|
-
|
|
92
|
+
const clean = ctx.utility.clean
|
|
93
|
+
this._logger[level](clean(ctx, {
|
|
90
94
|
hook,
|
|
91
95
|
op: ctx.op,
|
|
92
96
|
spec: ctx.spec,
|
|
93
|
-
ctx
|
|
94
|
-
})
|
|
97
|
+
ctx: 'function' === typeof ctx.toJSON ? ctx.toJSON() : ctx,
|
|
98
|
+
}))
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
}
|
|
@@ -20,6 +20,7 @@ class ProxyFeature extends BaseFeature {
|
|
|
20
20
|
_options = {}
|
|
21
21
|
_url
|
|
22
22
|
_noProxy = []
|
|
23
|
+
_ctx
|
|
23
24
|
|
|
24
25
|
|
|
25
26
|
init(ctx, options) {
|
|
@@ -43,6 +44,22 @@ class ProxyFeature extends BaseFeature {
|
|
|
43
44
|
this._noProxy = ('string' === typeof noProxy ? noProxy.split(/\s*,\s*/) : (noProxy || []))
|
|
44
45
|
.filter((s) => null != s && '' !== s)
|
|
45
46
|
|
|
47
|
+
// A proxy URL may carry credentials as userinfo, from the option or the
|
|
48
|
+
// environment, and neither is under a sensitive key name.
|
|
49
|
+
this._ctx = ctx
|
|
50
|
+
if ('string' === typeof this._url) {
|
|
51
|
+
try {
|
|
52
|
+
const parsed = new URL(this._url)
|
|
53
|
+
for (const part of [parsed.username, parsed.password]) {
|
|
54
|
+
if ('' !== part) {
|
|
55
|
+
ctx.utility.cleanAdd(ctx, part)
|
|
56
|
+
try { ctx.utility.cleanAdd(ctx, decodeURIComponent(part)) } catch (_e) { }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (_e) { }
|
|
61
|
+
}
|
|
62
|
+
|
|
46
63
|
const self = this
|
|
47
64
|
const utility = ctx.utility
|
|
48
65
|
const inner = utility.fetcher
|
|
@@ -98,7 +115,8 @@ class ProxyFeature extends BaseFeature {
|
|
|
98
115
|
_track(url) {
|
|
99
116
|
const client = this._client
|
|
100
117
|
if (null == client._proxy) {
|
|
101
|
-
|
|
118
|
+
const ctx = this._ctx
|
|
119
|
+
client._proxy = { routed: 0, url: null == ctx ? this._url : ctx.utility.clean(ctx, this._url) }
|
|
102
120
|
}
|
|
103
121
|
client._proxy.routed++
|
|
104
122
|
}
|
|
@@ -111,6 +111,7 @@ class SecretsFeature extends BaseFeature {
|
|
|
111
111
|
(null == xopts ? undefined : xopts.refresh)
|
|
112
112
|
|
|
113
113
|
if ('string' === typeof explicit && '' !== explicit) {
|
|
114
|
+
this._register(explicit)
|
|
114
115
|
providers.push({
|
|
115
116
|
kind: 'memory',
|
|
116
117
|
name: 'options',
|
|
@@ -163,6 +164,16 @@ class SecretsFeature extends BaseFeature {
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
|
|
167
|
+
// Every value this feature resolves or buys is a secret the SDK handles,
|
|
168
|
+
// and none arrives under an option key the intake registration saw.
|
|
169
|
+
_register(value) {
|
|
170
|
+
const ctx = this._client._rootctx
|
|
171
|
+
if (null != ctx && null != ctx.utility && 'function' === typeof ctx.utility.cleanAdd) {
|
|
172
|
+
ctx.utility.cleanAdd(ctx, value)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
|
|
166
177
|
PreSpec(_ctx) {
|
|
167
178
|
return this.resolve()
|
|
168
179
|
}
|
|
@@ -217,6 +228,7 @@ class SecretsFeature extends BaseFeature {
|
|
|
217
228
|
}
|
|
218
229
|
|
|
219
230
|
const found = await this._sekreto.try(this._secretname)
|
|
231
|
+
this._register(found)
|
|
220
232
|
|
|
221
233
|
if (null == this._exchange) {
|
|
222
234
|
if (undefined !== found) {
|
|
@@ -346,6 +358,8 @@ class SecretsFeature extends BaseFeature {
|
|
|
346
358
|
"secrets: token exchange returned no '" + x.response + "' field from " + url)
|
|
347
359
|
}
|
|
348
360
|
|
|
361
|
+
this._register(token)
|
|
362
|
+
|
|
349
363
|
return token
|
|
350
364
|
}
|
|
351
365
|
|
|
@@ -90,13 +90,15 @@ class TelemetryFeature extends BaseFeature {
|
|
|
90
90
|
span.durationMs = Math.max(0, span.end - span.start)
|
|
91
91
|
span.ok = ok
|
|
92
92
|
|
|
93
|
+
const out = ctx.utility.clean(ctx, span)
|
|
94
|
+
|
|
93
95
|
const client = this._client
|
|
94
96
|
client._telemetry.active--
|
|
95
|
-
client._telemetry.spans.push(
|
|
97
|
+
client._telemetry.spans.push(out)
|
|
96
98
|
|
|
97
99
|
const exporter = this._options.exporter
|
|
98
100
|
if ('function' === typeof exporter) {
|
|
99
|
-
try { exporter(
|
|
101
|
+
try { exporter(out) } catch (_e) { }
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|