@voxgig/sdkgen 4.32.0 → 4.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/helpers/naming.js +1 -1
- package/dist/helpers/naming.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/Response.js +14 -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/js/test/utility/PrimaryUtility.test.js +25 -0
- 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/Response.ts +14 -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/ts/test/utility/PrimaryUtility.test.ts +25 -0
- 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/helpers/naming.ts +1 -1
|
@@ -130,6 +130,7 @@ and utility = {
|
|
|
130
130
|
mutable u_struct : struct_api;
|
|
131
131
|
mutable u_fetcher : ctx -> string -> value -> (value * sdk_error option);
|
|
132
132
|
mutable u_clean : ctx -> value -> value;
|
|
133
|
+
mutable u_clean_add : ctx -> string -> unit;
|
|
133
134
|
mutable u_done : ctx -> value;
|
|
134
135
|
mutable u_make_error : ctx -> sdk_error option -> value;
|
|
135
136
|
mutable u_feature_add : ctx -> feature -> unit;
|
|
@@ -752,8 +752,10 @@ let () =
|
|
|
752
752
|
(* A non-live client: the credential becomes the deterministic
|
|
753
753
|
* `test-<response>` and no purchase is attempted. Observed through
|
|
754
754
|
* ctrl.explain, which records the live fetchdef whose headers map
|
|
755
|
-
* the wrapper rewrites in place.
|
|
755
|
+
* the wrapper rewrites in place. The explain record is cleaned, so
|
|
756
|
+
* clean is off for the header to read raw. *)
|
|
756
757
|
let client = Sdk_client.test_with Noval (jo [
|
|
758
|
+
("clean", jo [("active", Bool false)]);
|
|
757
759
|
("feature", jo [("secrets", jo [("active", Bool true); refresh_chain "R1";
|
|
758
760
|
("name", Str "refresh_token"); xchg []])])]) in
|
|
759
761
|
let explain = empty_map () in
|
|
@@ -339,7 +339,7 @@ let () =
|
|
|
339
339
|
ignore (op h ~op:"list" ());
|
|
340
340
|
check_int "entries" (size (getp (track h "debug") "entries")) 1;
|
|
341
341
|
check_int "seen" (List.length !seen) 2;
|
|
342
|
-
check_vstr "redacted" (getp (getp (List.nth !seen 0) "headers") "authorization") "
|
|
342
|
+
check_vstr "redacted" (getp (getp (List.nth !seen 0) "headers") "authorization") "[redacted]");
|
|
343
343
|
test "debug.captures_failures" (fun () ->
|
|
344
344
|
let h = make_client [("netsim", jo [("failTimes", Num 1.); ("failStatus", Num 500.)]); ("debug", empty_map ())] in
|
|
345
345
|
ignore (op h ~op:"load" ());
|
|
@@ -350,7 +350,7 @@ let () =
|
|
|
350
350
|
let h = make_client [("debug", jo [("now", vfunc0 (fun () -> Num 7.)); ("redact", ja [Str "x-secret"])])] in
|
|
351
351
|
ignore (op h ~op:"load" ~headers:[("x-secret", Str "hide"); ("x-ok", Str "show")] ());
|
|
352
352
|
let e0 = getelem (getp (track h "debug") "entries") (Num 0.) in
|
|
353
|
-
check_vstr "secret" (getp (getp e0 "headers") "x-secret") "
|
|
353
|
+
check_vstr "secret" (getp (getp e0 "headers") "x-secret") "[redacted]";
|
|
354
354
|
check_vstr "ok hdr" (getp (getp e0 "headers") "x-ok") "show";
|
|
355
355
|
check_vnum "duration" (getp e0 "durationMs") 0.);
|
|
356
356
|
test "debug.inactive" (fun () ->
|
|
@@ -136,4 +136,31 @@ sub make_error {
|
|
|
136
136
|
return ProjectNameError->new($code, $msg, $self);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
# The serialised context leaves the pipeline (a logger, an error dump), so
|
|
140
|
+
# it is cleaned; the live fields stay raw for the pipeline's own use. The
|
|
141
|
+
# entity goes in as its own record: it holds the client, and the struct's
|
|
142
|
+
# serialisers walk a blessed hash whole.
|
|
143
|
+
sub TO_JSON {
|
|
144
|
+
my ($self) = @_;
|
|
145
|
+
my $entity = $self->{entity};
|
|
146
|
+
$entity = $entity->TO_JSON
|
|
147
|
+
if Scalar::Util::blessed($entity) && $entity->can('TO_JSON');
|
|
148
|
+
my $record = {
|
|
149
|
+
'id' => $self->{id},
|
|
150
|
+
'op' => $self->{op},
|
|
151
|
+
'spec' => $self->{spec},
|
|
152
|
+
'entity' => $entity,
|
|
153
|
+
'result' => $self->{result},
|
|
154
|
+
'response' => $self->{response},
|
|
155
|
+
'meta' => $self->{meta},
|
|
156
|
+
};
|
|
157
|
+
my $clean = $self->{utility} ? $self->{utility}{clean} : undef;
|
|
158
|
+
return ref $clean eq 'CODE' ? $clean->($self, $record) : $record;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
sub to_string {
|
|
162
|
+
my ($self) = @_;
|
|
163
|
+
return 'Context ' . Voxgig::Struct::jsonify($self->TO_JSON);
|
|
164
|
+
}
|
|
165
|
+
|
|
139
166
|
1;
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
use strict;
|
|
4
4
|
use warnings;
|
|
5
5
|
|
|
6
|
+
use Scalar::Util ();
|
|
7
|
+
|
|
6
8
|
package ProjectNameError;
|
|
7
9
|
|
|
8
10
|
use overload
|
|
@@ -10,21 +12,66 @@ use overload
|
|
|
10
12
|
'bool' => sub { 1 },
|
|
11
13
|
fallback => 1;
|
|
12
14
|
|
|
15
|
+
# The context stays reachable for a debugger (`$err->ctx`) and is part of
|
|
16
|
+
# no dump: a blessed hash hides nothing from Data::Dumper or the struct's
|
|
17
|
+
# own serialiser, so it lives in an inside-out slot beside the object,
|
|
18
|
+
# weakened so an error never keeps a finished operation alive.
|
|
19
|
+
my %CTX;
|
|
20
|
+
|
|
13
21
|
sub new {
|
|
14
22
|
my ($class, $code, $msg, $ctx) = @_;
|
|
15
|
-
|
|
23
|
+
my $self = bless {
|
|
16
24
|
is_sdk_error => 1,
|
|
17
25
|
sdk => 'ProjectName',
|
|
18
26
|
code => (defined $code ? $code : ''),
|
|
19
27
|
msg => (defined $msg ? $msg : ''),
|
|
20
|
-
ctx => $ctx,
|
|
21
28
|
result => undef,
|
|
22
29
|
spec => undef,
|
|
30
|
+
# make_error promotes the HTTP status here (-1 when there was no
|
|
31
|
+
# response), so a consumer never reaches into `result` for it.
|
|
32
|
+
status => -1,
|
|
23
33
|
}, $class;
|
|
34
|
+
$self->ctx($ctx) if defined $ctx;
|
|
35
|
+
return $self;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
sub ctx {
|
|
39
|
+
my $self = shift;
|
|
40
|
+
my $addr = Scalar::Util::refaddr($self);
|
|
41
|
+
if (@_) {
|
|
42
|
+
$CTX{$addr} = $_[0];
|
|
43
|
+
Scalar::Util::weaken($CTX{$addr}) if ref $_[0];
|
|
44
|
+
}
|
|
45
|
+
return $CTX{$addr};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
sub DESTROY {
|
|
49
|
+
delete $CTX{ Scalar::Util::refaddr($_[0]) };
|
|
50
|
+
return;
|
|
24
51
|
}
|
|
25
52
|
|
|
26
|
-
sub code
|
|
27
|
-
sub msg
|
|
28
|
-
sub error
|
|
53
|
+
sub code { $_[0]->{code} }
|
|
54
|
+
sub msg { $_[0]->{msg} }
|
|
55
|
+
sub error { $_[0]->{msg} }
|
|
56
|
+
sub status { $_[0]->{status} }
|
|
57
|
+
|
|
58
|
+
# What make_error attached is already cleaned; the context is not part of
|
|
59
|
+
# the record.
|
|
60
|
+
sub to_h {
|
|
61
|
+
my ($self) = @_;
|
|
62
|
+
return {
|
|
63
|
+
'sdk' => $self->{sdk},
|
|
64
|
+
'code' => $self->{code},
|
|
65
|
+
'message' => $self->{msg},
|
|
66
|
+
'status' => $self->{status},
|
|
67
|
+
'result' => $self->{result},
|
|
68
|
+
'spec' => $self->{spec},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
sub TO_JSON {
|
|
73
|
+
my ($self) = @_;
|
|
74
|
+
return $self->to_h;
|
|
75
|
+
}
|
|
29
76
|
|
|
30
77
|
1;
|
|
@@ -82,7 +82,7 @@ sub _emit {
|
|
|
82
82
|
$self->{seen}{$addr} = 1;
|
|
83
83
|
$self->{seq} += 1;
|
|
84
84
|
|
|
85
|
-
my $record = {
|
|
85
|
+
my $record = $ctx->{utility}{clean}->($ctx, {
|
|
86
86
|
'seq' => $self->{seq},
|
|
87
87
|
'ts' => $self->_now,
|
|
88
88
|
'actor' => $self->_actor($ctx),
|
|
@@ -91,7 +91,7 @@ sub _emit {
|
|
|
91
91
|
'outcome' => $outcome,
|
|
92
92
|
'status' => ($ctx->{result} ? $ctx->{result}{status} : undef),
|
|
93
93
|
'correlationId' => $ctx->{id},
|
|
94
|
-
};
|
|
94
|
+
});
|
|
95
95
|
|
|
96
96
|
my $track = $self->{client}{_audit};
|
|
97
97
|
if (!$track) {
|
|
@@ -283,7 +283,7 @@ sub _commit {
|
|
|
283
283
|
$self->_bump($cost->{actors}, $actor, $amount);
|
|
284
284
|
|
|
285
285
|
$self->{seq} += 1;
|
|
286
|
-
my $record = {
|
|
286
|
+
my $record = $ctx->{utility}{clean}->($ctx, {
|
|
287
287
|
'seq' => $self->{seq},
|
|
288
288
|
'entity' => $entity,
|
|
289
289
|
'op' => $opname,
|
|
@@ -292,7 +292,7 @@ sub _commit {
|
|
|
292
292
|
'currency' => $cost->{currency},
|
|
293
293
|
'source' => $source,
|
|
294
294
|
'attempts' => $entry->{attempts},
|
|
295
|
-
};
|
|
295
|
+
});
|
|
296
296
|
$cost->{last} = $record;
|
|
297
297
|
|
|
298
298
|
my $sink = $self->{options}{sink};
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
#
|
|
3
3
|
# Request/response capture for debugging. Records a bounded ring buffer of
|
|
4
4
|
# per-operation traces - method, URL, redacted headers, response status and
|
|
5
|
-
# timing.
|
|
6
|
-
#
|
|
5
|
+
# timing. The SDK's own clean rules (clean.keys and every registered secret
|
|
6
|
+
# value) apply to the whole entry, and the "redact" option ADDS header names
|
|
7
|
+
# on top of them. An optional
|
|
7
8
|
# "on_entry" callback receives each finished entry (e.g. to stream to a
|
|
8
9
|
# console). "max" caps the buffer (default 100). The clock is injectable
|
|
9
10
|
# ("now", ms) for deterministic tests.
|
|
@@ -25,11 +26,6 @@ package ProjectNameDebugFeature;
|
|
|
25
26
|
|
|
26
27
|
our @ISA = ('ProjectNameBaseFeature');
|
|
27
28
|
|
|
28
|
-
my @REDACT_DEFAULT = (
|
|
29
|
-
'authorization', 'cookie', 'set-cookie', 'api-key', 'apikey',
|
|
30
|
-
'x-api-key', 'idempotency-key',
|
|
31
|
-
);
|
|
32
|
-
|
|
33
29
|
sub new {
|
|
34
30
|
my ($class) = @_;
|
|
35
31
|
my $self = ProjectNameBaseFeature::new($class);
|
|
@@ -73,7 +69,7 @@ sub PreRequest {
|
|
|
73
69
|
. ($ctx->{op} ? $ctx->{op}{name} : '_'),
|
|
74
70
|
'method' => $method,
|
|
75
71
|
'url' => $url,
|
|
76
|
-
'headers' => $self->_redact($headers),
|
|
72
|
+
'headers' => $self->_redact($ctx, $headers),
|
|
77
73
|
'start' => $self->_now,
|
|
78
74
|
'status' => undef,
|
|
79
75
|
'ok' => undef,
|
|
@@ -129,6 +125,11 @@ sub _finish {
|
|
|
129
125
|
$entry->{status} = $ctx->{result}{status};
|
|
130
126
|
}
|
|
131
127
|
|
|
128
|
+
# The whole entry leaves through the buffer and the callback: the url
|
|
129
|
+
# and the error message can carry a query credential the header mask
|
|
130
|
+
# above never saw.
|
|
131
|
+
$entry = $ctx->{utility}{clean}->($ctx, $entry);
|
|
132
|
+
|
|
132
133
|
my $track = $self->{client}{_debug};
|
|
133
134
|
if (!$track) {
|
|
134
135
|
$track = { 'entries' => [] };
|
|
@@ -146,16 +147,19 @@ sub _finish {
|
|
|
146
147
|
return;
|
|
147
148
|
}
|
|
148
149
|
|
|
150
|
+
# The core clean rules apply (clean.keys, every registered value); the
|
|
151
|
+
# feature's own `redact` list ADDS header names on top of them.
|
|
149
152
|
sub _redact {
|
|
150
|
-
my ($self, $headers) = @_;
|
|
153
|
+
my ($self, $ctx, $headers) = @_;
|
|
151
154
|
return {} unless defined $headers;
|
|
152
|
-
my $patterns = $self->{options}{redact}
|
|
155
|
+
my $patterns = Voxgig::Struct::islist($self->{options}{redact})
|
|
156
|
+
? [ map { lc("$_") } @{ $self->{options}{redact} } ] : [];
|
|
153
157
|
my $out = {};
|
|
154
158
|
for my $k (keys %$headers) {
|
|
155
|
-
$out->{$k} = (grep {
|
|
156
|
-
? '
|
|
159
|
+
$out->{$k} = (grep { $_ eq lc("$k") } @$patterns)
|
|
160
|
+
? '[redacted]' : $headers->{$k};
|
|
157
161
|
}
|
|
158
|
-
return $out;
|
|
162
|
+
return $ctx->{utility}{clean}->($ctx, $out);
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
sub _now {
|
|
@@ -45,12 +45,14 @@ sub init {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
# A log line leaves the pipeline, so it is cleaned before the logger sees
|
|
49
|
+
# it, as every emitted record is.
|
|
48
50
|
sub _loghook {
|
|
49
51
|
my ($self, $hook, $ctx, $level) = @_;
|
|
50
52
|
return unless $self->{logger};
|
|
51
53
|
$level = 'info' unless defined $level;
|
|
52
54
|
my $opname = $ctx->{op} ? $ctx->{op}{name} : '';
|
|
53
|
-
my $msg = "hook=$hook op=$opname";
|
|
55
|
+
my $msg = $ctx->{utility}{clean}->($ctx, "hook=$hook op=$opname");
|
|
54
56
|
my $line = '[' . uc($level) . "] $msg";
|
|
55
57
|
my $logger = $self->{logger};
|
|
56
58
|
if (ref $logger eq 'CODE') {
|
|
@@ -36,6 +36,7 @@ sub new {
|
|
|
36
36
|
$self->{options} = {};
|
|
37
37
|
$self->{url} = undef;
|
|
38
38
|
$self->{no_proxy} = [];
|
|
39
|
+
$self->{ctx} = undef;
|
|
39
40
|
return $self;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -66,6 +67,21 @@ sub init {
|
|
|
66
67
|
}
|
|
67
68
|
$self->{no_proxy} = [grep { defined $_ && '' ne $_ } @np];
|
|
68
69
|
|
|
70
|
+
# A proxy URL may carry credentials as userinfo, from the option or the
|
|
71
|
+
# environment, and neither is under a sensitive key name.
|
|
72
|
+
$self->{ctx} = $ctx;
|
|
73
|
+
if (defined $self->{url} && !ref $self->{url}
|
|
74
|
+
&& "$self->{url}" =~ m{\A[A-Za-z][A-Za-z0-9+.-]*://([^/?#@]*)@}) {
|
|
75
|
+
my $userinfo = $1;
|
|
76
|
+
for my $part (split /:/, $userinfo, 2) {
|
|
77
|
+
next unless defined $part && '' ne $part;
|
|
78
|
+
$ctx->{utility}{clean_add}->($ctx, $part);
|
|
79
|
+
my $decoded = $part;
|
|
80
|
+
$decoded =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge;
|
|
81
|
+
$ctx->{utility}{clean_add}->($ctx, $decoded);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
69
85
|
my $feature = $self;
|
|
70
86
|
my $utility = $ctx->{utility};
|
|
71
87
|
my $inner = $utility->{fetcher};
|
|
@@ -118,7 +134,11 @@ sub _track {
|
|
|
118
134
|
my ($self, $url) = @_;
|
|
119
135
|
my $track = $self->{client}{_proxy};
|
|
120
136
|
if (!$track) {
|
|
121
|
-
$
|
|
137
|
+
my $ctx = $self->{ctx};
|
|
138
|
+
$track = {
|
|
139
|
+
'routed' => 0,
|
|
140
|
+
'url' => $ctx ? $ctx->{utility}{clean}->($ctx, $self->{url}) : $self->{url},
|
|
141
|
+
};
|
|
122
142
|
$self->{client}{_proxy} = $track;
|
|
123
143
|
}
|
|
124
144
|
$track->{routed} += 1;
|
|
@@ -117,6 +117,9 @@ sub new {
|
|
|
117
117
|
# chain is fail-closed, never silently unauthenticated.
|
|
118
118
|
$self->{initerr} = undef;
|
|
119
119
|
|
|
120
|
+
# The root context, for registering what this feature resolves.
|
|
121
|
+
$self->{ctx} = undef;
|
|
122
|
+
|
|
120
123
|
return $self;
|
|
121
124
|
}
|
|
122
125
|
|
|
@@ -127,6 +130,7 @@ sub init {
|
|
|
127
130
|
my ($self, $ctx, $options) = @_;
|
|
128
131
|
|
|
129
132
|
$self->{client} = $ctx->{client};
|
|
133
|
+
$self->{ctx} = $ctx;
|
|
130
134
|
$self->{options} = Voxgig::Struct::ismap($options) ? $options : {};
|
|
131
135
|
$self->{active} = ProjectNameHelpers::is_true($self->{options}{active});
|
|
132
136
|
$self->{liveopts} = Voxgig::Struct::ismap($ctx->{options}) ? $ctx->{options} : {};
|
|
@@ -219,6 +223,7 @@ sub _build {
|
|
|
219
223
|
my @providers;
|
|
220
224
|
|
|
221
225
|
if ('' ne $explicit) {
|
|
226
|
+
$self->_register($explicit);
|
|
222
227
|
my $key = eval { Voxgig::Sekreto::envkey($self->{secretname}, '') };
|
|
223
228
|
return _trim("$@") if !defined $key;
|
|
224
229
|
push @providers, {
|
|
@@ -366,6 +371,7 @@ sub _resolve_once {
|
|
|
366
371
|
my $ok = eval { $found = $self->{sek}->try($self->{secretname}); 1 };
|
|
367
372
|
return (_trim(defined $@ && '' ne "$@" ? "$@" : 'secrets: provider failed'), 0)
|
|
368
373
|
if !$ok;
|
|
374
|
+
$self->_register($found);
|
|
369
375
|
|
|
370
376
|
if (!defined $self->{exchange}) {
|
|
371
377
|
# An UNCACHED miss after an earlier hit is a REVOCATION: the chain now
|
|
@@ -529,7 +535,20 @@ sub _buy {
|
|
|
529
535
|
$mode = '' unless defined $mode;
|
|
530
536
|
return ('test-' . $self->{exchange}{response}, undef) if 'live' ne $mode;
|
|
531
537
|
|
|
532
|
-
|
|
538
|
+
my ($token, $err) = $self->_buy_once();
|
|
539
|
+
$self->_register($token);
|
|
540
|
+
return ($token, $err);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
# Every value this feature resolves or buys is a secret the SDK handles,
|
|
545
|
+
# and none arrives under an option key the intake registration saw.
|
|
546
|
+
sub _register {
|
|
547
|
+
my ($self, $value) = @_;
|
|
548
|
+
my $ctx = $self->{ctx};
|
|
549
|
+
return unless $ctx && $ctx->{utility} && ref $ctx->{utility}{clean_add} eq 'CODE';
|
|
550
|
+
$ctx->{utility}{clean_add}->($ctx, $value);
|
|
551
|
+
return;
|
|
533
552
|
}
|
|
534
553
|
|
|
535
554
|
|
|
@@ -115,15 +115,17 @@ sub _close {
|
|
|
115
115
|
$span->{durationMs} = $dur > 0 ? $dur : 0;
|
|
116
116
|
$span->{ok} = $ok ? Voxgig::Struct::JTRUE() : Voxgig::Struct::JFALSE();
|
|
117
117
|
|
|
118
|
+
my $out = $ctx->{utility}{clean}->($ctx, $span);
|
|
119
|
+
|
|
118
120
|
my $t = $self->_telemetry;
|
|
119
121
|
if ($t) {
|
|
120
122
|
$t->{active} -= 1;
|
|
121
|
-
push @{ $t->{spans} }, $
|
|
123
|
+
push @{ $t->{spans} }, $out;
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
my $exporter = $self->{options}{exporter};
|
|
125
127
|
if (ref $exporter eq 'CODE') {
|
|
126
|
-
eval { $exporter->($
|
|
128
|
+
eval { $exporter->($out) };
|
|
127
129
|
}
|
|
128
130
|
return;
|
|
129
131
|
}
|
|
@@ -791,7 +791,9 @@ if (has_feature('debug')) {
|
|
|
791
791
|
my $entries = $h->track('_debug')->{entries};
|
|
792
792
|
is(scalar @$entries, 1, 'debug ring buffer capped at max');
|
|
793
793
|
is(scalar @$seen, 2, 'debug on_entry saw each op');
|
|
794
|
-
|
|
794
|
+
# Masked by the SDK's own clean rule (authorization is a clean.keys
|
|
795
|
+
# name), which the feature's redact list now sits on top of.
|
|
796
|
+
is($seen->[0]{headers}{authorization}, '[redacted]', 'debug redacts authorization');
|
|
795
797
|
}
|
|
796
798
|
|
|
797
799
|
if (has_feature('netsim')) {
|
|
@@ -809,7 +811,7 @@ if (has_feature('debug')) {
|
|
|
809
811
|
my $h = harness([fspec('debug', 'now' => sub { 7 }, 'redact' => ['x-secret'])]);
|
|
810
812
|
$h->op('headers' => { 'x-secret' => 'hide', 'x-ok' => 'show' });
|
|
811
813
|
my $entry = $h->track('_debug')->{entries}[0];
|
|
812
|
-
is($entry->{headers}{'x-secret'}, '
|
|
814
|
+
is($entry->{headers}{'x-secret'}, '[redacted]', 'debug custom redact');
|
|
813
815
|
is($entry->{headers}{'x-ok'}, 'show', 'debug leaves other headers');
|
|
814
816
|
}
|
|
815
817
|
}
|