@voxgig/sdkgen 4.32.1 → 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/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/helpers/naming.ts +1 -1
|
@@ -7,6 +7,7 @@ import { cmp, each, Folder, File, Content, entityCollection } from '@voxgig/sdkg
|
|
|
7
7
|
|
|
8
8
|
import { TestEntity } from './TestEntity_zig'
|
|
9
9
|
import { TestDirect } from './TestDirect_zig'
|
|
10
|
+
import { TestClean } from './TestClean_zig'
|
|
10
11
|
import { ReadmeExamplesTest } from './ReadmeExamplesTest_zig'
|
|
11
12
|
|
|
12
13
|
|
|
@@ -46,6 +47,10 @@ test "sdk_constructs_in_test_mode" {
|
|
|
46
47
|
// Validate the documented zig quick-start examples run.
|
|
47
48
|
ReadmeExamplesTest({ target })
|
|
48
49
|
})
|
|
50
|
+
|
|
51
|
+
// The canary sweep, its own file: build.zig names every test file, and
|
|
52
|
+
// the generator's compile lane runs this one alone as `test-clean`.
|
|
53
|
+
TestClean({ target })
|
|
49
54
|
})
|
|
50
55
|
})
|
|
51
56
|
|
|
@@ -57,6 +57,7 @@ pub fn build(b: *std.Build) void {
|
|
|
57
57
|
const test_files = [_][]const u8{
|
|
58
58
|
"test/struct_corpus.zig",
|
|
59
59
|
"test/generated_test.zig",
|
|
60
|
+
"test/clean_test.zig",
|
|
60
61
|
"test/pipeline_test.zig",
|
|
61
62
|
"test/feature_test.zig",
|
|
62
63
|
"test/primary_utility_test.zig",
|
|
@@ -79,5 +80,23 @@ pub fn build(b: *std.Build) void {
|
|
|
79
80
|
run_t.has_side_effects = true;
|
|
80
81
|
test_step.dependOn(&run_t.step);
|
|
81
82
|
}
|
|
83
|
+
|
|
84
|
+
// The canary sweep alone, as `zig build test-clean`: the generator's
|
|
85
|
+
// compile lane reads the `clean: swept ...` line it prints.
|
|
86
|
+
{
|
|
87
|
+
const clean_mod = b.createModule(.{
|
|
88
|
+
.root_source_file = b.path("test/clean_test.zig"),
|
|
89
|
+
.target = target,
|
|
90
|
+
.optimize = optimize,
|
|
91
|
+
});
|
|
92
|
+
clean_mod.addImport("voxgig-struct", struct_mod);
|
|
93
|
+
clean_mod.addImport("sdk", sdk_mod);
|
|
94
|
+
clean_mod.addImport("omni", omni_mod);
|
|
95
|
+
const clean_test = b.addTest(.{ .root_module = clean_mod });
|
|
96
|
+
const run_clean = b.addRunArtifact(clean_test);
|
|
97
|
+
run_clean.has_side_effects = true;
|
|
98
|
+
const clean_step = b.step("test-clean", "Run the canary sweep alone");
|
|
99
|
+
clean_step.dependOn(&run_clean.step);
|
|
100
|
+
}
|
|
82
101
|
// #FeatureTestSteps
|
|
83
102
|
}
|
|
@@ -147,6 +147,13 @@ pub const EntyClass = struct {
|
|
|
147
147
|
return self.doneResult(ctx);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
// A step's error ends the stream empty without reaching done, so the
|
|
151
|
+
// explain record is cleaned here.
|
|
152
|
+
fn streamFail(utility: *Utility, ctx: *Context) []Value {
|
|
153
|
+
utility.clean_explain(ctx);
|
|
154
|
+
return &.{};
|
|
155
|
+
}
|
|
156
|
+
|
|
150
157
|
/// Streaming operation. Runs `action` through the full pipeline and
|
|
151
158
|
/// returns a slice of the result items, so the `streaming` feature's
|
|
152
159
|
/// incremental output is reachable from a generated entity (a normal op
|
|
@@ -198,23 +205,23 @@ pub const EntyClass = struct {
|
|
|
198
205
|
// Run the same pipeline as run_op, firing the feature hooks (the
|
|
199
206
|
// streaming feature attaches result.stream on PreResult).
|
|
200
207
|
utility.feature_hook(ctx, "PrePoint");
|
|
201
|
-
const point = utility.make_point(ctx) catch return
|
|
208
|
+
const point = utility.make_point(ctx) catch return streamFail(utility, ctx);
|
|
202
209
|
ctx.out_set("point", OutVal{ .val = point });
|
|
203
210
|
|
|
204
211
|
utility.feature_hook(ctx, "PreSpec");
|
|
205
|
-
const spec = utility.make_spec(ctx) catch return
|
|
212
|
+
const spec = utility.make_spec(ctx) catch return streamFail(utility, ctx);
|
|
206
213
|
ctx.out_set("spec", OutVal{ .spec = spec });
|
|
207
214
|
|
|
208
215
|
utility.feature_hook(ctx, "PreRequest");
|
|
209
|
-
const resp = utility.make_request(ctx) catch return
|
|
216
|
+
const resp = utility.make_request(ctx) catch return streamFail(utility, ctx);
|
|
210
217
|
ctx.out_set("request", OutVal{ .response = resp });
|
|
211
218
|
|
|
212
219
|
utility.feature_hook(ctx, "PreResponse");
|
|
213
|
-
const resp2 = utility.make_response(ctx) catch return
|
|
220
|
+
const resp2 = utility.make_response(ctx) catch return streamFail(utility, ctx);
|
|
214
221
|
ctx.out_set("response", OutVal{ .response = resp2 });
|
|
215
222
|
|
|
216
223
|
utility.feature_hook(ctx, "PreResult");
|
|
217
|
-
const result = utility.make_result(ctx) catch return
|
|
224
|
+
const result = utility.make_result(ctx) catch return streamFail(utility, ctx);
|
|
218
225
|
ctx.out_set("result", OutVal{ .result = result });
|
|
219
226
|
|
|
220
227
|
utility.feature_hook(ctx, "PreDone");
|
|
@@ -223,6 +230,8 @@ pub const EntyClass = struct {
|
|
|
223
230
|
// fall back to the materialised items so stream always yields.
|
|
224
231
|
if (ctx.result) |res| {
|
|
225
232
|
if (res.stream) |sf| {
|
|
233
|
+
// done() does not run on this path, so its record is cleaned here.
|
|
234
|
+
utility.clean_explain(ctx);
|
|
226
235
|
return sf.call(sf.ctx);
|
|
227
236
|
}
|
|
228
237
|
}
|
|
@@ -265,7 +265,7 @@ pub const ProjectNameSDK = struct {
|
|
|
265
265
|
const fetched = self.sdkUtility.fetch(ctx, url, fetchdef) catch {
|
|
266
266
|
return h.jo(&.{
|
|
267
267
|
.{ "ok", h.vbool(false) },
|
|
268
|
-
.{ "err", h.vstr(if (ctx.pending_err) |e| e.msg else "fetch failed") },
|
|
268
|
+
.{ "err", h.vstr(if (ctx.pending_err) |e| self.sdkUtility.clean_str(ctx, e.msg) else "fetch failed") },
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
271
|
|
|
@@ -22,6 +22,31 @@ PNError* context_make_error(Context* ctx, const char* code, const char* msg) {
|
|
|
22
22
|
|
|
23
23
|
Utility* context_util(Context* ctx) { return ctx->utility; }
|
|
24
24
|
|
|
25
|
+
voxgig_value* context_to_value(Context* ctx) {
|
|
26
|
+
if (!ctx) return voxgig_new_undef();
|
|
27
|
+
voxgig_value* response = voxgig_new_undef();
|
|
28
|
+
if (ctx->response) {
|
|
29
|
+
response = cmap(3,
|
|
30
|
+
"status", v_num((double)ctx->response->status),
|
|
31
|
+
"statusText", v_str(ctx->response->status_text),
|
|
32
|
+
"headers", ctx->response->headers ? v_share(ctx->response->headers) : voxgig_new_undef());
|
|
33
|
+
}
|
|
34
|
+
voxgig_value* record = cmap(6,
|
|
35
|
+
"id", v_str(ctx->id),
|
|
36
|
+
"op", cmap(2,
|
|
37
|
+
"entity", v_str(ctx->op ? ctx->op->entity : ""),
|
|
38
|
+
"name", v_str(ctx->op ? ctx->op->name : "")),
|
|
39
|
+
"spec", ctx->spec ? spec_to_value(ctx->spec) : voxgig_new_undef(),
|
|
40
|
+
"result", ctx->result ? result_to_value(ctx->result) : voxgig_new_undef(),
|
|
41
|
+
"response", response,
|
|
42
|
+
"meta", ctx->meta ? v_share(ctx->meta) : voxgig_new_undef());
|
|
43
|
+
return clean_util(ctx, record);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
char* context_str(Context* ctx) {
|
|
47
|
+
return voxgig_jsonify(context_to_value(ctx), NULL);
|
|
48
|
+
}
|
|
49
|
+
|
|
25
50
|
void ctx_out_set_point_val(Context* ctx, voxgig_value* v) {
|
|
26
51
|
ctx->out_point_kind = OUT_VAL;
|
|
27
52
|
ctx->out_point_val = v;
|
|
@@ -22,3 +22,19 @@ PNError* pn_error_new(const char* code, const char* msg) {
|
|
|
22
22
|
e->spec = NULL;
|
|
23
23
|
return e;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
// What make_error attached is already cleaned; the error carries no
|
|
27
|
+
// context.
|
|
28
|
+
voxgig_value* pn_error_to_value(PNError* e) {
|
|
29
|
+
if (!e) return voxgig_new_undef();
|
|
30
|
+
return cmap(5,
|
|
31
|
+
"sdk", v_str(e->sdk),
|
|
32
|
+
"code", v_str(e->code),
|
|
33
|
+
"message", v_str(e->msg),
|
|
34
|
+
"result", e->result ? v_share(e->result) : voxgig_new_undef(),
|
|
35
|
+
"spec", e->spec ? v_share(e->spec) : voxgig_new_undef());
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
char* pn_error_str(PNError* e) {
|
|
39
|
+
return voxgig_jsonify(pn_error_to_value(e), NULL);
|
|
40
|
+
}
|
|
@@ -55,6 +55,10 @@ typedef struct PNError {
|
|
|
55
55
|
} PNError;
|
|
56
56
|
|
|
57
57
|
PNError* pn_error_new(const char* code, const char* msg);
|
|
58
|
+
// The error as a record and as its default print: the message and the
|
|
59
|
+
// cleaned snapshots, nothing the pipeline holds live. Malloc'd string.
|
|
60
|
+
voxgig_value* pn_error_to_value(PNError* e);
|
|
61
|
+
char* pn_error_str(PNError* e);
|
|
58
62
|
|
|
59
63
|
// ===========================================================================
|
|
60
64
|
// Value helpers (mirrors core/helpers.rs). All return owned (unreleased)
|
|
@@ -407,6 +411,11 @@ struct Context {
|
|
|
407
411
|
Context* context_new(CtxSpec spec, Context* basectx);
|
|
408
412
|
PNError* context_make_error(Context* ctx, const char* code, const char* msg);
|
|
409
413
|
Utility* context_util(Context* ctx);
|
|
414
|
+
// The context as a record, CLEANED: it leaves the pipeline (a logger, an
|
|
415
|
+
// error dump), while the live fields stay raw for the pipeline's own use.
|
|
416
|
+
// context_str is its JSON, malloc'd.
|
|
417
|
+
voxgig_value* context_to_value(Context* ctx);
|
|
418
|
+
char* context_str(Context* ctx);
|
|
410
419
|
|
|
411
420
|
// ctx.out helpers.
|
|
412
421
|
void ctx_out_set_point_val(Context* ctx, voxgig_value* v);
|
|
@@ -478,7 +487,20 @@ void** feature_plugins(const char* name, size_t* n);
|
|
|
478
487
|
|
|
479
488
|
voxgig_value* clean_util(Context* ctx, voxgig_value* val);
|
|
480
489
|
char* clean_str(Context* ctx, const char* val); // returns malloc'd
|
|
490
|
+
// Register a secret value the SDK will mask from now on, through a context
|
|
491
|
+
// or straight against the options map a feature holds.
|
|
492
|
+
void clean_add_util(Context* ctx, const char* value);
|
|
493
|
+
void clean_add_opts(voxgig_value* options, const char* value);
|
|
494
|
+
bool clean_key_util(Context* ctx, const char* key);
|
|
495
|
+
voxgig_value* clean_opts(voxgig_value* options, voxgig_value* val);
|
|
496
|
+
voxgig_value* clean_make_config(voxgig_value* cleanopts);
|
|
497
|
+
voxgig_value* clean_split_values(voxgig_value* values);
|
|
498
|
+
void clean_add_sensitive_opts(voxgig_value* options, voxgig_value* val);
|
|
499
|
+
void clean_add_sensitive_util(Context* ctx, voxgig_value* val);
|
|
500
|
+
void clean_error_util(Context* ctx, PNError* err);
|
|
501
|
+
char* clean_base64(const char* in); // returns malloc'd
|
|
481
502
|
voxgig_value* done_util(Context* ctx, PNError** err);
|
|
503
|
+
void clean_explain_util(Context* ctx);
|
|
482
504
|
voxgig_value* make_error_util(Context* ctx, PNError* err, PNError** out);
|
|
483
505
|
void feature_add_util(Context* ctx, Feature* f);
|
|
484
506
|
void feature_hook_util(Context* ctx, const char* name);
|
|
@@ -66,6 +66,8 @@ static void audit_emit(AuditFeature* af, Context* ctx, const char* outcome) {
|
|
|
66
66
|
setp(record, "status", v_num((double)ctx->result->status));
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
record = clean_util(ctx, record);
|
|
70
|
+
|
|
69
71
|
voxgig_list_push(voxgig_as_list(af->records), voxgig_retain(record));
|
|
70
72
|
int64_t max = fopt_int(af->options, "max", 1000);
|
|
71
73
|
while (voxgig_list_len(voxgig_as_list(af->records)) > (size_t)max) {
|
|
@@ -415,6 +415,7 @@ static void cost_commit(CostTrack* t, voxgig_value* options, Context* ctx,
|
|
|
415
415
|
cmap(8, "seq", v_num((double)t->seq), "entity", v_str(entity), "op", v_str(opname),
|
|
416
416
|
"actor", v_str(actor), "amount", v_num(amount), "currency", v_str(t->currency),
|
|
417
417
|
"source", v_str(source), "attempts", v_num((double)attempts));
|
|
418
|
+
record = clean_util(ctx, record);
|
|
418
419
|
t->last = record;
|
|
419
420
|
|
|
420
421
|
voxgig_value* sink = getp(options, "sink");
|
|
@@ -13,17 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
#define DEBUG_ENTRY_KEY "debug_entry"
|
|
15
15
|
|
|
16
|
-
static const char* DEBUG_DEFAULT_REDACT[] = {
|
|
17
|
-
"authorization",
|
|
18
|
-
"cookie",
|
|
19
|
-
"set-cookie",
|
|
20
|
-
"api-key",
|
|
21
|
-
"apikey",
|
|
22
|
-
"x-api-key",
|
|
23
|
-
"idempotency-key",
|
|
24
|
-
};
|
|
25
|
-
#define DEBUG_DEFAULT_REDACT_LEN (sizeof(DEBUG_DEFAULT_REDACT) / sizeof(DEBUG_DEFAULT_REDACT[0]))
|
|
26
|
-
|
|
27
16
|
typedef struct {
|
|
28
17
|
Feature base;
|
|
29
18
|
char* name;
|
|
@@ -35,47 +24,43 @@ typedef struct {
|
|
|
35
24
|
voxgig_value* entries; // List of Value
|
|
36
25
|
} DebugFeature;
|
|
37
26
|
|
|
38
|
-
//
|
|
39
|
-
// `k.to_lowercase() == *p`).
|
|
27
|
+
// Case-insensitive equality.
|
|
40
28
|
static bool eq_lower(const char* key, const char* pat) {
|
|
41
29
|
size_t i = 0;
|
|
42
30
|
for (; key[i] != '\0' && pat[i] != '\0'; i++) {
|
|
43
|
-
if (
|
|
31
|
+
if (tolower((unsigned char)key[i]) != tolower((unsigned char)pat[i])) return false;
|
|
44
32
|
}
|
|
45
33
|
return key[i] == '\0' && pat[i] == '\0';
|
|
46
34
|
}
|
|
47
35
|
|
|
48
|
-
//
|
|
36
|
+
// The feature's own `redact` list; the core clean rules apply beside it.
|
|
49
37
|
static bool is_redacted(DebugFeature* df, const char* key) {
|
|
50
38
|
voxgig_value* rl = getp(df->options, "redact");
|
|
51
|
-
if (voxgig_is_list(rl))
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
for (size_t i = 0; i < DEBUG_DEFAULT_REDACT_LEN; i++) {
|
|
60
|
-
if (eq_lower(key, DEBUG_DEFAULT_REDACT[i])) return true;
|
|
39
|
+
if (!voxgig_is_list(rl)) return false;
|
|
40
|
+
voxgig_list* l = voxgig_as_list(rl);
|
|
41
|
+
for (size_t i = 0; i < l->len; i++) {
|
|
42
|
+
voxgig_value* pv = l->items[i];
|
|
43
|
+
if (voxgig_is_string(pv) && eq_lower(key, voxgig_as_string(pv))) return true;
|
|
61
44
|
}
|
|
62
45
|
return false;
|
|
63
46
|
}
|
|
64
47
|
|
|
65
|
-
|
|
48
|
+
// The core clean rules apply (clean.keys, every registered value); the
|
|
49
|
+
// feature's own `redact` list ADDS header names on top of them.
|
|
50
|
+
static voxgig_value* debug_redact(DebugFeature* df, Context* ctx, voxgig_value* headers) {
|
|
66
51
|
voxgig_value* out = v_map();
|
|
67
52
|
if (voxgig_is_map(headers)) {
|
|
68
53
|
voxgig_map* m = voxgig_as_map(headers);
|
|
69
54
|
for (size_t i = 0; i < m->len; i++) {
|
|
70
55
|
const char* k = m->entries[i].key;
|
|
71
56
|
if (is_redacted(df, k)) {
|
|
72
|
-
setp(out, k, v_str("
|
|
57
|
+
setp(out, k, v_str("[redacted]"));
|
|
73
58
|
} else {
|
|
74
59
|
setp(out, k, m->entries[i].value); // v.clone(): setp retains
|
|
75
60
|
}
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
|
-
return out;
|
|
63
|
+
return clean_util(ctx, out);
|
|
79
64
|
}
|
|
80
65
|
|
|
81
66
|
static char* dot_join(const char* a, const char* b) {
|
|
@@ -112,6 +97,11 @@ static void debug_finish(DebugFeature* df, Context* ctx, bool ok) {
|
|
|
112
97
|
}
|
|
113
98
|
}
|
|
114
99
|
|
|
100
|
+
// The whole entry leaves through the buffer and the callback: the url and
|
|
101
|
+
// the error message can carry a query credential the header mask above
|
|
102
|
+
// never saw.
|
|
103
|
+
entry = clean_util(ctx, entry);
|
|
104
|
+
|
|
115
105
|
voxgig_list_push(voxgig_as_list(df->entries), voxgig_retain(entry));
|
|
116
106
|
int64_t max = fopt_int(df->options, "max", 100);
|
|
117
107
|
while (voxgig_list_len(voxgig_as_list(df->entries)) > (size_t)max) {
|
|
@@ -144,7 +134,7 @@ static void debug_pre_request(DebugFeature* df, Context* ctx) {
|
|
|
144
134
|
} else {
|
|
145
135
|
setp(entry, "url", v_str(s->path ? s->path : ""));
|
|
146
136
|
}
|
|
147
|
-
setp(entry, "headers", debug_redact(df, s->headers));
|
|
137
|
+
setp(entry, "headers", debug_redact(df, ctx, s->headers));
|
|
148
138
|
}
|
|
149
139
|
ctx_out_extra_set(ctx, DEBUG_ENTRY_KEY, entry);
|
|
150
140
|
}
|
|
@@ -40,10 +40,29 @@ static void loghook(LogFeature* lf, const char* hook, Context* ctx) {
|
|
|
40
40
|
if (level_num("info") < lf->level) return;
|
|
41
41
|
|
|
42
42
|
const char* opname = ctx->op->name;
|
|
43
|
+
|
|
44
|
+
// A log line leaves the pipeline, so it carries the cleaned record: the
|
|
45
|
+
// spec after auth holds the credential, and a logger serialises whatever
|
|
46
|
+
// it is handed.
|
|
47
|
+
voxgig_value* record = clean_util(ctx, cmap(4,
|
|
48
|
+
"hook", v_str(hook),
|
|
49
|
+
"op", cmap(2, "entity", v_str(ctx->op->entity), "name", v_str(opname)),
|
|
50
|
+
"spec", ctx->spec ? spec_to_value(ctx->spec) : voxgig_new_undef(),
|
|
51
|
+
"ctx", context_to_value(ctx)));
|
|
52
|
+
|
|
53
|
+
voxgig_value* logger = getp(lf->options, "logger");
|
|
54
|
+
if (voxgig_is_func(logger)) {
|
|
55
|
+
call_vfn(logger, record);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
43
59
|
char specinfo[256];
|
|
44
60
|
specinfo[0] = '\0';
|
|
45
|
-
|
|
46
|
-
|
|
61
|
+
voxgig_value* spec = getp(record, "spec");
|
|
62
|
+
if (voxgig_is_map(spec)) {
|
|
63
|
+
const char* method = get_str(spec, "method");
|
|
64
|
+
const char* path = get_str(spec, "path");
|
|
65
|
+
snprintf(specinfo, sizeof(specinfo), "%s %s", method ? method : "", path ? path : "");
|
|
47
66
|
}
|
|
48
67
|
fprintf(stderr, "name=log hook=%s op=%s spec=%s\n", hook, opname, specinfo);
|
|
49
68
|
}
|
|
@@ -15,11 +15,59 @@
|
|
|
15
15
|
typedef struct {
|
|
16
16
|
// Activity tracking (mirrors the ts client._proxy record).
|
|
17
17
|
int64_t routed;
|
|
18
|
-
char* url;
|
|
18
|
+
char* url; // as it may be shown: userinfo masked; "" when none
|
|
19
|
+
char* raw_url; // as it is used, kept off the tracking record
|
|
19
20
|
char** no_proxy;
|
|
20
21
|
size_t no_proxy_len;
|
|
21
22
|
} ProxyTrack;
|
|
22
23
|
|
|
24
|
+
static char* percent_decode(const char* s) {
|
|
25
|
+
size_t n = strlen(s);
|
|
26
|
+
char* out = (char*)malloc(n + 1);
|
|
27
|
+
size_t o = 0;
|
|
28
|
+
for (size_t i = 0; i < n; i++) {
|
|
29
|
+
if ('%' == s[i] && i + 2 < n && isxdigit((unsigned char)s[i + 1]) &&
|
|
30
|
+
isxdigit((unsigned char)s[i + 2])) {
|
|
31
|
+
char hex[3] = { s[i + 1], s[i + 2], '\0' };
|
|
32
|
+
out[o++] = (char)strtol(hex, NULL, 16);
|
|
33
|
+
i += 2;
|
|
34
|
+
} else {
|
|
35
|
+
out[o++] = s[i];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
out[o] = '\0';
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// A proxy URL may carry credentials as userinfo, from the option or the
|
|
43
|
+
// environment, and neither is under a sensitive key name.
|
|
44
|
+
static void register_userinfo(Context* ctx, const char* url) {
|
|
45
|
+
const char* rest = url;
|
|
46
|
+
const char* p = strstr(url, "://");
|
|
47
|
+
if (p) rest = p + 3;
|
|
48
|
+
const char* slash = strchr(rest, '/');
|
|
49
|
+
size_t alen = slash ? (size_t)(slash - rest) : strlen(rest);
|
|
50
|
+
const char* at = NULL;
|
|
51
|
+
for (size_t i = 0; i < alen; i++) {
|
|
52
|
+
if ('@' == rest[i]) at = rest + i;
|
|
53
|
+
}
|
|
54
|
+
if (!at) return;
|
|
55
|
+
char* userinfo = (char*)malloc((size_t)(at - rest) + 1);
|
|
56
|
+
memcpy(userinfo, rest, (size_t)(at - rest));
|
|
57
|
+
userinfo[at - rest] = '\0';
|
|
58
|
+
char* colon = strchr(userinfo, ':');
|
|
59
|
+
if (colon) *colon = '\0';
|
|
60
|
+
const char* parts[2] = { userinfo, colon ? colon + 1 : NULL };
|
|
61
|
+
for (int i = 0; i < 2; i++) {
|
|
62
|
+
if (!parts[i] || parts[i][0] == '\0') continue;
|
|
63
|
+
clean_add_util(ctx, parts[i]);
|
|
64
|
+
char* decoded = percent_decode(parts[i]);
|
|
65
|
+
clean_add_util(ctx, decoded);
|
|
66
|
+
free(decoded);
|
|
67
|
+
}
|
|
68
|
+
free(userinfo);
|
|
69
|
+
}
|
|
70
|
+
|
|
23
71
|
typedef struct {
|
|
24
72
|
Feature base;
|
|
25
73
|
char* name;
|
|
@@ -117,7 +165,7 @@ static bool bypass(char** no_proxy, size_t n, const char* url) {
|
|
|
117
165
|
// Annotate fetchdef with the proxy address, unless there is no proxy or the
|
|
118
166
|
// host is bypassed. Returns fetchdef unchanged in those cases.
|
|
119
167
|
static voxgig_value* route(ProxyTrack* track, const char* url, voxgig_value* fetchdef) {
|
|
120
|
-
const char* proxy_url = track->
|
|
168
|
+
const char* proxy_url = track->raw_url;
|
|
121
169
|
if (proxy_url == NULL || proxy_url[0] == '\0' || bypass(track->no_proxy, track->no_proxy_len, url)) {
|
|
122
170
|
return fetchdef;
|
|
123
171
|
}
|
|
@@ -204,7 +252,10 @@ static void proxy_init(Feature* f, Context* ctx, voxgig_value* options) {
|
|
|
204
252
|
}
|
|
205
253
|
free(raw);
|
|
206
254
|
|
|
207
|
-
|
|
255
|
+
register_userinfo(ctx, url);
|
|
256
|
+
|
|
257
|
+
pf->track->url = clean_str(ctx, url);
|
|
258
|
+
pf->track->raw_url = url;
|
|
208
259
|
pf->track->no_proxy = final_np;
|
|
209
260
|
pf->track->no_proxy_len = final_len;
|
|
210
261
|
|
|
@@ -243,6 +294,7 @@ Feature* feature_proxy_new(void) {
|
|
|
243
294
|
pf->track = (ProxyTrack*)calloc(1, sizeof(ProxyTrack));
|
|
244
295
|
pf->track->routed = 0;
|
|
245
296
|
pf->track->url = strdup("");
|
|
297
|
+
pf->track->raw_url = strdup("");
|
|
246
298
|
pf->track->no_proxy = NULL;
|
|
247
299
|
pf->track->no_proxy_len = 0;
|
|
248
300
|
return (Feature*)pf;
|
|
@@ -316,9 +316,14 @@ static void secrets_reauth(SecretsFeature* f, voxgig_value* fetchdef) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
+
// Every value this feature resolves or buys is a secret the SDK handles,
|
|
320
|
+
// and none arrives under an option key the intake registration saw. The
|
|
321
|
+
// live options map is the client's own, so the registry it carries is the
|
|
322
|
+
// one every context reads.
|
|
319
323
|
static void secrets_setcred(SecretsFeature* f, const char* value) {
|
|
320
324
|
free(f->cred);
|
|
321
325
|
f->cred = strdup(NULL == value ? "" : value);
|
|
326
|
+
if ('\0' != f->cred[0]) clean_add_opts(f->liveopts, f->cred);
|
|
322
327
|
}
|
|
323
328
|
|
|
324
329
|
// ---- the exchange -----------------------------------------------------------
|
|
@@ -466,6 +471,7 @@ static const char* secrets_resolve(SecretsFeature* f, Context* ctx) {
|
|
|
466
471
|
// say whether it does.
|
|
467
472
|
free(f->refresh);
|
|
468
473
|
f->refresh = strdup(found ? found : "");
|
|
474
|
+
if ('\0' != f->refresh[0]) clean_add_opts(f->liveopts, f->refresh);
|
|
469
475
|
|
|
470
476
|
if ('\0' == f->cred[0]) {
|
|
471
477
|
// A starting access token supplied as the OPTION: read from the frozen
|
|
@@ -650,6 +656,7 @@ static void secrets_init(Feature* fb, Context* ctx, voxgig_value* options) {
|
|
|
650
656
|
} else {
|
|
651
657
|
explicit = get_str(xopts, "refresh");
|
|
652
658
|
}
|
|
659
|
+
if (NULL != explicit && '\0' != explicit[0]) clean_add_opts(f->liveopts, explicit);
|
|
653
660
|
|
|
654
661
|
size_t cap = 4;
|
|
655
662
|
size_t count = 0;
|
|
@@ -78,6 +78,8 @@ static void telemetry_close(TelemetryFeature* tf, Context* ctx, bool ok) {
|
|
|
78
78
|
setp(span, "durationMs", v_num((double)dur));
|
|
79
79
|
setp(span, "ok", v_bool(ok));
|
|
80
80
|
|
|
81
|
+
span = clean_util(ctx, span);
|
|
82
|
+
|
|
81
83
|
tf->active_spans -= 1;
|
|
82
84
|
voxgig_list_push(voxgig_as_list(tf->spans), voxgig_retain(span));
|
|
83
85
|
|
|
@@ -748,7 +748,7 @@ static void test_debug_redacts_and_honours_onentry_max(void) {
|
|
|
748
748
|
CHECK_INT_EQ(fh_track_int(f, "entries"), 1, "debug: ring buffer capped at 1");
|
|
749
749
|
CHECK_INT_EQ((int)voxgig_list_len(voxgig_as_list(seen)), 2, "debug: onEntry for both ops");
|
|
750
750
|
voxgig_value* headers = getp(voxgig_getelem(seen, v_int(0), v_undef()), "headers");
|
|
751
|
-
CHECK_STR_EQ(get_str(headers, "authorization"), "
|
|
751
|
+
CHECK_STR_EQ(get_str(headers, "authorization"), "[redacted]", "debug: redacted authorization");
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
static void test_debug_captures_failures(void) {
|
|
@@ -780,7 +780,7 @@ static void test_debug_injected_clock_and_custom_redact(void) {
|
|
|
780
780
|
o.headers = cmap(2, "x-secret", v_str("hide"), "x-ok", v_str("show"));
|
|
781
781
|
fh_op(&h, o);
|
|
782
782
|
voxgig_value* headers = getp(voxgig_getelem(seen, v_int(0), v_undef()), "headers");
|
|
783
|
-
CHECK_STR_EQ(get_str(headers, "x-secret"), "
|
|
783
|
+
CHECK_STR_EQ(get_str(headers, "x-secret"), "[redacted]", "debug custom redact: x-secret");
|
|
784
784
|
CHECK_STR_EQ(get_str(headers, "x-ok"), "show", "debug custom redact: x-ok kept");
|
|
785
785
|
}
|
|
786
786
|
|